Hydrax + Caelum = question

MCin22

02-01-2009 14:02:45

Hi there! This is my first post on this forum. Thanks to Xavi for awesome add-on to Ogre3d! Well, I yesterday started my first project in Ogre3d. Somehow I compiled Hydrax and Caelum on Code Blocks on MinGW and I wanted to make a base app (game :P) with these libraries. I've got Ogre 1.4.9. I've compiled successfully combined code, but when I'm running this, it doesn't want to start. I don't mind that my graphic card have got only Pixel Shader 1.4. I can check it on other computer (friend's computer). Later I want to fix bugs that are because of using both Hydrax and Caelum. But there is problem in code and I need to change this a bit. When I looked into Ogre log there is a line:

OGRE EXCEPTION(2:InvalidParametersException): Named constants have not been initialised, perhaps a compile error. in GpuProgramParameters::_findNamedConstantDefinition at K:\Ogre_SVN_149\OgreMain\src\OgreGpuProgram.cpp (line 873)

This is my log: 04:14:16: Creating resource group General
04:14:16: Creating resource group Internal
04:14:16: Creating resource group Autodetect
04:14:16: SceneManagerFactory for type 'DefaultSceneManager' registered.
04:14:16: Registering ResourceManager for type Material
04:14:16: Registering ResourceManager for type Mesh
04:14:16: Registering ResourceManager for type Skeleton
04:14:16: MovableObjectFactory for type 'ParticleSystem' registered.
04:14:16: OverlayElementFactory for type Panel registered.
04:14:16: OverlayElementFactory for type BorderPanel registered.
04:14:16: OverlayElementFactory for type TextArea registered.
04:14:16: Registering ResourceManager for type Font
04:14:16: ArchiveFactory for archive type FileSystem registered.
04:14:16: ArchiveFactory for archive type Zip registered.
04:14:16: FreeImage version: 3.9.3
04:14:16: This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for details
04:14:16: 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
04:14:16: DDS codec registering
04:14:16: Registering ResourceManager for type HighLevelGpuProgram
04:14:16: Registering ResourceManager for type Compositor
04:14:16: MovableObjectFactory for type 'Entity' registered.
04:14:16: MovableObjectFactory for type 'Light' registered.
04:14:16: MovableObjectFactory for type 'BillboardSet' registered.
04:14:16: MovableObjectFactory for type 'ManualObject' registered.
04:14:16: MovableObjectFactory for type 'BillboardChain' registered.
04:14:16: MovableObjectFactory for type 'RibbonTrail' registered.
04:14:16: Loading library .\RenderSystem_GL
04:14:16: Installing plugin: GL RenderSystem
04:14:16: OpenGL Rendering Subsystem created.
04:14:17: Plugin successfully installed
04:14:17: Loading library .\RenderSystem_Direct3D9
04:14:17: Installing plugin: D3D9 RenderSystem
04:14:17: D3D9 : Direct3D9 Rendering Subsystem created.
04:14:17: D3D9: Driver Detection Starts
04:14:17: D3D9: Driver Detection Ends
04:14:17: Plugin successfully installed
04:14:17: Loading library .\Plugin_CgProgramManager
04:14:17: Installing plugin: Cg Program Manager
04:14:17: Plugin successfully installed
04:14:17: Loading library .\Plugin_OctreeSceneManager
04:14:17: Installing plugin: Octree & Terrain Scene Manager
04:14:17: Plugin successfully installed
04:14:17: *-*-* OGRE Initialising
04:14:17: *-*-* Version 1.4.9 (Eihort)
04:14:17: Creating resource group Caelum
04:14:17: Added resource location '../../samples/resources/gui' of type 'FileSystem' to resource group 'Caelum'
04:14:17: Added resource location '../../samples/resources' of type 'FileSystem' to resource group 'Caelum'
04:14:17: Added resource location '../../resources' of type 'FileSystem' to resource group 'Caelum'
04:14:17: Creating resource group Core
04:14:18: Added resource location '../../samples/resources/OgreCore.zip' of type 'Zip' to resource group 'Core'
04:14:18: Creating resource group Hydrax
04:14:18: Added resource location '../../Media/Hydrax' of type 'FileSystem' to resource group 'Hydrax'
04:14:18: D3D9 : RenderSystem Option: Allow NVPerfHUD = Yes
04:14:18: D3D9 : RenderSystem Option: Anti aliasing = None
04:14:18: D3D9 : RenderSystem Option: Floating-point mode = Fastest
04:14:18: D3D9 : RenderSystem Option: Full Screen = No
04:14:18: D3D9 : RenderSystem Option: Rendering Device = RADEON 9200 SERIES
04:14:18: D3D9 : RenderSystem Option: VSync = No
04:14:18: D3D9 : RenderSystem Option: Video Mode = 1024 x 768 @ 32-bit colour
04:14:25: CPU Identifier & Features
04:14:25: -------------------------
04:14:25: * CPU ID: AuthenticAMD: AMD Athlon(tm) XP 2500+
04:14:25: * SSE: yes
04:14:25: * SSE2: no
04:14:25: * SSE3: no
04:14:25: * MMX: yes
04:14:25: * MMXEXT: yes
04:14:25: * 3DNOW: yes
04:14:25: * 3DNOWEXT: yes
04:14:25: * CMOV: yes
04:14:25: * TSC: yes
04:14:25: * FPU: yes
04:14:25: * PRO: yes
04:14:25: * HT: no
04:14:25: -------------------------
04:14:25: *** Starting Win32GL Subsystem ***
04:14:25: GLRenderSystem::createRenderWindow "OGRE Render Window", 1024x768 windowed miscParams: FSAA=0 colourDepth=32 displayFrequency=0 vsync=false
04:14:25: Created Win32Window 'OGRE Render Window' : 1024x768, 32bpp
04:14:25: GL_VERSION = 1.3.1072 WinXP Release
04:14:25: GL_VENDOR = ATI Technologies Inc.
04:14:25: GL_RENDERER = RADEON 9250/9200 Series DDR x86/MMX/3DNow!/SSE
04:14:25: GL_EXTENSIONS = GL_ARB_multitexture GL_EXT_texture_env_add GL_EXT_compiled_vertex_array GL_S3_s3tc GL_ARB_occlusion_query GL_ARB_point_parameters GL_ARB_texture_border_clamp GL_ARB_texture_compression GL_ARB_texture_cube_map GL_ARB_texture_env_add GL_ARB_texture_env_combine GL_ARB_texture_env_crossbar GL_ARB_texture_env_dot3 GL_ARB_texture_mirrored_repeat GL_ARB_transpose_matrix GL_ARB_vertex_blend GL_ARB_vertex_buffer_object GL_ARB_vertex_program GL_ARB_window_pos GL_ATI_element_array GL_ATI_envmap_bumpmap GL_ATI_fragment_shader GL_ATI_map_object_buffer GL_ATI_texture_env_combine3 GL_ATI_texture_mirror_once GL_ATI_vertex_array_object GL_ATI_vertex_attrib_array_object GL_ATI_vertex_streams GL_ATIX_texture_env_combine3 GL_ATIX_texture_env_route GL_ATIX_vertex_shader_output_point_size GL_EXT_abgr GL_EXT_bgra GL_EXT_blend_color GL_EXT_blend_func_separate GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_clip_volume_hint GL_EXT_draw_range_elements GL_EXT_fog_coord GL_EXT_multi_draw_arrays GL_EXT_packed_pixels GL_EXT_point_parameters GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_separate_specular_color GL_EXT_stencil_wrap GL_EXT_texgen_reflection GL_EXT_texture3D GL_EXT_texture_compression_s3tc GL_EXT_texture_cube_map GL_EXT_texture_edge_clamp GL_EXT_texture_env_combine GL_EXT_texture_env_dot3 GL_EXT_texture_filter_anisotropic GL_EXT_texture_lod_bias GL_EXT_texture_mirror_clamp GL_EXT_texture_object GL_EXT_texture_rectangle GL_EXT_vertex_array GL_EXT_vertex_shader GL_HP_occlusion_test GL_NV_blend_square GL_NV_occlusion_query GL_NV_texgen_reflection GL_SGI_color_matrix GL_SGIS_generate_mipmap GL_SGIS_multitexture GL_SGIS_texture_border_clamp GL_SGIS_texture_edge_clamp GL_SGIS_texture_lod GL_SUN_multi_draw_arrays GL_WIN_swap_hint WGL_EXT_extensions_string WGL_EXT_swap_control
04:14:25: Supported WGL extensions: WGL_ARB_extensions_string WGL_ARB_make_current_read WGL_ARB_pbuffer WGL_ARB_pixel_format WGL_ARB_render_texture WGL_EXT_extensions_string WGL_EXT_swap_control
04:14:25: ***************************
04:14:25: *** GL Renderer Started ***
04:14:25: ***************************
04:14:25: Registering ResourceManager for type GpuProgram
04:14:25: GL: Using PBuffers for rendering to textures
04:14:25: RenderSystem capabilities
04:14:25: -------------------------
04:14:25: * Hardware generation of mipmaps: yes
04:14:25: * Texture blending: yes
04:14:25: * Anisotropic texture filtering: yes
04:14:25: * Dot product texture operation: yes
04:14:25: * Cube mapping: yes
04:14:25: * Hardware stencil buffer: yes
04:14:25: - Stencil depth: 8
04:14:25: - Two sided stencil support: no
04:14:25: - Wrap stencil values: yes
04:14:25: * Hardware vertex / index buffers: yes
04:14:25: * Vertex programs: yes
04:14:25: - Max vertex program version: arbvp1
04:14:25: * Fragment programs: yes
04:14:25: - Max fragment program version: ps_1_4
04:14:25: * Texture Compression: yes
04:14:25: - DXT: yes
04:14:25: - VTC: no
04:14:25: * Scissor Rectangle: yes
04:14:25: * Hardware Occlusion Query: yes
04:14:25: * User clip planes: yes
04:14:25: * VET_UBYTE4 vertex element type: yes
04:14:25: * Infinite far plane projection: yes
04:14:25: * Hardware render-to-texture: yes
04:14:25: * Floating point textures: no
04:14:25: * Non-power-of-two textures: no
04:14:25: * Volume textures: yes
04:14:25: * Multiple Render Targets: 1
04:14:25: * Point Sprites: no
04:14:25: * Extended point parameters: yes
04:14:25: * Max Point Size: 2047
04:14:25: * Vertex texture fetch: yes
04:14:25: - Max vertex textures: 6888
04:14:25: - Vertex textures shared: yes
04:14:25: Registering ResourceManager for type Texture
04:14:25: ResourceBackgroundQueue - threading disabled
04:14:25: Particle Renderer Type 'billboard' registered
04:14:25: SceneManagerFactory for type 'OctreeSceneManager' registered.
04:14:25: SceneManagerFactory for type 'TerrainSceneManager' registered.
04:14:25: TerrainSceneManager: Registered a new PageSource for type Heightmap
04:14:25: 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
04:14:25: Parsing scripts for resource group Autodetect
04:14:25: Finished parsing scripts for resource group Autodetect
04:14:25: Parsing scripts for resource group Caelum
04:14:25: Parsing script GroundFog.program
04:14:25: OGRE EXCEPTION(2:InvalidParametersException): Parameter called worldViewProj does not exist. in GpuProgramParameters::_findNamedConstantDefinition at K:\Ogre_SVN_149\OgreMain\src\OgreGpuProgram.cpp (line 883)
04:14:25: Error at line 33 of GroundFog.program: Invalid param_named_auto attribute - Parameter called worldViewProj does not exist.
04:14:25: OGRE EXCEPTION(2:InvalidParametersException): Parameter called worldViewProj does not exist. in GpuProgramParameters::_findNamedConstantDefinition at K:\Ogre_SVN_149\OgreMain\src\OgreGpuProgram.cpp (line 883)
04:14:25: Error at line 65 of GroundFog.program: Invalid param_named_auto attribute - Parameter called worldViewProj does not exist.
04:14:25: Parsing script Haze.program
04:14:25: OGRE EXCEPTION(2:InvalidParametersException): Parameter called worldViewProj does not exist. in GpuProgramParameters::_findNamedConstantDefinition at K:\Ogre_SVN_149\OgreMain\src\OgreGpuProgram.cpp (line 883)
04:14:25: Error at line 33 of Haze.program: Invalid param_named_auto attribute - Parameter called worldViewProj does not exist.
04:14:25: Parsing script MinimalCompositorVP.program
04:14:25: Parsing script CaelumSample.material
04:14:25: OGRE EXCEPTION(2:InvalidParametersException): Parameter called worldviewproj_matrix does not exist. in GpuProgramParameters::_findNamedConstantDefinition at K:\Ogre_SVN_149\OgreMain\src\OgreGpuProgram.cpp (line 883)
04:14:25: Error at line 77 of CaelumSample.material: Invalid param_named_auto attribute - Parameter called worldviewproj_matrix does not exist.
04:14:25: Error at line 168 of CaelumSample.material: Invalid param_named_auto attribute - texture_worldviewproj_matrix
04:14:25: Error at line 168 of CaelumSample.material: Invalid param_named_auto attribute - texture_worldviewproj_matrix
04:14:25: Error at line 168 of CaelumSample.material: Invalid param_named_auto attribute - texture_worldviewproj_matrix
04:14:25: Error in material CaelumSample/Base at line 240 of CaelumSample.material: Unrecognised command: illumination_stage
04:14:25: Error in material CaelumSample/Base at line 261 of CaelumSample.material: Unrecognised command: illumination_stage
04:14:25: Parsing script DepthComposer.material
04:14:25: Parsing script GroundFog.material
04:14:25: Parsing script LayeredClouds.material
04:14:25: OGRE EXCEPTION(2:InvalidParametersException): Parameter called worldViewProj does not exist. in GpuProgramParameters::_findNamedConstantDefinition at K:\Ogre_SVN_149\OgreMain\src\OgreGpuProgram.cpp (line 883)
04:14:25: Error at line 34 of LayeredClouds.material: Invalid param_named_auto attribute - Parameter called worldViewProj does not exist.
04:14:25: Parsing script moon.material
04:14:25: Parsing script PointStarfield.material
04:14:26: Parsing script Precipitation.material
04:14:26: Parsing script SkyDome.material
04:14:26: OGRE EXCEPTION(2:InvalidParametersException): Parameter called worldViewProj does not exist. in GpuProgramParameters::_findNamedConstantDefinition at K:\Ogre_SVN_149\OgreMain\src\OgreGpuProgram.cpp (line 883)
04:14:26: Error at line 61 of SkyDome.material: Invalid param_named_auto attribute - Parameter called worldViewProj does not exist.
04:14:26: Parsing script Starfield.material
04:14:26: Parsing script Sun.material
04:14:26: Parsing script DepthComposer.compositor
04:14:26: Parsing script Precipitation.compositor
04:14:26: Finished parsing scripts for resource group Caelum
04:14:26: Parsing scripts for resource group Core
04:14:26: Parsing script OgreCore.material
04:14:26: Parsing script OgreProfiler.material
04:14:26: Parsing script Ogre.fontdef
04:14:26: Parsing script OgreDebugPanel.overlay
04:14:26: Texture: New_Ogre_Border_Center.png: Loading 1 faces(PF_A8R8G8B8,256x128x1) with 5 hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,256x128x1.
04:14:26: Texture: New_Ogre_Border.png: Loading 1 faces(PF_A8R8G8B8,256x256x1) with 5 hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,256x256x1.
04:14:26: Texture: New_Ogre_Border_Break.png: Loading 1 faces(PF_A8R8G8B8,32x32x1) with 5 hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,32x32x1.
04:14:26: Font BlueHighwayusing texture size 512x512
04:14:26: Info: Freetype returned null for character 127 in font BlueHighway
04:14:26: Info: Freetype returned null for character 128 in font BlueHighway
04:14:26: Info: Freetype returned null for character 129 in font BlueHighway
04:14:26: Info: Freetype returned null for character 130 in font BlueHighway
04:14:26: Info: Freetype returned null for character 131 in font BlueHighway
04:14:26: Info: Freetype returned null for character 132 in font BlueHighway
04:14:26: Info: Freetype returned null for character 133 in font BlueHighway
04:14:26: Info: Freetype returned null for character 134 in font BlueHighway
04:14:26: Info: Freetype returned null for character 135 in font BlueHighway
04:14:26: Info: Freetype returned null for character 136 in font BlueHighway
04:14:26: Info: Freetype returned null for character 137 in font BlueHighway
04:14:26: Info: Freetype returned null for character 138 in font BlueHighway
04:14:26: Info: Freetype returned null for character 139 in font BlueHighway
04:14:26: Info: Freetype returned null for character 140 in font BlueHighway
04:14:26: Info: Freetype returned null for character 141 in font BlueHighway
04:14:26: Info: Freetype returned null for character 142 in font BlueHighway
04:14:26: Info: Freetype returned null for character 143 in font BlueHighway
04:14:26: Info: Freetype returned null for character 144 in font BlueHighway
04:14:26: Info: Freetype returned null for character 145 in font BlueHighway
04:14:26: Info: Freetype returned null for character 146 in font BlueHighway
04:14:26: Info: Freetype returned null for character 147 in font BlueHighway
04:14:26: Info: Freetype returned null for character 148 in font BlueHighway
04:14:26: Info: Freetype returned null for character 149 in font BlueHighway
04:14:26: Info: Freetype returned null for character 150 in font BlueHighway
04:14:26: Info: Freetype returned null for character 151 in font BlueHighway
04:14:26: Info: Freetype returned null for character 152 in font BlueHighway
04:14:26: Info: Freetype returned null for character 153 in font BlueHighway
04:14:26: Info: Freetype returned null for character 154 in font BlueHighway
04:14:26: Info: Freetype returned null for character 155 in font BlueHighway
04:14:26: Info: Freetype returned null for character 156 in font BlueHighway
04:14:26: Info: Freetype returned null for character 157 in font BlueHighway
04:14:26: Info: Freetype returned null for character 158 in font BlueHighway
04:14:26: Info: Freetype returned null for character 159 in font BlueHighway
04:14:26: Info: Freetype returned null for character 160 in font BlueHighway
04:14:26: Texture: BlueHighwayTexture: Loading 1 faces(PF_BYTE_LA,512x512x1) with hardware generated mipmaps from Image. Internal format is PF_BYTE_LA,512x512x1.
04:14:26: Texture: ogretext.png: Loading 1 faces(PF_A8R8G8B8,256x128x1) with 5 hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,256x128x1.
04:14:26: Parsing script OgreLoadingPanel.overlay
04:14:26: Finished parsing scripts for resource group Core
04:14:26: Parsing scripts for resource group General
04:14:26: Finished parsing scripts for resource group General
04:14:26: Parsing scripts for resource group Hydrax
04:14:26: Finished parsing scripts for resource group Hydrax
04:14:26: Parsing scripts for resource group Internal
04:14:26: Finished parsing scripts for resource group Internal
04:14:26: [Hydrax] Hydrax created.
04:14:26: [Hydrax] HydraxDemo.hdx loaded.
04:14:26: [Hydrax] Creating module...
04:14:26: [Hydrax] Creating ProjectedGridVertex module.
04:14:26: [Hydrax] ProjectedGridVertex created.
04:14:26: [Hydrax] Module created.
04:14:26: [Hydrax] Initializating RTT Manager...
04:14:26: Win32PBuffer::Creating PBuffer of format bits=8 float=false
04:14:26: Win32PBuffer::PBuffer -- Chosen pixel format rgba=8,8,8,8 depth=24 stencil=8
04:14:26: Win32RenderTexture::PBuffer created -- Real dimensions 1024x1024
04:14:26: Creating viewport on target 'rtt/HydraxReflectionMap/11296536', rendering from camera 'PlayerCam', relative dimensions L: 0.00 T: 0.00 W: 1.00 H: 1.00 ZOrder: 0
04:14:26: Creating viewport on target 'rtt/HydraxRefractionMap/11554576', rendering from camera 'PlayerCam', relative dimensions L: 0.00 T: 0.00 W: 1.00 H: 1.00 ZOrder: 0
04:14:26: Creating viewport on target 'rtt/HydraxDepthMap/11280408', rendering from camera 'PlayerCam', relative dimensions L: 0.00 T: 0.00 W: 1.00 H: 1.00 ZOrder: 0
04:14:26: [Hydrax] RTT manager initialized.
04:14:26: [Hydrax] Registring device restored listener...
04:14:26: [Hydrax] Device restored listener registred.
04:14:26: [Hydrax] Creating materials...
04:14:26: [Hydrax] Creating water material...
04:14:26: OGRE EXCEPTION(2:InvalidParametersException): Named constants have not been initialised, perhaps a compile error. in GpuProgramParameters::_findNamedConstantDefinition at K:\Ogre_SVN_149\OgreMain\src\OgreGpuProgram.cpp (line 873)
04:14:26: *-*-* OGRE Shutdown
04:14:26: Unregistering ResourceManager for type Compositor
04:14:26: Unregistering ResourceManager for type Font
04:14:26: Unregistering ResourceManager for type Skeleton
04:14:26: Unregistering ResourceManager for type Mesh
04:14:26: Unregistering ResourceManager for type HighLevelGpuProgram
04:14:26: Uninstalling plugin: Octree & Terrain Scene Manager
04:14:26: Plugin successfully uninstalled
04:14:26: Unloading library .\Plugin_OctreeSceneManager
04:14:26: Uninstalling plugin: Cg Program Manager
04:14:26: Plugin successfully uninstalled
04:14:26: Unloading library .\Plugin_CgProgramManager
04:14:26: Uninstalling plugin: D3D9 RenderSystem
04:14:26: D3D9 : Shutting down cleanly.
04:14:26: D3D9 : Direct3D9 Rendering Subsystem destroyed.
04:14:26: Plugin successfully uninstalled
04:14:26: Unloading library .\RenderSystem_Direct3D9
04:14:26: Uninstalling plugin: GL RenderSystem
04:14:26: Render Target 'rtt/HydraxDepthMap/11280408' Average FPS: 0 Best FPS: 0 Worst FPS: 999
04:14:26: Render Target 'rtt/HydraxReflectionMap/11296536' Average FPS: 0 Best FPS: 0 Worst FPS: 999
04:14:26: Render Target 'rtt/HydraxRefractionMap/11554576' Average FPS: 0 Best FPS: 0 Worst FPS: 999
04:14:26: Render Target 'OGRE Render Window' Average FPS: 0 Best FPS: 0 Worst FPS: 999
04:14:26: Unregistering ResourceManager for type GpuProgram
04:14:26: *** Stopping Win32GL Subsystem ***
04:14:26: Unregistering ResourceManager for type Texture
04:14:26: Plugin successfully uninstalled
04:14:26: Unloading library .\RenderSystem_GL
04:14:26: Unregistering ResourceManager for type Material


And here is my app's code (almost without comments):
#include <Ogre.h>
#include <ExampleApplication.h>
#include "Hydrax.h"
#include "Noise/Perlin/Perlin.h"
#include "Modules/ProjectedGrid/ProjectedGrid.h"
#include "Caelum.h"

Hydrax::Hydrax *mHydrax = 0;

class CaelumSampleFrameListener : public ExampleFrameListener
{
protected:
Caelum::CaelumSystem *mCaelumSystem;
Ogre::SceneManager *mScene;
float mSpeedFactor;
bool mPaused;
float mTimeTillNextUpdate;

public:
CaelumSampleFrameListener(RenderWindow* win, Camera* cam): ExampleFrameListener(win, cam)
{
mScene = cam->getSceneManager();
mPaused = false;

Caelum::CaelumSystem::CaelumComponent componentMask;
componentMask = static_cast<Caelum::CaelumSystem::CaelumComponent> (
Caelum::CaelumSystem::CAELUM_COMPONENT_SUN |
Caelum::CaelumSystem::CAELUM_COMPONENT_MOON |
Caelum::CaelumSystem::CAELUM_COMPONENT_SKY_DOME |
//Caelum::CaelumSystem::CAELUM_COMPONENT_IMAGE_STARFIELD |
Caelum::CaelumSystem::CAELUM_COMPONENT_POINT_STARFIELD |
Caelum::CaelumSystem::CAELUM_COMPONENT_CLOUDS |
0);
// componentMask = CaelumSystem::CAELUM_COMPONENTS_DEFAULT;

mCaelumSystem = new Caelum::CaelumSystem (Root::getSingletonPtr(), mScene, componentMask);

mCaelumSystem->getUniversalClock ()->setTimeScale (512);

mWindow->addListener (mCaelumSystem);
Root::getSingletonPtr()->addFrameListener (mCaelumSystem);

UpdateSpeedFactor(mCaelumSystem->getUniversalClock ()->getTimeScale ());
mTimeTillNextUpdate = 0;
}

~CaelumSampleFrameListener() {
if (mCaelumSystem) {
mCaelumSystem->shutdown (false);
mCaelumSystem = 0;
}
}

void UpdateSpeedFactor(double factor)
{
mSpeedFactor = factor;
mCaelumSystem->getUniversalClock ()->setTimeScale (mPaused ? 0 : mSpeedFactor);
}

bool frameEnded(const FrameEvent& evt)
{
if (!ExampleFrameListener::frameEnded(evt)) {
return false;
}

return true;
}
};

class EndwayListener : public ExampleFrameListener
{
public:
SceneManager *mSceneMgr;
Real mKeyBuffer;

EndwayListener(RenderWindow* win, Camera* cam, SceneManager *sm)
: ExampleFrameListener(win,cam)
, mSceneMgr(sm)
, mKeyBuffer(-1)
{
}

bool frameStarted(const FrameEvent &e)
{

Ogre::RaySceneQuery *raySceneQuery =
mSceneMgr->
createRayQuery(Ogre::Ray(mCamera->getPosition() + Ogre::Vector3(0,1000000,0),
Vector3::NEGATIVE_UNIT_Y));
Ogre::RaySceneQueryResult& qryResult = raySceneQuery->execute();
Ogre::RaySceneQueryResult::iterator i = qryResult.begin();
if (i != qryResult.end() && i->worldFragment)
{
if (mCamera->getPosition().y < i->worldFragment->singleIntersection.y + 30)
{
mCamera->
setPosition(mCamera->getPosition().x,
i->worldFragment->singleIntersection.y + 30,
mCamera->getPosition().z);
}
}

delete raySceneQuery;

mHydrax->update(e.timeSinceLastFrame);

return true;
}
};

class SampleApp : public ExampleApplication
{
public:

SampleApp()
{}

void createFrameListener ()
{
mFrameListener = new CaelumSampleFrameListener (mWindow, mCamera);
mRoot->addFrameListener (mFrameListener);
}

protected:
void chooseSceneManager()
{
mSceneMgr = mRoot->createSceneManager("TerrainSceneManager");
}

void createScene(void)
{
mSceneMgr->setAmbientLight(ColourValue(1, 1, 1));

mCamera->setNearClipDistance(5);
mCamera->setFarClipDistance(99999*6);
mCamera->setPosition(312.902,206.419,1524.02);
mCamera->setOrientation(Ogre::Quaternion(0.998, -0.0121, -0.0608, -0.00074));

Ogre::Light *mLight = mSceneMgr->createLight("Light0");
mLight->setDiffuseColour(1, 1, 1);

mHydrax = new Hydrax::Hydrax(mSceneMgr, mCamera, mWindow->getViewport(0));
Hydrax::Module::ProjectedGrid *mModule
= new Hydrax::Module::ProjectedGrid(
mHydrax,
new Hydrax::Noise::Perlin(/*Generic one*/),
Ogre::Plane(Ogre::Vector3(0,1,0), Ogre::Vector3(0,0,0)),
Hydrax::MaterialManager::NM_VERTEX,
Hydrax::Module::ProjectedGrid::Options(264));

mHydrax->setModule(static_cast<Hydrax::Module::Module*>(mModule));
mHydrax->loadCfg("HydraxDemo.hdx");

mHydrax->create();

mSceneMgr->setWorldGeometry("Island.cfg");

mHydrax->getMaterialManager()->addDepthTechnique(
static_cast<Ogre::MaterialPtr>(Ogre::MaterialManager::getSingleton().getByName("Island"))
->createTechnique());

mRoot->addFrameListener(new EndwayListener(mWindow, mCamera, mSceneMgr));
}
};

int main(int argc, char **argv)
{

SampleApp app;

try
{
app.go();
}
catch ( Ogre::Exception& e )
{
std::cerr << "An exception has occured: " << e.getFullDescription();
}

return 0;
}


I hope that anyone can help me solve this problem ;). I'm quite a newbie in Ogre3d world :P. Tnx for any reply! I'l be very grateful for any code ;).

I forgot, sorry for my bad English, I'm from Poland ;).

Xavyiy

02-01-2009 16:34:54

First of all, your graphic card doesn't support S.M. 2.0 that is required to run Hydrax(And I suppose that Caelum too).
For second, I think you must use DX render system and when all work as expected, switch to OpenGL if needed(Hydrax uses CG under OpenGL and only latest versions(of GC) have solved some bugs that fixes some artifacts).
This log means that there are a gpu program that is not compiled, but it's normal due to for example, Hydrax, that uses SM 2.0.

Xavi.

MCin22

02-01-2009 16:49:39

Well, I was wondering, because when I compiled and ran only Hydrax demo it shown in log that something isn't supported (material if I remember correctly). But there is:

05:55:15: OGRE EXCEPTION(2:InvalidParametersException): Named constants have not been initialised, perhaps a compile error. in GpuProgramParameters::_findNamedConstantDefinition at K:\Ogre_SVN_149\OgreMain\src\OgreGpuProgram.cpp (line 873)

That's why I wrote my problem ;). Caleum is working but without clouds and stars (with moon).

If I remember, Caleum needs S.M. 2.0 or 3.0 for clouds, moon and few other things.

So I should simply check my program on another computer with better graphic card?

EDIT:

I checked Nature demo and there is same error in log. Thank you for your reply!

Fish

04-01-2009 03:27:14

For second, I think you must use DX render system and when all work as expected, switch to OpenGL if needed(Hydrax uses CG under OpenGL and only latest versions(of GC) have solved some bugs that fixes some artifacts).

So Hydrax is now working with OpenGL but we need to use the latest NVidia Cg headers and libs, yes?


edit: I suppose I could just give it a try. :)

f117f117f117677

06-03-2009 08:08:51

what's the Nature demo ? is Caelum's demo?

MCin22

06-03-2009 20:36:05

what's the Nature demo ? is Caelum's demo?

I think this topic isn't about Nature or Caelum Demo :D .

Nature Demo is a project made by lilljohan. It's combined Hydrax, Caeum, Paged Geometry and ETM into one nice project. Here is the link to original topic:

http://www.ogre3d.org/forums/viewtopic. ... 8&start=50