[Solved] Tearing at edges of screen. HydraX 0.5.4 Ogre 1.8.1

Subcutaneous

19-04-2013 02:12:55

Hi,

I've been trying to figure this out for a couple days now and I'm hitting a wall so I thought I'd see if anyone here can help.

Here's a picture of what happens when I move the camera. If I leave the camera stationary then everything looks (somewhat) normal. I think the shaders might be a little off but the water moves correctly and reflects the sky. If I turn the camera to either side the water kind of "tears" like this while I'm turning. Then returns to normal when I'm done.



Here's where things start going wrong in my ogre log.

19:49:44: Parsing script DualQuaternion.program
19:49:44: OGRE EXCEPTION(7:InternalErrorException): Unable to compile Cg program Ogre/DualQuaternionHardwareSkinningTwoWeightsTwoPhaseCg: The compile returned an error.
DualQuaternion_Common.cg(167) : warning C7019: "blendWgt" is too large for semantic "BLENDWEIGHT", which is size 1
(0) : error C6007: Constant register limit exceeded; more than 96 constant registers needed to compiled program
(0) : error C6007: Constant register limit exceeded; more than 96 constant registers needed to compiled program
(0) : error C6007: Constant register limit exceeded; more than 96 constant registers needed to compiled program
in CgProgram::compileMicrocode at ..\..\..\..\..\PlugIns\CgProgramManager\src\OgreCgProgramManagerDll.cpp (line 67)
19:49:44: High-level program Ogre/DualQuaternionHardwareSkinningTwoWeightsTwoPhaseCg encountered an error during loading and is thus not supported.
OGRE EXCEPTION(7:InternalErrorException): Unable to compile Cg program Ogre/DualQuaternionHardwareSkinningTwoWeightsTwoPhaseCg: The compile returned an error.
DualQuaternion_Common.cg(167) : warning C7019: "blendWgt" is too large for semantic "BLENDWEIGHT", which is size 1
(0) : error C6007: Constant register limit exceeded; more than 96 constant registers needed to compiled program
(0) : error C6007: Constant register limit exceeded; more than 96 constant registers needed to compiled program
(0) : error C6007: Constant register limit exceeded; more than 96 constant registers needed to compiled program
in CgProgram::compileMicrocode at ..\..\..\..\..\PlugIns\CgProgramManager\src\OgreCgProgramManagerDll.cpp (line 67)
19:49:44: OGRE EXCEPTION(2:InvalidParametersException): Named constants have not been initialised, perhaps a compile error. in GpuProgramParameters::_findNamedConstantDefinition at ..\..\..\..\OgreMain\src\OgreGpuProgramParams.cpp (line 1441)
19:49:44: Compiler error: invalid parameters in DualQuaternion.program(28): setting of constant failed
19:49:44: Parsing script Examples.program

.................

19:49:45: Problem parsing the following Cg Uniform: '@TMP29' in file Ogre/IsoSurf/TessellateTetrahedraGS_CG
19:49:45: Parsing script Laplace.material

...............

19:49:46: Parsing script DualQuaternionSkinning_Shadow.material
19:49:46: OGRE EXCEPTION(7:InternalErrorException): Unable to compile Cg program Ogre/RTShader/shadow_caster_dq_skinning_1weight_twophase_vs_cg: The compile returned an error.
<invalid atom 65535>(227) : warning C7019: "blendWgt" is too large for semantic "BLENDWEIGHT", which is size 1
(0) : error C6007: Constant register limit exceeded; more than 96 constant registers needed to compiled program
(0) : error C6007: Constant register limit exceeded; more than 96 constant registers needed to compiled program
(0) : error C6007: Constant register limit exceeded; more than 96 constant registers needed to compiled program
in CgProgram::compileMicrocode at ..\..\..\..\..\PlugIns\CgProgramManager\src\OgreCgProgramManagerDll.cpp (line 67)
19:49:46: High-level program Ogre/RTShader/shadow_caster_dq_skinning_1weight_twophase_vs_cg encountered an error during loading and is thus not supported.
OGRE EXCEPTION(7:InternalErrorException): Unable to compile Cg program Ogre/RTShader/shadow_caster_dq_skinning_1weight_twophase_vs_cg: The compile returned an error.
<invalid atom 65535>(227) : warning C7019: "blendWgt" is too large for semantic "BLENDWEIGHT", which is size 1
(0) : error C6007: Constant register limit exceeded; more than 96 constant registers needed to compiled program
(0) : error C6007: Constant register limit exceeded; more than 96 constant registers needed to compiled program
(0) : error C6007: Constant register limit exceeded; more than 96 constant registers needed to compiled program
in CgProgram::compileMicrocode at ..\..\..\..\..\PlugIns\CgProgramManager\src\OgreCgProgramManagerDll.cpp (line 67)
19:49:46: OGRE EXCEPTION(2:InvalidParametersException): Named constants have not been initialised, perhaps a compile error. in GpuProgramParameters::_findNamedConstantDefinition at ..\..\..\..\OgreMain\src\OgreGpuProgramParams.cpp (line 1441)
19:49:46: Compiler error: invalid parameters in DualQuaternionSkinning_Shadow.material(208): setting of constant failed
19:49:46: OGRE EXCEPTION(2:InvalidParametersException): Named constants have not been initialised, perhaps a compile error. in GpuProgramParameters::_findNamedConstantDefinition at ..\..\..\..\OgreMain\src\OgreGpuProgramParams.cpp (line 1441)
19:49:46: Compiler error: invalid parameters in DualQuaternionSkinning_Shadow.material(209): setting of constant failed
19:49:46: OGRE EXCEPTION(2:InvalidParametersException): Named constants have not been initialised, perhaps a compile error. in GpuProgramParameters::_findNamedConstantDefinition at ..\..\..\..\OgreMain\src\OgreGpuProgramParams.cpp (line 1441)
19:49:46: Compiler error: invalid parameters in DualQuaternionSkinning_Shadow.material(210): setting of constant failed
19:49:46: OGRE EXCEPTION(2:InvalidParametersException): Named constants have not been initialised, perhaps a compile error. in GpuProgramParameters::_findNamedConstantDefinition at ..\..\..\..\OgreMain\src\OgreGpuProgramParams.cpp (line 1441)
19:49:46: Compiler error: invalid parameters in DualQuaternionSkinning_Shadow.material(211): setting of constant failed
19:49:46: OGRE EXCEPTION(7:InternalErrorException): Unable to compile Cg program Ogre/RTShader/shadow_caster_dq_skinning_2weight_twophase_vs_cg: The compile returned an error.
<invalid atom 65535>(261) : warning C7019: "blendWgt" is too large for semantic "BLENDWEIGHT", which is size 1
(0) : error C6007: Constant register limit exceeded; more than 96 constant registers needed to compiled program
(0) : error C6007: Constant register limit exceeded; more than 96 constant registers needed to compiled program
(0) : error C6007: Constant register limit exceeded; more than 96 constant registers needed to compiled program
in CgProgram::compileMicrocode at ..\..\..\..\..\PlugIns\CgProgramManager\src\OgreCgProgramManagerDll.cpp (line 67)
19:49:46: High-level program Ogre/RTShader/shadow_caster_dq_skinning_2weight_twophase_vs_cg encountered an error during loading and is thus not supported.
OGRE EXCEPTION(7:InternalErrorException): Unable to compile Cg program Ogre/RTShader/shadow_caster_dq_skinning_2weight_twophase_vs_cg: The compile returned an error.
<invalid atom 65535>(261) : warning C7019: "blendWgt" is too large for semantic "BLENDWEIGHT", which is size 1
(0) : error C6007: Constant register limit exceeded; more than 96 constant registers needed to compiled program
(0) : error C6007: Constant register limit exceeded; more than 96 constant registers needed to compiled program
(0) : error C6007: Constant register limit exceeded; more than 96 constant registers needed to compiled program
in CgProgram::compileMicrocode at ..\..\..\..\..\PlugIns\CgProgramManager\src\OgreCgProgramManagerDll.cpp (line 67)
19:49:46: OGRE EXCEPTION(2:InvalidParametersException): Named constants have not been initialised, perhaps a compile error. in GpuProgramParameters::_findNamedConstantDefinition at ..\..\..\..\OgreMain\src\OgreGpuProgramParams.cpp (line 1441)
19:49:46: Compiler error: invalid parameters in DualQuaternionSkinning_Shadow.material(225): setting of constant failed
19:49:46: OGRE EXCEPTION(2:InvalidParametersException): Named constants have not been initialised, perhaps a compile error. in GpuProgramParameters::_findNamedConstantDefinition at ..\..\..\..\OgreMain\src\OgreGpuProgramParams.cpp (line 1441)
19:49:46: Compiler error: invalid parameters in DualQuaternionSkinning_Shadow.material(226): setting of constant failed
19:49:46: OGRE EXCEPTION(2:InvalidParametersException): Named constants have not been initialised, perhaps a compile error. in GpuProgramParameters::_findNamedConstantDefinition at ..\..\..\..\OgreMain\src\OgreGpuProgramParams.cpp (line 1441)
19:49:46: Compiler error: invalid parameters in DualQuaternionSkinning_Shadow.material(227): setting of constant failed
19:49:46: OGRE EXCEPTION(2:InvalidParametersException): Named constants have not been initialised, perhaps a compile error. in GpuProgramParameters::_findNamedConstantDefinition at ..\..\..\..\OgreMain\src\OgreGpuProgramParams.cpp (line 1441)
19:49:46: Compiler error: invalid parameters in DualQuaternionSkinning_Shadow.material(228): setting of constant failed
19:49:46: Parsing script HardwareSkinningShadow.material
19:49:46: OGRE EXCEPTION(7:InternalErrorException): Unable to compile Cg program Ogre/RTShader/shadow_caster_skinning_1weight_vs: The compile returned an error.
<invalid atom 65535>(21) : warning C7019: "blendWgt" is too large for semantic "BLENDWEIGHT", which is size 1
<invalid atom 65535>(23) : error C5041: cannot locate suitable resource to bind parameter "<null atom>"
<invalid atom 65535>(23) : error C5041: cannot locate suitable resource to bind parameter "<null atom>"
<invalid atom 65535>(23) : error C5041: cannot locate suitable resource to bind parameter "<null atom>"
<invalid atom 65535>(23) : error C5041: cannot locate suitable resource to bind parameter "<null atom>"
<invalid atom 65535>(23) : error C5041: cannot locate suitable resource to bind parameter "<null atom>"
<invalid atom 65535>(23) : error C5041: cannot locate suitable resource to bind parameter "<null atom>"
<invalid atom 65535>(23) : error C5041: cannot locate suitable resource to bind parameter "<null atom>"

........ etc etc


Here's my Hydrax.hdx file. (btw the problem persists regardless of whether I use GLSL or CG).
#Hydrax cfg file.

#Hydrax version field
HydraxVersion=0.5.4

#Main options field
<vector3>Position=0x0x0
<float>PlanesError=10.5
#Shader mode: 0=HLSL, 1=CG, 2=GLSL
<int>ShaderMode=2
<float>FullReflectionDistance=1e+011
<float>GlobalTransparency=0
<float>NormalDistortion=0.075
<vector3>WaterColor=0.139765x0.359464x0.425373

#Components field
Components=Sun|Foam|Depth|Smooth|Caustics|Underwater|UnderwaterReflections|UnderwaterGodRays

#Sun parameters
<vector3>SunPosition=0x10000x0
<float>SunStrength=1.75
<float>SunArea=150
<vector3>SunColor=1x1x1

#Foam parameters
<float>FoamMaxDistance=7.5e+007
<float>FoamScale=0.75
<float>FoamStart=0
<float>FoamTransparency=1

#Depth parameters
<float>DepthLimit=40
<float>DistLimit=40

#Smooth transitions parameters
<float>SmoothPower=5

#Caustics parameters
<float>CausticsScale=13.5
<float>CausticsPower=10.5
<float>CausticsEnd=0.8

#God rays parameters
<vector3>GodRaysExposure=0.76x2.46x2.29
<float>GodRaysIntensity=0.015
<float>GodRaysSpeed=5
<int>GodRaysNumberOfRays=100
<float>GodRaysRaysSize=0.03
<bool>GodRaysIntersections=false

#Rtt quality field(0x0 = Auto)
<size>Rtt_Quality_Reflection=0x0
<size>Rtt_Quality_Refraction=0x0
<size>Rtt_Quality_Depth=0x0
<size>Rtt_Quality_URDepth=0x0
<size>Rtt_Quality_GPUNormalMap=0x0

#Module options
Module=ProjectedGridVertex

<float>PG_ChoopyStrength=3.75
<bool>PG_ChoppyWaves=true
<int>PG_Complexity=264
<float>PG_Elevation=50
<bool>PG_ForceRecalculateGeometry=false
<bool>PG_Smooth=false
<float>PG_Strength=5.0

#Noise options
Noise=Perlin

<int>Perlin_Octaves=8
<float>Perlin_Scale=0.085
<float>Perlin_Falloff=0.49
<float>Perlin_Animspeed=1.4
<float>Perlin_Timemulti=1.27
<float>Perlin_GPU_Strength=2
<vector3>Perlin_GPU_LODParameters=0.5x50x150000


When I run I am getting these warnings/errors from the compiler. (I am using Visual Studio 2010 express).
'WaterWorldClient.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.17514_none_41e6975e2bd6f2b2\comctl32.dll', Cannot find or open the PDB file
First-chance exception at 0x756ac41f in WaterWorldClient.exe: Microsoft C++ exception: Ogre::InternalErrorException at memory location 0x0029ec38..


My Hydrax setup in my code.

mHydrax = new Hydrax::Hydrax(mSceneMgr, playerCamera, mWindow->getViewport(0));

// Create our projected grid module
Hydrax::Module::ProjectedGrid* mModule = new Hydrax::Module::ProjectedGrid(
mHydrax,
// Noise module
new Hydrax::Noise::Perlin(/*Generic one*/),
// Base plane
Ogre::Plane(Ogre::Vector3(0,1,0), Ogre::Vector3(0,0,0)),
// Normal mode
Hydrax::MaterialManager::NM_VERTEX,
// Projected grid options
Hydrax::Module::ProjectedGrid::Options(/*264 /*Generic one*/));


// Set our module
mHydrax->setModule(static_cast<Hydrax::Module::Module*>(mModule));

// Load all parameters from config file
mHydrax->loadCfg("Hydrax.hdx");

// Create water
mHydrax->create();


and in my frameRenderingQueued() I update Hydrax.

// update hydrax
mHydrax->update(evt.timeSinceLastFrame);


Thanks in advance for any help you can offer!

Subcutaneous

26-04-2013 03:49:17

Figured it out!

I found someone with a similar problem, I'll quote the response I found there that solved the problem.

Regarding your issues with how the hydrax projected grid is always lagging one frame behind, this is caused by the way Ogre tries to cache node positions and only update them when necessary. Unfortunately it can in some cases result in the derived orientation or position of a node to be incorrect.
Whenever the whole node tree is traversed the correct positions and orientations will be calculated, but unfortunately that traversal happens after the frameStarted events, and thus you get this effect.

I'm guessing that you're moving or reorienting a Node instead of the actual camera. (That's at least how my error was caused.)
The solution as I've found it is to manually call

Code: Select all

theNode->_update(true, false);


after you've moved your node. This will force a recalculation of all derived positions and orientations.
Note that I first tried with calling Node::needUpdate(...) on the affected nodes, but that didn't help.


I added "mynode"->_update(true, false); to update the parent node my camera was attached to.

I called this immediately after my code which involves camera movement. This solved the problem of Hydrax being a step behind my camera node.