Page 1 of 1

Quick 'n Dirty SkyManager: day/night transitions + suns

Posted: Wed May 16, 2007 9:34 pm
by mikeInside
Image
Image
Image

Click here for video



This is just a simple way to get Day/Night transitions into your program
* The sky's brightness is influenced by the position of the sun
* The sky is animated
* You can add as many suns/comets as you like, all with different orbits
* Night time has its own lighting, so you can still see even if there are no suns in the sky
* Particle effects are automatically generated based on the star properties you give
* You can get it working with just 3 lines of code


Click here to download the code
See the included Readme file for more info, and post screenshots if you use this for anything :)

Posted: Wed May 16, 2007 9:40 pm
by KungFooMasta
Cool Video!

Posted: Thu May 17, 2007 2:34 am
by bharling
Thats really cool, thanks!, I re-wrote it in python, and have included it in the python-ogre techdemo project, some shots are here.

http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=4334

I've kept your copyright of course, but please say if you dont want it used in the demo.

Once again, thanks for this simple solution :)

Posted: Thu May 17, 2007 5:29 am
by Wretched_Wyx
Really cool, good job there. You should think about collaborating with Kencho on Caelum!

Posted: Thu May 17, 2007 8:54 am
by mikeInside
bharling wrote:Thats really cool, thanks!, I re-wrote it in python, and have included it in the python-ogre techdemo project, some shots are here.

http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=4334

I've kept your copyright of course, but please say if you dont want it used in the demo.

Once again, thanks for this simple solution
I'm just happy to see it being used! Especially to see it behind some good looking terrain instead of the crappy flat plane I was using. I'm not sure what your shadow problem is, but the first thing I would try is setting directionalStars to false in the init call.


Really cool, good job there. You should think about collaborating with Kencho on Caelum!
Nah... the reason why mine is so basic is because my knowledge of Ogre is still pretty basic =p The sky shader was supplied by HexiDave and the particle effect was done by Mansur; I just wrote the code to mix them together and make it easy to use.

Thanks though... and thanks to KungFooMasta too :)

Posted: Thu May 31, 2007 12:31 am
by rewb0rn
i get an exception, log says

Code: Select all

01:29:05: WARNING: material SkydomeShaderBlend has no supportable Techniques and will be blank. Explanation: 
Pass 0: Vertex program skydomeVS cannot be used - not supported.
Does my graphic card not support the shader?

Posted: Sat Jun 02, 2007 7:41 am
by mikeInside
I would have thought the geforce 6800gs would be up to the task since it has support for Shader Model 3.0, Pixel Shader 3.0 and Vertex Shader 3.0. I'm not sure why it doesn't like the shader sorry.

Posted: Thu Jun 21, 2007 8:18 pm
by bharling
Yeah, I'm now getting the same kind of thing after upgrading to the latest Ogre version. Seems something has changed in shader compilation from 1.4.0 - 1.4.2. If anyone can shed any light I'm sure we'd all be very grateful :)

Posted: Thu Jun 21, 2007 8:41 pm
by HexiDave
From having suffered something similar in the past, make sure your targets/profiles are set properly in the vertex/fragment references in the Material file.

Posted: Fri Jun 22, 2007 9:46 am
by sinbad
And check the ogre.log for the compile error.

I accidentally updated the Dx SDK to April 2007 in 1.4.2 and the HLSL compiler has dropped support for SM1 shaders. Change them to Cg to resolve this which still supports SM1. It's just a case of changing the language code to cg and 'target' to 'profiles' (and you can add a GL profile in there if you like)

Posted: Mon Jun 25, 2007 2:25 pm
by bharling
Firstly, apologies I know this is the wrong thread for questions, but I did not want to start a new topic. So I had a tab at what sinbad suggests, here is my best effort, of course it does not work :?

if anyone can help, please do :)

first: material file:

Code: Select all

fragment_program skydomePS hlsl
{
   source sky_vp.cg
   profile ps_1_4
   entry_point sky_vs
}

vertex_program skydomeVS hlsl
{
   source sky_fp.cg
   profile vs_1_1
   entry_point sky_ps
}

material SkydomeShaderBlend
{
   technique
   {
      pass
      {
         fragment_program_ref skydomePS
         {
            //Shader Constant: fBlend
            param_named fBlend float 0.000000
         }

         vertex_program_ref skydomeVS
         {
            //Shader Constant: matViewProjection
            param_named_auto matViewProjection viewproj_matrix

            //Shader Constant: fAnimSpeed
            param_named fAnimSpeed float2 -5.0 2.5

            //Shader Constant: fTime0_1
            param_named_auto fTime0_1 time_0_1 120.0
            param_named fTexScales float4 3.0 3.0 5.0 5.0
         }

         texture_unit
         {
            texture nightcloud2.png 2d
         }
         texture_unit
         {
            texture daycloud.png 2d
         }
      }
   }
}
heres my attempt at translating the vertex prog:

Code: Select all

/* SkyManager VP - Cg version */

void sky_vs (	float4 Position : POSITION, 
			float2 TexCoord : TEXCOORD0,

			out float4 pos : POSITION,
			out float2 tex0 : TEXCOORD0
			out float2 tex1 : TEXCOORD1

			uniform float4x4 worldViewProj,
			uniform float2 fAnimSpeed,
			uniform float fTime0_1,
			uniform float4 fTexScales	)
{
pos = mul( worldViewProj, Position );
float2 animBonus = float2(fAnimSpeed.x, fAnimSpeed.y)*fTime0_1;

tex0 = float2(TexCoord.x * 1/fTexScales.x, TexCoord.y * 1/fTexScales.y) + fAnimBonus;
tex1 = float2(TexCoord.x * 1/fTexScales.z, TexCoord.y * 1/fTexScales.w) + fAnimBonus;
}
and my increasingly pitiful attempt at the fragment prog translation...

Code: Select all

/* SkyManager FP - Cg version */

void sky_ps (	
			float2 TexCoord0 : TEXCOORD0,
			float2 TexCoord1 : TEXCOORD1,

			uniform float fBlend,

			uniform sampler2D Texture0 : register(s0),
			uniform sampler2D Texture1 : register(s1),

			out float4 col : COLOR0		)

{
float4 tex0 = tex2D(Texture0, TexCoord0);
float4 tex1 = tex3D(Texture0, TexCoord1;

col = ( lerp (tex0, tex1, fBlend ) );
}
Once again apologies for the 'supporty' post, and my rather obvious inexperience with SL.[/code]

Posted: Fri Sep 14, 2007 2:19 pm
by romeoxbm
I tried to use the SkyManager into my techDemo, but something doesn't work because i obtain an exception when the program starts up.

Here it is my Ogre.log:
15:14:17: Creating resource group General
15:14:17: Creating resource group Internal
15:14:17: Creating resource group Autodetect
15:14:17: SceneManagerFactory for type 'DefaultSceneManager' registered.
15:14:17: Registering ResourceManager for type Material
15:14:17: Registering ResourceManager for type Mesh
15:14:17: Registering ResourceManager for type Skeleton
15:14:17: MovableObjectFactory for type 'ParticleSystem' registered.
15:14:17: OverlayElementFactory for type Panel registered.
15:14:17: OverlayElementFactory for type BorderPanel registered.
15:14:17: OverlayElementFactory for type TextArea registered.
15:14:17: Registering ResourceManager for type Font
15:14:17: ArchiveFactory for archive type FileSystem registered.
15:14:17: ArchiveFactory for archive type Zip registered.
15:14:17: FreeImage version: 3.9.2
15:14:17: This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for details
15:14:17: Supported formats: bmp,ico,jpg,jif,jpeg,jpe,jng,koa,iff,lbm,mng,pbm,pbm,pcd,pcx,pgm,pgm,png,ppm,ppm,ras,tga,targa,tif,tiff,wap,wbmp,wbm,psd,cut,xbm,xpm,gif,hdr,g3,sgi
15:14:17: DDS codec registering
15:14:17: Registering ResourceManager for type HighLevelGpuProgram
15:14:17: Registering ResourceManager for type Compositor
15:14:17: MovableObjectFactory for type 'Entity' registered.
15:14:17: MovableObjectFactory for type 'Light' registered.
15:14:17: MovableObjectFactory for type 'BillboardSet' registered.
15:14:17: MovableObjectFactory for type 'ManualObject' registered.
15:14:17: MovableObjectFactory for type 'BillboardChain' registered.
15:14:17: MovableObjectFactory for type 'RibbonTrail' registered.
15:14:17: Loading library .\RenderSystem_Direct3D9_d
15:14:17: Installing plugin: D3D9 RenderSystem
15:14:17: D3D9 : Direct3D9 Rendering Subsystem created.
15:14:17: D3D9: Driver Detection Starts
15:14:17: D3D9: Driver Detection Ends
15:14:17: Plugin successfully installed
15:14:17: Loading library .\RenderSystem_GL_d
15:14:17: Installing plugin: GL RenderSystem
15:14:17: OpenGL Rendering Subsystem created.
15:14:18: Plugin successfully installed
15:14:18: Loading library .\Plugin_ParticleFX_d
15:14:18: Installing plugin: ParticleFX
15:14:18: Particle Emitter Type 'Point' registered
15:14:18: Particle Emitter Type 'Box' registered
15:14:18: Particle Emitter Type 'Ellipsoid' registered
15:14:18: Particle Emitter Type 'Cylinder' registered
15:14:18: Particle Emitter Type 'Ring' registered
15:14:18: Particle Emitter Type 'HollowEllipsoid' registered
15:14:18: Particle Affector Type 'LinearForce' registered
15:14:18: Particle Affector Type 'ColourFader' registered
15:14:18: Particle Affector Type 'ColourFader2' registered
15:14:18: Particle Affector Type 'ColourImage' registered
15:14:18: Particle Affector Type 'ColourInterpolator' registered
15:14:18: Particle Affector Type 'Scaler' registered
15:14:18: Particle Affector Type 'Rotator' registered
15:14:18: Particle Affector Type 'DirectionRandomiser' registered
15:14:18: Particle Affector Type 'DeflectorPlane' registered
15:14:18: Plugin successfully installed
15:14:18: Loading library .\Plugin_BSPSceneManager_d
15:14:18: Installing plugin: BSP Scene Manager
15:14:18: Plugin successfully installed
15:14:18: Loading library .\Plugin_OctreeSceneManager_d
15:14:18: Installing plugin: Octree & Terrain Scene Manager
15:14:18: Plugin successfully installed
15:14:18: Loading library .\Plugin_CgProgramManager_d
15:14:18: Installing plugin: Cg Program Manager
15:14:18: Plugin successfully installed
15:14:18: *-*-* OGRE Initialising
15:14:18: *-*-* Version 1.4.4 (Eihort)
15:14:18: Creating resource group Bootstrap
15:14:18: Added resource location '../../media/packs/OgreCore.zip' of type 'Zip' to resource group 'Bootstrap'
15:14:18: Added resource location '../../media' of type 'FileSystem' to resource group 'General'
15:14:18: Added resource location '../../media/trees' of type 'FileSystem' to resource group 'General'
15:14:18: Added resource location '../../media/grass' of type 'FileSystem' to resource group 'General'
15:14:18: Added resource location '../../media/fonts' of type 'FileSystem' to resource group 'General'
15:14:18: Added resource location '../../media/materials/programs' of type 'FileSystem' to resource group 'General'
15:14:18: Added resource location '../../media/materials/scripts' of type 'FileSystem' to resource group 'General'
15:14:18: Added resource location '../../media/materials/scripts/SkyManager' of type 'FileSystem' to resource group 'General'
15:14:18: Added resource location '../../media/materials/textures/SkyManager' of type 'FileSystem' to resource group 'General'
15:14:18: Added resource location '../../media/materials/textures' of type 'FileSystem' to resource group 'General'
15:14:18: Added resource location '../../media/models' of type 'FileSystem' to resource group 'General'
15:14:18: Added resource location '../../media/overlays' of type 'FileSystem' to resource group 'General'
15:14:18: Added resource location '../../media/particle' of type 'FileSystem' to resource group 'General'
15:14:18: Added resource location '../../media/gui' of type 'FileSystem' to resource group 'General'
15:14:18: Added resource location '../../media/DeferredShadingMedia' of type 'FileSystem' to resource group 'General'
15:14:18: Added resource location '../../media/packs/cubemap.zip' of type 'Zip' to resource group 'General'
15:14:18: Added resource location '../../media/packs/cubemapsJS.zip' of type 'Zip' to resource group 'General'
15:14:18: Added resource location '../../media/packs/dragon.zip' of type 'Zip' to resource group 'General'
15:14:18: Added resource location '../../media/packs/fresneldemo.zip' of type 'Zip' to resource group 'General'
15:14:18: Added resource location '../../media/packs/ogretestmap.zip' of type 'Zip' to resource group 'General'
15:14:18: Added resource location '../../media/packs/skybox.zip' of type 'Zip' to resource group 'General'
15:14:18: D3D9 : RenderSystem Option: Allow NVPerfHUD = No
15:14:18: D3D9 : RenderSystem Option: Anti aliasing = None
15:14:18: D3D9 : RenderSystem Option: Floating-point mode = Fastest
15:14:18: D3D9 : RenderSystem Option: Full Screen = No
15:14:18: D3D9 : RenderSystem Option: Rendering Device = ATI Radeon X1550 Series
15:14:18: D3D9 : RenderSystem Option: VSync = No
15:14:18: D3D9 : RenderSystem Option: Video Mode = 800 x 600 @ 32-bit colour
15:14:19: CPU Identifier & Features
15:14:19: -------------------------
15:14:19: * CPU ID: AuthenticAMD: AMD Athlon(tm) 64 X2 Dual Core Processor 3800+
15:14:19: * SSE: yes
15:14:19: * SSE2: yes
15:14:19: * SSE3: yes
15:14:19: * MMX: yes
15:14:19: * MMXEXT: yes
15:14:19: * 3DNOW: yes
15:14:19: * 3DNOWEXT: yes
15:14:19: * CMOV: yes
15:14:19: * TSC: yes
15:14:19: * FPU: yes
15:14:19: * PRO: yes
15:14:19: * HT: no
15:14:19: -------------------------
15:14:19: D3D9 : Subsystem Initialising
15:14:19: D3D9RenderSystem::createRenderWindow "OGRE Render Window", 800x600 windowed miscParams: FSAA=0 FSAAQuality=0 colourDepth=32 useNVPerfHUD=false vsync=false
15:14:19: D3D9 : Created D3D9 Rendering Window 'OGRE Render Window' : 800x600, 32bpp
15:14:19: D3D9 : WARNING - disabling VSync in windowed mode can cause timing issues at lower frame rates, turn VSync on if you observe this problem.
15:14:19: Registering ResourceManager for type Texture
15:14:19: Registering ResourceManager for type GpuProgram
15:14:19: RenderSystem capabilities
15:14:19: -------------------------
15:14:19: * Hardware generation of mipmaps: yes
15:14:19: * Texture blending: yes
15:14:19: * Anisotropic texture filtering: yes
15:14:19: * Dot product texture operation: yes
15:14:19: * Cube mapping: yes
15:14:19: * Hardware stencil buffer: yes
15:14:19: - Stencil depth: 8
15:14:19: - Two sided stencil support: yes
15:14:19: - Wrap stencil values: yes
15:14:19: * Hardware vertex / index buffers: yes
15:14:19: * Vertex programs: yes
15:14:19: - Max vertex program version: vs_3_0
15:14:19: * Fragment programs: yes
15:14:19: - Max fragment program version: ps_3_0
15:14:19: * Texture Compression: yes
15:14:19: - DXT: yes
15:14:19: - VTC: no
15:14:19: * Scissor Rectangle: yes
15:14:19: * Hardware Occlusion Query: yes
15:14:19: * User clip planes: yes
15:14:19: * VET_UBYTE4 vertex element type: yes
15:14:19: * Infinite far plane projection: yes
15:14:19: * Hardware render-to-texture: yes
15:14:19: * Floating point textures: yes
15:14:19: * Non-power-of-two textures: yes (limited)
15:14:19: * Volume textures: yes
15:14:19: * Multiple Render Targets: 4
15:14:19: * Point Sprites: yes
15:14:19: * Extended point parameters: yes
15:14:19: * Max Point Size: 256
15:14:19: * Vertex texture fetch: no
15:14:19: ***************************************
15:14:19: *** D3D9 : Subsystem Initialised OK ***
15:14:19: ***************************************
15:14:19: ResourceBackgroundQueue - threading disabled
15:14:19: Particle Renderer Type 'billboard' registered
15:14:19: SceneManagerFactory for type 'OctreeSceneManager' registered.
15:14:19: SceneManagerFactory for type 'TerrainSceneManager' registered.
15:14:19: SceneManagerFactory for type 'BspSceneManager' registered.
15:14:19: Registering ResourceManager for type BspLevel
15:14:19: TerrainSceneManager: Registered a new PageSource for type Heightmap
15:14:19: Creating viewport on target 'OGRE Render Window', rendering from camera 'PlayerCam', relative dimensions L: 0.00 T: 0.00 W: 1.00 H: 1.00 ZOrder: 0
15:14:19: Initialising resource group Bootstrap
15:14:19: Parsing scripts for resource group Bootstrap
15:14:19: Parsing script OgreCore.material
15:14:19: Parsing script OgreProfiler.material
15:14:19: Parsing script Ogre.fontdef
15:14:19: Parsing script OgreDebugPanel.overlay
15:14:19: Texture: New_Ogre_Border_Center.png: Loading 1 faces(PF_A8R8G8B8,256x128x1) with hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,256x128x1.
15:14:19: Texture: New_Ogre_Border.png: Loading 1 faces(PF_A8R8G8B8,256x256x1) with hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,256x256x1.
15:14:19: Texture: New_Ogre_Border_Break.png: Loading 1 faces(PF_A8R8G8B8,32x32x1) with hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,32x32x1.
15:14:19: Font BlueHighwayusing texture size 512x512
15:14:19: Info: Freetype returned null for character 127 in font BlueHighway
15:14:19: Info: Freetype returned null for character 128 in font BlueHighway
15:14:19: Info: Freetype returned null for character 129 in font BlueHighway
15:14:19: Info: Freetype returned null for character 130 in font BlueHighway
15:14:19: Info: Freetype returned null for character 131 in font BlueHighway
15:14:19: Info: Freetype returned null for character 132 in font BlueHighway
15:14:19: Info: Freetype returned null for character 133 in font BlueHighway
15:14:19: Info: Freetype returned null for character 134 in font BlueHighway
15:14:19: Info: Freetype returned null for character 135 in font BlueHighway
15:14:19: Info: Freetype returned null for character 136 in font BlueHighway
15:14:19: Info: Freetype returned null for character 137 in font BlueHighway
15:14:19: Info: Freetype returned null for character 138 in font BlueHighway
15:14:19: Info: Freetype returned null for character 139 in font BlueHighway
15:14:19: Info: Freetype returned null for character 140 in font BlueHighway
15:14:19: Info: Freetype returned null for character 141 in font BlueHighway
15:14:19: Info: Freetype returned null for character 142 in font BlueHighway
15:14:19: Info: Freetype returned null for character 143 in font BlueHighway
15:14:19: Info: Freetype returned null for character 144 in font BlueHighway
15:14:19: Info: Freetype returned null for character 145 in font BlueHighway
15:14:19: Info: Freetype returned null for character 146 in font BlueHighway
15:14:19: Info: Freetype returned null for character 147 in font BlueHighway
15:14:19: Info: Freetype returned null for character 148 in font BlueHighway
15:14:19: Info: Freetype returned null for character 149 in font BlueHighway
15:14:19: Info: Freetype returned null for character 150 in font BlueHighway
15:14:19: Info: Freetype returned null for character 151 in font BlueHighway
15:14:19: Info: Freetype returned null for character 152 in font BlueHighway
15:14:19: Info: Freetype returned null for character 153 in font BlueHighway
15:14:19: Info: Freetype returned null for character 154 in font BlueHighway
15:14:19: Info: Freetype returned null for character 155 in font BlueHighway
15:14:19: Info: Freetype returned null for character 156 in font BlueHighway
15:14:19: Info: Freetype returned null for character 157 in font BlueHighway
15:14:19: Info: Freetype returned null for character 158 in font BlueHighway
15:14:19: Info: Freetype returned null for character 159 in font BlueHighway
15:14:19: Info: Freetype returned null for character 160 in font BlueHighway
15:14:19: Texture: BlueHighwayTexture: Loading 1 faces(PF_BYTE_LA,512x512x1) with 0 generated mipmaps from Image. Internal format is PF_BYTE_LA,512x512x1.
15:14:19: Texture: ogretext.png: Loading 1 faces(PF_A8R8G8B8,256x128x1) with hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,256x128x1.
15:14:19: Parsing script OgreLoadingPanel.overlay
15:14:19: Finished parsing scripts for resource group Bootstrap
15:14:19: Parsing scripts for resource group Autodetect
15:14:19: Finished parsing scripts for resource group Autodetect
15:14:19: Parsing scripts for resource group General
15:14:19: Parsing script Examples.program
15:14:19: Parsing script StdQuad_vp.program
15:14:19: Parsing script deferred.glsl.program
15:14:19: Parsing script deferred.hlsl.program
15:14:19: Parsing script deferred_post_debug.glsl.program
15:14:19: Parsing script deferred_post_debug.hlsl.program
15:14:19: Parsing script deferred_post_minilight.glsl.program
15:14:19: Parsing script deferred_post_minilight.hlsl.program
15:14:19: Parsing script deferred_post_multipass.glsl.program
15:14:19: Parsing script deferred_post_multipass.hlsl.program
15:14:19: Parsing script deferred_post_onepass.glsl.program
15:14:19: Parsing script deferred_post_onepass.hlsl.program
15:14:19: Parsing script tree.material
15:14:19: Parsing script grass.material
15:14:19: Parsing script BlackAndWhite.material
15:14:19: Parsing script Bloom.material
15:14:20: Parsing script DepthShadowmap.material
15:14:20: Parsing script DOF.material
15:14:20: Parsing script Embossed.material
15:14:20: Parsing script Example-DynTex.material
15:14:20: Parsing script Example-Water.material
15:14:20: Parsing script Example.material
15:14:20: Parsing script Examples-Advanced.material
15:14:20: Parsing script facial.material
15:14:20: Parsing script Glass.material
15:14:20: Parsing script hdr.material
15:14:20: Parsing script HeatVision.material
15:14:21: Parsing script Hurt.material
15:14:21: Parsing script instancing.material
15:14:21: Parsing script Invert.material
15:14:21: Parsing script Laplace.material
15:14:21: Parsing script MotionBlur.material
15:14:21: Parsing script Ocean.material
15:14:21: Parsing script OffsetMapping.material
15:14:21: Parsing script Ogre.material
15:14:21: Parsing script OldMovie.material
15:14:21: Parsing script OldTV.material
15:14:21: Parsing script Posterize.material
15:14:21: Parsing script RZR-002.material
15:14:21: Parsing script SharpenEdges.material
15:14:21: Parsing script sky.material
15:14:21: OGRE EXCEPTION(3:RenderingAPIException): Cannot assemble D3D9 high-level shader skydomePS Errors:
error X3539: ps_1_x is no longer supported; use /Gec in fxc to automatically upgrade to ps_2_0
error X3539: Alternately, fxc's /LD option allows use of the old compiler DLL

in D3D9HLSLProgram::loadFromSource at d:\sdk\ogresdk\rendersystems\direct3d9\src\ogred3d9hlslprogram.cpp (line 124)
15:14:21: High-level program skydomePS encountered an error during loading and is thus not supported.
OGRE EXCEPTION(3:RenderingAPIException): Cannot assemble D3D9 high-level shader skydomePS Errors:
error X3539: ps_1_x is no longer supported; use /Gec in fxc to automatically upgrade to ps_2_0
error X3539: Alternately, fxc's /LD option allows use of the old compiler DLL

in D3D9HLSLProgram::loadFromSource at d:\sdk\ogresdk\rendersystems\direct3d9\src\ogred3d9hlslprogram.cpp (line 124)
15:14:21: Error in material SkydomeShaderBlend at line 34 of sky.material: Invalid param_named attribute - expected at least 3 parameters.
15:14:21: Parsing script smoke.material
15:14:21: Parsing script Tiling.material
15:14:21: Parsing script VarianceShadowmap.material
15:14:21: Parsing script deferred.material
15:14:21: Parsing script deferreddemo.material
15:14:21: Parsing script deferred_post_debug.material
15:14:21: Parsing script deferred_post_minilight.material
15:14:21: Parsing script deferred_post_multipass.material
15:14:21: Parsing script deferred_post_onepass.material
15:14:21: Parsing script RomanBath.material
15:14:21: Parsing script Examples.compositor
15:14:22: Parsing script sample.fontdef
15:14:22: Parsing script emitted_emitter.particle
15:14:22: Parsing script Example-Water.particle
15:14:22: Parsing script Example.particle
15:14:22: Parsing script smoke.particle
15:14:22: Parsing script sun.particle
15:14:22: Parsing script Compositor.overlay
15:14:22: Parsing script DP3.overlay
15:14:22: Parsing script Example-CubeMapping.overlay
15:14:22: Parsing script Example-DynTex.overlay
15:14:22: Parsing script Example-Water.overlay
15:14:22: Parsing script Shadows.overlay
15:14:22: Finished parsing scripts for resource group General
15:14:22: Parsing scripts for resource group Internal
15:14:22: Finished parsing scripts for resource group Internal
15:14:22: Loading resource group 'General' - Resources: 0 World Geometry: 1
15:14:22: Finished loading resource group General
15:14:22: *** Initializing Game Logger System ***
15:14:22: Texture: TaharezLook.tga: Loading 1 faces(PF_A8R8G8B8,256x256x1) with 0 generated mipmaps from Image. Internal format is PF_A8R8G8B8,256x256x1.
15:14:22: TerrainSceneManager: Activated PageSource Heightmap
15:14:22: Texture: terrain_texture.jpg: Loading 1 faces(PF_R8G8B8,512x512x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
15:14:22: Texture: terrain_detail.jpg: Loading 1 faces(PF_R8G8B8,256x256x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,256x256x1.
15:14:23: Mesh: Loading tree.mesh.
15:14:23: WARNING: tree.mesh is an older format ([MeshSerializer_v1.30]); you should upgrade it as soon as possible using the OgreMeshUpgrade tool.
15:14:23: D3D9 : ***** Dimensions altered by the render system
15:14:23: D3D9 : ***** Source image dimensions : 600x600
15:14:23: D3D9 : ***** Texture dimensions : 1024x1024
15:14:23: Texture: wood7.jpg: Loading 1 faces(PF_R8G8B8,600x600x1) with 4 generated mipmaps from Image. Internal format is PF_X8R8G8B8,1024x1024x1.
15:14:23: Texture: leaves.png: Loading 1 faces(PF_A8R8G8B8,64x64x1) with hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,64x64x1.
15:14:23: WARNING: material SkydomeShaderBlend has no supportable Techniques and will be blank. Explanation:
Pass 0: Fragment program skydomePS cannot be used - compile error.

15:14:23: OGRE EXCEPTION(2:InvalidParametersException): Named constants have not been initialised, perhaps a compile error. in GpuProgramParameters::_findNamedConstantDefinition at d:\sdk\ogresdk\ogremain\src\ogregpuprogram.cpp (line 873)
15:14:30: *** Shutting Down Game Logger System ***
15:14:30: Unregistering ResourceManager for type BspLevel
15:14:30: *-*-* OGRE Shutdown
15:14:30: Unregistering ResourceManager for type Compositor
15:14:30: Unregistering ResourceManager for type Font
15:14:30: Unregistering ResourceManager for type Skeleton
15:14:30: Unregistering ResourceManager for type Mesh
15:14:30: Unregistering ResourceManager for type HighLevelGpuProgram
15:14:30: Uninstalling plugin: Cg Program Manager
15:14:30: Plugin successfully uninstalled
15:14:30: Unloading library .\Plugin_CgProgramManager_d
15:14:30: Uninstalling plugin: Octree & Terrain Scene Manager
15:14:30: Plugin successfully uninstalled
15:14:30: Unloading library .\Plugin_OctreeSceneManager_d
15:14:30: Uninstalling plugin: BSP Scene Manager
15:14:30: Plugin successfully uninstalled
15:14:30: Unloading library .\Plugin_BSPSceneManager_d
15:14:30: Uninstalling plugin: ParticleFX
15:14:30: Plugin successfully uninstalled
15:14:30: Unloading library .\Plugin_ParticleFX_d
15:14:30: Uninstalling plugin: GL RenderSystem
15:14:30: *** Stopping Win32GL Subsystem ***
15:14:30: Plugin successfully uninstalled
15:14:30: Unloading library .\RenderSystem_GL_d
15:14:30: Uninstalling plugin: D3D9 RenderSystem
15:14:30: Render Target 'OGRE Render Window' Average FPS: 0 Best FPS: 0 Worst FPS: 999
15:14:30: D3D9 : Shutting down cleanly.
15:14:30: Unregistering ResourceManager for type Texture
15:14:30: Unregistering ResourceManager for type GpuProgram
15:14:30: D3D9 : Direct3D9 Rendering Subsystem destroyed.
15:14:30: Plugin successfully uninstalled
15:14:30: Unloading library .\RenderSystem_Direct3D9_d
15:14:30: Unregistering ResourceManager for type Material
Any Suggestion?

Posted: Sun Nov 04, 2007 9:53 pm
by B4Gaming
Wow really nice!
What is the license btw?
Is it free for commercial use?
Ofcourse i give credit :)

Posted: Mon Nov 05, 2007 12:45 pm
by MartinBean
sinbad wrote:And check the ogre.log for the compile error.

I accidentally updated the Dx SDK to April 2007 in 1.4.2 and the HLSL compiler has dropped support for SM1 shaders. Change them to Cg to resolve this which still supports SM1. It's just a case of changing the language code to cg and 'target' to 'profiles' (and you can add a GL profile in there if you like)
The solution is really simple:

In the sky.material file change line 5 'target ps_1_4' to 'target ps_2_0'. The shader runs fine in a 2.0 enviroment.

Also, make sure your far clipping value is large enough(like 7000 or so: _Camera->setFarClipDistance( 7000 ); ). I was wondering why I couldnt see anything... found out my far clipping was set to 100 :oops:

Re: Quick 'n Dirty SkyManager: day/night transitions + suns

Posted: Wed Dec 09, 2009 10:24 am
by EmCoMa
Hello everybody! I have a problem with the code of SkyManager. At runtime happens this exception:

Named constants have not been initialised, perhaps a compile error .in GpuProgramParameters::_findNamedConstantDefinition at f:\codingextra\ogre\shoggoth_vc9\ogre\ogramain\src\ogregpuprogram.cpp (line 1087)

What should I do to solve this problem?

Thanks in advance!!! :D

Re: Quick 'n Dirty SkyManager: day/night transitions + suns

Posted: Wed Dec 09, 2009 12:18 pm
by spacegaier
1. You should try SkyX which is a very good and feature-rich Sky-Plugin for Ogre. Search the forum for it.
2. Concerning your crash: Have a look at the Ogre.log. There is some problem with the shaders where a parameter is requested but not given / wrongly spelled or something similar.