stencil shadows don't work

anear

08-03-2007 18:49:27

Only texture shadow works in my program, neither SHADOWTYPE_STENCIL_MODULATIVE nor SHADOWTYPE_STENCIL_ADDITIVE works! I have to use stencil shadows coz texture shadow looks terrible in the scene.


I got a runtime error when using any stencil shadows. "...exe has encountered a problem and needs to close. We are sorry for the inconvenience."

the Ogre.log file is

18:36:57: Creating resource group General
18:36:57: Creating resource group Internal
18:36:57: Creating resource group Autodetect
18:36:57: Registering ResourceManager for type Material
18:36:57: Registering ResourceManager for type Mesh
18:36:57: Registering ResourceManager for type Skeleton
18:36:57: MovableObjectFactory for type 'ParticleSystem' registered.
18:36:57: Loading library OgrePlatform.dll
18:36:57: OverlayElementFactory for type Panel registered.
18:36:57: OverlayElementFactory for type BorderPanel registered.
18:36:57: OverlayElementFactory for type TextArea registered.
18:36:57: Registering ResourceManager for type Font
18:36:57: ArchiveFactory for archive type FileSystem registered.
18:36:57: ArchiveFactory for archive type Zip registered.
18:36:57: DevIL version: Developer's Image Library (DevIL) 1.6.7 Oct 28 2005
18:36:57: DevIL image formats: bmp dib cut dcx dds gif hdr ico cur jpg jpe jpeg lif mdl mng jng pcx pic pix png pbm pgm pnm ppm psd pdd psp pxr sgi bw rgb rgba tga vda icb vst tif tiff wal xpm raw
18:36:57: Registering ResourceManager for type HighLevelGpuProgram
18:36:57: Registering ResourceManager for type Compositor
18:36:57: MovableObjectFactory for type 'Entity' registered.
18:36:57: MovableObjectFactory for type 'Light' registered.
18:36:57: MovableObjectFactory for type 'BillboardSet' registered.
18:36:57: MovableObjectFactory for type 'ManualObject' registered.
18:36:57: MovableObjectFactory for type 'BillboardChain' registered.
18:36:57: MovableObjectFactory for type 'RibbonTrail' registered.
18:36:57: Loading library .\RenderSystem_Direct3D9
18:36:57: D3D9 : Direct3D9 Rendering Subsystem created.
18:36:57: D3D9: Driver Detection Starts
18:36:57: D3D9: Driver Detection Ends
18:36:57: Loading library .\RenderSystem_GL
18:36:57: OpenGL Rendering Subsystem created.
18:36:57: Loading library .\Plugin_ParticleFX
18:36:57: Particle Emitter Type 'Point' registered
18:36:57: Particle Emitter Type 'Box' registered
18:36:57: Particle Emitter Type 'Ellipsoid' registered
18:36:57: Particle Emitter Type 'Cylinder' registered
18:36:57: Particle Emitter Type 'Ring' registered
18:36:57: Particle Emitter Type 'HollowEllipsoid' registered
18:36:57: Particle Affector Type 'LinearForce' registered
18:36:57: Particle Affector Type 'ColourFader' registered
18:36:57: Particle Affector Type 'ColourFader2' registered
18:36:57: Particle Affector Type 'ColourImage' registered
18:36:57: Particle Affector Type 'ColourInterpolator' registered
18:36:57: Particle Affector Type 'Scaler' registered
18:36:57: Particle Affector Type 'Rotator' registered
18:36:57: Particle Affector Type 'DirectionRandomiser' registered
18:36:57: Particle Affector Type 'DeflectorPlane' registered
18:36:57: Loading library .\Plugin_BSPSceneManager
18:36:57: Registering ResourceManager for type BspLevel
18:36:57: Loading library .\Plugin_OctreeSceneManager
18:36:57: Loading library .\Plugin_CgProgramManager
18:36:57: *-*-* OGRE Initialising
18:36:57: *-*-* Version 1.2.2 (Dagon)
18:36:57: Creating resource group Bootstrap
18:36:57: Added resource location '../Media/overlays/' of type 'FileSystem' to resource group 'Bootstrap'
18:36:57: Added resource location '../Media/' of type 'FileSystem' to resource group 'General'
18:36:57: Added resource location '../Media/images/' of type 'FileSystem' to resource group 'General'
18:36:57: Added resource location '../Media/materials/' of type 'FileSystem' to resource group 'General'
18:36:57: Added resource location '../Media/meshes/' of type 'FileSystem' to resource group 'General'
18:36:57: Added resource location '../Media/particles/' of type 'FileSystem' to resource group 'General'
18:36:57: Added resource location '../Media/315/' of type 'FileSystem' to resource group 'General'
18:36:57: Added resource location 'C:/ogrenew/Animism/Media/materials/temp' of type 'FileSystem' to resource group 'General'
18:36:57: Added resource location 'C:/ogrenew/Animism/Media/materials/textures' of type 'FileSystem' to resource group 'General'
18:36:57: D3D9 : RenderSystem Option: Allow NVPerfHUD = No
18:36:57: D3D9 : RenderSystem Option: Anti aliasing = None
18:36:57: D3D9 : RenderSystem Option: Floating-point mode = Fastest
18:36:57: D3D9 : RenderSystem Option: Full Screen = Yes
18:36:57: D3D9 : RenderSystem Option: Rendering Device = NVIDIA GeForce2 MX/MX 400
18:36:57: D3D9 : RenderSystem Option: VSync = No
18:36:57: D3D9 : RenderSystem Option: Video Mode = 1280 x 1024 @ 32-bit colour
18:36:58: D3D9 : Subsystem Initialising
18:36:58: D3D9RenderSystem::createRenderWindow "Catching falling oranges", 1280x1024 fullscreen miscParams: FSAA=0 FSAAQuality=0 colourDepth=32 useNVPerfHUD=false vsync=false
18:36:58: D3D9 : Created D3D9 Rendering Window 'Catching falling oranges' : 1280x1024, 32bpp
18:36:58: Registering ResourceManager for type Texture
18:36:58: Registering ResourceManager for type GpuProgram
18:36:58: RenderSystem capabilities
18:36:58: -------------------------
18:36:58: * Hardware generation of mipmaps: yes
18:36:58: * Texture blending: yes
18:36:58: * Anisotropic texture filtering: yes
18:36:58: * Dot product texture operation: yes
18:36:58: * Cube mapping: yes
18:36:58: * Hardware stencil buffer: yes
18:36:58: - Stencil depth: 8
18:36:58: - Two sided stencil support: no
18:36:58: - Wrap stencil values: yes
18:36:58: * Hardware vertex / index buffers: yes
18:36:58: * Vertex programs: no
18:36:58: * Fragment programs: no
18:36:58: * Texture Compression: yes
18:36:58: - DXT: yes
18:36:58: - VTC: no
18:36:58: * Scissor Rectangle: yes
18:36:58: * Hardware Occlusion Query: no
18:36:58: * User clip planes: no
18:36:58: * VET_UBYTE4 vertex element type: no
18:36:58: * Infinite far plane projection: no
18:36:58: * Hardware render-to-texture: yes
18:36:58: * Floating point textures: no
18:36:58: * Non-power-of-two textures: yes
18:36:58: * Volume textures: no
18:36:58: * Multiple Render Targets: 1
18:36:58: * Point Sprites: yes
18:36:58: * Extended point parameters: yes
18:36:58: * Max Point Size: 64
18:36:58: ***************************************
18:36:58: *** D3D9 : Subsystem Initialised OK ***
18:36:58: ***************************************
18:36:58: ResourceBackgroundQueue - threading disabled
18:36:58: Particle Renderer Type 'billboard' registered
18:36:58: Creating viewport on target 'Catching falling oranges', rendering from camera 'PlayerCam', relative dimensions L: 0.00 T: 0.00 W: 1.00 H: 1.00 ZOrder: 0
18:36:58: Viewport for camera 'PlayerCam', actual dimensions L: 0 T: 0 W: 1280 H: 1024
18:36:58: Parsing scripts for resource group Autodetect
18:36:58: Finished parsing scripts for resource group Autodetect
18:36:58: Parsing scripts for resource group Bootstrap
18:36:58: Parsing script OgreCore.material
18:36:58: Parsing script OgreProfiler.material
18:36:58: Parsing script Ogre.fontdef
18:36:58: Parsing script OgreDebugPanel.overlay
18:36:58: Texture: nx.gui.center.png: Loading 1 faces(PF_A8B8G8R8,16x16x1) with hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,16x16x1.
18:36:58: Font TrebuchetMSBoldusing texture size 512x512
18:36:58: Info: Freetype returned null for character 160 in font TrebuchetMSBold
18:36:58: Texture: TrebuchetMSBoldTexture: Loading 1 faces(PF_BYTE_LA,512x512x1) with 0 generated mipmaps from Image. Internal format is PF_A8R8G8B8,512x512x1.
18:36:58: Bad element attribute line: 'right 2' for element nx.gui.logo in overlay Core/DebugOverlay
18:36:58: Texture: nx.gui.logo.png: Loading 1 faces(PF_A8B8G8R8,64x64x1) with hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,64x64x1.
18:36:58: Bad element attribute line: 'right 2' for element nx.gui.instructions in overlay Core/DebugOverlay
18:36:58: D3D9 : ***** Dimensions altered by the render system
18:36:58: D3D9 : ***** Source image dimensions : 196x196
18:36:58: D3D9 : ***** Texture dimensions : 256x256
18:36:58: Texture: controls1.png: Loading 1 faces(PF_A8B8G8R8,196x196x1) with 8 generated mipmaps from Image. Internal format is PF_A8R8G8B8,256x256x1.
18:36:58: Parsing script OgreLoadingPanel.overlay
18:36:58: Texture: New_Ogre_Border_Center.png: Loading 1 faces(PF_A8B8G8R8,256x128x1) with hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,256x128x1.
18:36:58: Texture: New_Ogre_Border.png: Loading 1 faces(PF_A8B8G8R8,256x256x1) with hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,256x256x1.
18:36:58: Finished parsing scripts for resource group Bootstrap
18:36:58: Parsing scripts for resource group General
18:36:58: Parsing script Examples.program
18:36:58: Parsing script StdQuad_vp.program
18:36:58: Parsing script Eunice.material
18:36:58: Parsing script heightmap.material
18:36:58: Parsing script nx.grid.material
18:36:58: Parsing script nx.particles.material
18:36:58: Parsing script nx.shapes.material
18:36:58: Error in material nx.raycaster at line 116 of nx.shapes.material: Bad specular attribute, wrong number of parameters (expected 2, 4 or 5)
18:36:58: Error in material nx.crosshair at line 131 of nx.shapes.material: Bad specular attribute, wrong number of parameters (expected 2, 4 or 5)
18:36:58: Parsing script nx.stairs.material
18:36:58: Parsing script nx.track.material
18:36:58: Parsing script nx.zones.material
18:36:58: Parsing script nature.cloud_dome.material
18:36:58: Parsing script nx.315.material
18:36:58: Parsing script nx6.material
18:36:58: Parsing script Scene.material
18:36:58: Parsing script BlackAndWhite.material
18:36:58: Parsing script Bloom.material
18:36:58: Parsing script DOF.material
18:36:58: Parsing script Embossed.material
18:36:58: Parsing script Example-DynTex.material
18:36:58: Parsing script Example-Water.material
18:36:58: Parsing script Example.material
18:36:58: Parsing script Examples-Advanced.material
18:36:58: Parsing script facial.material
18:36:58: Parsing script Glass.material
18:36:58: Parsing script hdr.material
18:36:58: Parsing script HeatVision.material
18:36:58: Parsing script Hurt.material
18:36:58: Parsing script Invert.material
18:36:58: Parsing script Laplace.material
18:36:58: Parsing script MotionBlur.material
18:36:58: Parsing script Ocean.material
18:36:58: Parsing script OffsetMapping.material
18:36:58: Parsing script Ogre.material
18:36:58: Parsing script OldMovie.material
18:36:58: Parsing script OldTV.material
18:36:58: Parsing script Posterize.material
18:36:58: Parsing script RZR-002.material
18:36:58: Parsing script SharpenEdges.material
18:36:58: Parsing script smoke.material
18:36:58: Parsing script Tiling.material
18:36:58: Parsing script Examples.compositor
18:36:58: Parsing script nx.particles.particle
18:36:58: Finished parsing scripts for resource group General
18:36:58: Parsing scripts for resource group Internal
18:36:58: Finished parsing scripts for resource group Internal
18:36:58: Win32Input8: DirectInput Activation Starts
18:36:58: Win32Input8: Establishing keyboard input.
18:36:58: Win32Input8: Keyboard input established.
18:36:58: Win32Input8: Initializing mouse input in immediate mode.
18:36:58: Win32Input8: Mouse input in immediate mode initialized.
18:36:58: Win32Input8: DirectInput OK.
18:36:58: Texture: nx.grid.floor.png: Loading 1 faces(PF_A8B8G8R8,512x512x1) with hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,512x512x1.
18:36:58: [NxOgre] NxOgre Log started.
18:36:58: [NxOgre] Starting up PhysX SDK
18:36:59: [NxOgre] Started.
18:36:59: [NxOgre] Creating scene 'Main'.
18:36:59: Texture: clouds.jpg: Loading 1 faces(PF_B8G8R8,256x256x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,256x256x1.
18:36:59: Mesh: Loading orange.1m.mesh.
18:36:59: D3D9 : ***** Dimensions altered by the render system
18:36:59: D3D9 : ***** Source image dimensions : 543x545
18:36:59: D3D9 : ***** Texture dimensions : 1024x1024
18:36:59: Texture: OrangeTex.jpg: Loading 1 faces(PF_B8G8R8,543x545x1) with 10 generated mipmaps from Image. Internal format is PF_X8R8G8B8,1024x1024x1.
18:36:59: Mesh: Loading basket.mesh.
18:36:59: Texture: basket.tga: Loading 1 faces(PF_R8G8B8,256x256x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,256x256x1.
18:36:59: Mesh: Loading tree.mesh.
18:36:59: Texture: spot_shadow_fade.png: Loading 1 faces(PF_B8G8R8,128x128x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.


The piece of code related to this is

mSceneMgr->setAmbientLight(ColourValue(0, 0, 0)); //0.25, 0.25, 0.25));
mSceneMgr->setShadowTechnique(SHADOWTYPE_STENCIL_MODULATIVE); // SHADOWTYPE_TEXTURE_MODULATIVE
//mSceneMgr->setShadowTextureSize(1024);

Light* mSunLight = mSceneMgr->createLight("SunLight");
mSunLight->setType( Light::LT_POINT );
mSunLight->setPosition( Vector3(0, 100, 0) ); // 0, 150, 0) );
mSunLight->setCastShadows(true);
mSunLight->setSpecularColour(0.01,0.01,0.01);


Any idea why stencil shadows don't work? Thanks

Xpoint

10-03-2007 20:03:30

Sure you're in the correct forum? Try the Ogre Help forum. :wink: Can't see any question about NxOgre.