93#define DEBUG_SHADOW_RENDERING 0
584 WWDEBUG_SAY((
"Could not find texture: MultProjectorGradient.tga!\n"));
600#if (DEBUG_SHADOW_RENDERING)
686 WWDEBUG_SAY((
"Could not find texture: AddProjectorGradient.tga!\n"));
689#if (DEBUG_SHADOW_RENDERING)
875 WWDEBUG_SAY((
"Attempting to generate projection for a NULL model\r\n"));
927 texture_tm.
Look_At(lightpos,wrld_center,0.0f);
954 if (user_znear != -1.0f) {
955 znear = box.
Center.
Z + user_znear;
957 if (user_zfar != -1.0f) {
958 zfar = box.
Center.
Z + user_zfar;
1001 if (model ==
NULL) {
1002 WWDEBUG_SAY((
"Attempting to generate projection for a NULL model\r\n"));
1055 Matrix3D texture_tm,texture_tm_inv;
1056 texture_tm.
Look_At(camera_position,camera_target,0.0f);
1080 if (user_znear != -1.0f) {
1081 znear = -box.
Center.
Z + user_znear;
1083 if (user_zfar != -1.0f) {
1084 zfar = -box.
Center.
Z + user_zfar;
1121 if ((model ==
NULL) || (context ==
NULL))
1133 if (rtarget !=
NULL)
1151 Vector3 color(0.0f,0.0f,0.0f);
1153 color.
Set(1.0f,1.0f,1.0f);
1156 bool zclear=ztarget!=
NULL;
1175 BWRenderClass bwr((
unsigned char*)shadow_surface->getDataPtr(),tex_size);
1285 float inv_size=1.0f/size;
1286 Vector2 vmin(1.0f*inv_size,1.0f*inv_size);
1287 Vector2 vmax((size-1.0f)*inv_size,(size-1.0f)*inv_size);
1313 Transform.Get_Orthogonal_Inverse(world_to_texture);
1324 if (intensity_delta > max_intensity_delta) {
1326 }
else if (intensity_delta < -max_intensity_delta) {
1339 vmat->
Set_Emissive(actual_intensity,actual_intensity,actual_intensity);
1341 vmat->
Set_Emissive(1.0f - actual_intensity,1.0f - actual_intensity,1.0f - actual_intensity);
void Transform(const Matrix3D &tm)
void Fill(unsigned char c)
void Set_Clip_Planes(float znear, float zfar)
void Set_Viewport(const Vector2 &min, const Vector2 &max)
void Set_View_Plane(const Vector2 &min, const Vector2 &max)
void Set_Projection_Type(ProjectionType ptype)
virtual void Set_Transform(const Matrix3D &m)
void Set_Cull_Box(const AABoxClass &box, bool just_loaded=false)
static void Set_Render_Target_With_Z(TextureClass *texture, ZTextureClass *ztexture=NULL)
static void Set_Render_Target(IDirect3DSurface8 *render_target, bool use_default_depth_buffer=false)
static void Multiply(const Matrix3D &A, const Matrix3D &B, Matrix3D *set_result)
void Get_Orthogonal_Inverse(Matrix3D &set_inverse) const
static WWINLINE void Transform_Vector(const Matrix3D &tm, const Vector3 &in, Vector3 *out)
void Look_At(const Vector3 &p, const Vector3 &t, float roll)
WWINLINE friend Matrix4x4 Multiply(const Matrix4x4 &a, const Matrix4x4 &b)
OBBoxClass WorldBoundingVolume
virtual void Set_Perspective_Projection(float hfov, float vfov, float znear, float zfar)
MatrixMapperClass * Mapper
virtual void Set_Ortho_Projection(float xmin, float xmax, float ymin, float ymax, float znear, float zfar)
virtual void Update_WS_Bounding_Volume(void)
virtual void Set_Transform(const Matrix3D &tm)
WWINLINE void Release_Ref(void) const
TexProjectClass * Texture_Projector
virtual void Get_Obj_Space_Bounding_Box(AABoxClass &box) const
const Matrix3D & Get_Transform(void) const
virtual void Special_Render(SpecialRenderInfoClass &rinfo)
void Set_Src_Blend_Func(SrcBlendFuncType x)
void Set_Post_Detail_Color_Func(DetailColorFuncType x)
void Set_Dst_Blend_Func(DstBlendFuncType x)
@ SECONDARY_GRADIENT_DISABLE
void Enable_Fog(const char *source)
BWRenderClass * BWRenderer
void Set_Render_Target(TextureClass *render_target, ZTextureClass *ztarget=NULL)
virtual void Set_Perspective_Projection(float hfov, float vfov, float znear, float zfar)
bool Needs_Render_Target(void)
void Configure_Camera(CameraClass &camera)
void Set_Attenuation(float attenuation)
bool Get_Flag(uint32 flag) const
void Set_Texture(TextureClass *texture)
bool Compute_Perspective_Projection(RenderObjClass *obj, const Vector3 &lightpos, float znear=-1.0f, float zfar=-1.0f)
bool Compute_Texture(RenderObjClass *model, SpecialRenderInfoClass *context)
virtual ~TexProjectClass(void)
float Get_Intensity(void)
virtual void Pre_Render_Update(const Matrix3D &camera)
bool Compute_Ortho_Projection(RenderObjClass *obj, const Vector3 &lightdir, float znear=-1.0f, float zfar=-1.0f)
TextureClass * Peek_Texture(void) const
virtual void Update_WS_Bounding_Volume(void)
void Set_Flag(uint32 flag, bool onoff)
ZTextureClass * DepthStencilTarget
virtual void Set_Ortho_Projection(float xmin, float xmax, float ymin, float ymax, float znear, float zfar)
void Set_Texture_Size(int size)
MaterialPassClass * Peek_Material_Pass(void)
TextureClass * Get_Texture(void) const
bool Is_Intensity_Zero(void)
TextureClass * Peek_Render_Target(TextureClass **rtarget=NULL, ZTextureClass **ztarget=NULL)
void Init_Multiplicative(void)
void Enable_Depth_Gradient(bool onoff)
int Get_Texture_Size(void)
bool Is_Depth_Gradient_Enabled(bool onoff)
bool Is_Attenuation_Enabled(void)
MaterialPassClass * MaterialPass
MatrixMapperClass * Mapper1
float Get_Attenuation(void)
void Enable_Attenuation(bool onoff)
TextureClass * RenderTarget
void Set_Intensity(float intensity, bool immediate=false)
TextureFilterClass & Get_Filter()
void Set_V_Addr_Mode(TxtAddrMode mode)
void Set_U_Addr_Mode(TxtAddrMode mode)
WWINLINE float Length(void) const
WWINLINE void Set(float x, float y, float z)
float Quick_Length(void) const
void Set_Lighting(bool lighting)
void Set_Specular(const Vector3 &color)
void Set_Diffuse(const Vector3 &color)
void Set_Ambient(const Vector3 &color)
void Set_Emissive(const Vector3 &color)
void Set_Mapper(TextureMapperClass *mapper, int stage=0)
void Set_Opacity(float o)
virtual TextureClass * Get_Texture(const char *filename, MipCountType mip_level_count=MIP_LEVELS_ALL, WW3DFormat texture_format=WW3D_FORMAT_UNKNOWN, bool allow_compression=true, TextureBaseClass::TexAssetType type=TextureBaseClass::TEX_REGULAR, bool allow_reduction=true)
static WW3DAssetManager * Get_Instance(void)
static WW3DErrorType Render(const LayerListClass &layerlist)
static bool Is_Snapshot_Activated()
static unsigned int Get_Frame_Time(void)
static void Activate_Snapshot(bool b)
static WW3DErrorType Begin_Render(bool clear=false, bool clearz=true, const Vector3 &color=Vector3(0, 0, 0), float dest_alpha=0.0f, void(*network_callback)(void)=NULL)
static WW3DErrorType End_Render(bool flip_frame=true)
static float Atan(float x)
static WWINLINE float Fabs(float val)
#define REF_PTR_RELEASE(x)
#define REF_PTR_SET(dst, src)
#define SHADE_CNST(depth_compare, depth_mask, color_mask, src_blend, dst_blend, fog, pri_grad, sec_grad, texture, alpha_test, cullmode, post_det_color, post_det_alpha)
const float INTENSITY_RATE_OF_CHANGE