#include <cloud_scape.h>
Public Member Functions | |
void | init (uint32 nWidth, uint32 nHeight, uint32 nDepth) |
SCloudTexture3D () | |
Data Fields | |
uint32 | Depth |
uint32 | Height |
uint8 * | Mem |
uint32 | NbH |
uint32 | NbW |
NLMISC::CSmartPtr< NL3D::CTextureMem > | Tex |
NL3D::CMaterial | ToBill |
NL3D::CMaterial | ToLight |
uint32 | Width |
|
Definition at line 51 of file cloud_scape.cpp. References NL3D::CMaterial::initUnlit(), Mem, NL3D::CMaterial::setBlend(), NL3D::CMaterial::setBlendFunc(), NL3D::CMaterial::setColor(), NL3D::CMaterial::setDoubleSided(), NL3D::CMaterial::setShader(), NL3D::CMaterial::setZFunc(), NL3D::CMaterial::setZWrite(), NL3D::CMaterial::texEnvArg0Alpha(), NL3D::CMaterial::texEnvArg0RGB(), NL3D::CMaterial::texEnvArg1RGB(), NL3D::CMaterial::texEnvOpAlpha(), NL3D::CMaterial::texEnvOpRGB(), ToBill, and ToLight.
00052 { 00053 Mem = NULL; 00054 ToLight.initUnlit(); 00055 ToLight.setShader (CMaterial::Normal); 00056 //ToLight.setTexture (0, Tex); 00057 ToLight.setZFunc (CMaterial::always); 00058 ToLight.setZWrite (false); 00059 ToLight.texEnvOpRGB (0, CMaterial::Replace); 00060 ToLight.texEnvArg0RGB (0, CMaterial::Diffuse, CMaterial::SrcColor); 00061 ToLight.texEnvOpAlpha (0, CMaterial::Replace); 00062 ToLight.texEnvArg0Alpha (0, CMaterial::Texture, CMaterial::InvSrcAlpha); 00063 ToLight.setBlend (true); 00064 ToLight.setBlendFunc (CMaterial::invsrcalpha, CMaterial::srcalpha); 00065 ToLight.setColor (CRGBA(0,0,0,255)); 00066 00067 ToBill.initUnlit(); 00068 ToBill.setZFunc (CMaterial::always); 00069 ToBill.setZWrite (false); 00070 ToBill.setDoubleSided(true); 00071 00072 ToBill.texEnvOpRGB (0, CMaterial::Add); 00073 ToBill.texEnvArg0RGB (0, CMaterial::Texture, CMaterial::SrcColor); 00074 ToBill.texEnvArg1RGB (0, CMaterial::Diffuse, CMaterial::SrcColor); 00075 ToBill.setColor (CRGBA(80,80,80,255)); 00076 00077 ToBill.texEnvOpAlpha (0, CMaterial::Replace); 00078 ToBill.texEnvArg0Alpha (0, CMaterial::Texture, CMaterial::SrcAlpha); 00079 00080 ToBill.texEnvOpRGB (1, CMaterial::Modulate); 00081 ToBill.texEnvArg0RGB (1, CMaterial::Previous, CMaterial::SrcColor); 00082 ToBill.texEnvArg1RGB (1, CMaterial::Previous, CMaterial::SrcAlpha); 00083 ToBill.texEnvOpAlpha (1, CMaterial::Replace); 00084 ToBill.texEnvArg0Alpha (1, CMaterial::Previous, CMaterial::SrcAlpha); 00085 00086 ToBill.setBlendFunc (CMaterial::one, CMaterial::invsrcalpha); 00087 ToBill.setBlend (true); 00088 } |
|
Definition at line 91 of file cloud_scape.cpp. References Depth, NLMISC::getPowerOf2(), Height, Mem, NbH, NbW, NLMISC::raiseToNextPowerOf2(), NL3D::CMaterial::setTexture(), Tex, ToBill, ToLight, uint32, uint8, and Width. Referenced by NL3D::CCloudScape::init().
00092 { 00093 if (Mem != NULL) 00094 return; 00095 00096 Width = raiseToNextPowerOf2 (nWidth); 00097 Height = raiseToNextPowerOf2 (nHeight); 00098 Depth = raiseToNextPowerOf2 (nDepth); 00099 uint32 vdpo2 = getPowerOf2(Depth); 00100 NbW = 1 << (vdpo2 / 2); 00101 if ((vdpo2 & 1) != 0) 00102 NbH = 2 << (vdpo2 / 2); 00103 else 00104 NbH = 1 << (vdpo2 / 2); 00105 00106 Mem = new uint8[4*NbW*Width*NbH*Height]; 00107 Tex = new CTextureMem (Mem, 4*NbW*Width*NbH*Height, true, false, NbW*Width, NbH*Height, CBitmap::RGBA); 00108 00109 Tex->setWrapS (ITexture::Clamp); 00110 Tex->setWrapT (ITexture::Clamp); 00111 Tex->setFilterMode (ITexture::Linear, ITexture::LinearMipMapOff); 00112 Tex->setReleasable (false); 00113 Tex->generate (); 00114 00115 ToLight.setTexture (0, Tex); 00116 00117 ToBill.setTexture(0, Tex); 00118 ToBill.setTexture(1, Tex); 00119 } |
|
Definition at line 48 of file cloud_scape.h. Referenced by init(). |
|
Definition at line 48 of file cloud_scape.h. Referenced by init(). |
|
Definition at line 50 of file cloud_scape.h. Referenced by init(), and SCloudTexture3D(). |
|
Definition at line 49 of file cloud_scape.h. Referenced by init(). |
|
Definition at line 49 of file cloud_scape.h. Referenced by init(). |
|
Definition at line 51 of file cloud_scape.h. Referenced by NL3D::CCloud::disp(), NL3D::CCloud::generate(), init(), and NL3D::CCloud::light(). |
|
Definition at line 53 of file cloud_scape.h. Referenced by NL3D::CCloud::genBill(), init(), and SCloudTexture3D(). |
|
Definition at line 52 of file cloud_scape.h. Referenced by init(), NL3D::CCloud::light(), and SCloudTexture3D(). |
|
Definition at line 48 of file cloud_scape.h. Referenced by init(). |