Was too tired when I wrote that...But at least in my case its an NVidia card (Nvidia Quadro FX 1500M).
No chance for me to get a Quadro
Was too tired when I wrote that...But at least in my case its an NVidia card (Nvidia Quadro FX 1500M).
Not exactly – although this kind of encode decode will be possible by writing custom shader code.I think i got you.
You mean to pack the normal vector on the vertex shader and for example unpack the normal vector in pixel shader like this Normal.z = sqrt(1.0f - Normal.x^2 - Normal.y^2) to save a field?
Yeah, don't do that unless you actually run out of slots. There's no point in compacting things if there are plenty of unused slots.Nir Hasson wrote: As I told you before – I have to do some tests and research if this kind of thing worth it.
I also think that the compacting algorithm should be executed only when the original naïve arrangement exceeded the maximum output slot count…
Code: Select all
curFuncInvocation = new FunctionInvocation(FFP_FUNC_LIGHT_POINT_DIFFUSE, groupOrder, internalCounter++);
curFuncInvocation->getOperandList().push_back(Operand(mWorldViewMatrix, Operand::OPS_IN));
curFuncInvocation->getOperandList().push_back(Operand(mVSInPosition, Operand::OPS_IN));
curFuncInvocation->getOperandList().push_back(Operand(mWorldViewITMatrix, Operand::OPS_IN));
curFuncInvocation->getOperandList().push_back(Operand(mVSInNormal, Operand::OPS_IN));
curFuncInvocation->getOperandList().push_back(Operand(curLightParams->mPosition, Operand::OPS_IN, (Operand::OPM_X | Operand::OPM_Y | Operand::OPM_Z)));
curFuncInvocation->getOperandList().push_back(Operand(curLightParams->mAttenuatParams, Operand::OPS_IN));
curFuncInvocation->getOperandList().push_back(Operand(curLightParams->mDiffuseColour, Operand::OPS_IN, (Operand::OPM_X | Operand::OPM_Y | Operand::OPM_Z)));
curFuncInvocation->getOperandList().push_back(Operand(mVSOutDiffuse, Operand::OPS_IN, (Operand::OPM_X | Operand::OPM_Y | Operand::OPM_Z)));
curFuncInvocation->getOperandList().push_back(Operand(mVSOutDiffuse, Operand::OPS_OUT, (Operand::OPM_X | Operand::OPM_Y | Operand::OPM_Z)));
vsMain->addAtomInstace(curFuncInvocation);
Code: Select all
curFuncInvocation = new FunctionInvocation(FFP_FUNC_CONSTRUCT, FFP_VS_COLOUR, internalCounter++);
curFuncInvocation->getOperandList().push_back(Operand(ParameterFactory::createConstParamFloat(0.0), Operand::OPS_IN));
curFuncInvocation->getOperandList().push_back(Operand(ParameterFactory::createConstParamFloat(0.0), Operand::OPS_IN));
curFuncInvocation->getOperandList().push_back(Operand(ParameterFactory::createConstParamFloat(0.0), Operand::OPS_IN));
curFuncInvocation->getOperandList().push_back(Operand(ParameterFactory::createConstParamFloat(0.0), Operand::OPS_IN));
curFuncInvocation->getOperandList().push_back(Operand(vsSpecular, Operand::OPS_OUT));
vsMain->addAtomInstace(curFuncInvocation);
Code: Select all
17:36:53: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource ../share/OGRE/media/RTShaderLib/3664747110_VS.cg in resource group General or any other group. in ResourceGroupManager::openResource at /media/sda2/Development/OGRE/svn-trunk/OgreMain/src/OgreResourceGroupManager.cpp (line 752)
17:36:53: High-level program 3664747110_VS encountered an error during loading and is thus not supported.
OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource ../share/OGRE/media/RTShaderLib/3664747110_VS.cg in resource group General or any other group. in ResourceGroupManager::openResource at /media/sda2/Development/OGRE/svn-trunk/OgreMain/src/OgreResourceGroupManager.cpp (line 752)
17:36:53: OGRE EXCEPTION(2:InvalidParametersException): Could not create gpu programs from render state in ProgramManager::acquireGpuPrograms at /media/sda2/Development/OGRE/svn-trunk/Components/RTShaderSystem/src/OgreShaderProgramManager.cpp (line 107)
Code: Select all
FileSystem=/media/sda2/Development/OGRE/sdk/svn-trunk/share/OGRE/media/RTShaderLib
#../share/OGRE/media/RTShaderLib
Code: Select all
mShaderGenerator->setFragmentShaderProfiles("ps_2_0");
Code: Select all
/home/dermont/Development/OGRE/svn-trunk/Components/RTShaderSystem/src/OgreShaderParameter.cpp: In member function ‘virtual Ogre::String Ogre::RTShader::ConstParameterFloat::toString() const’:
/home/dermont/Development/OGRE/svn-trunk/Components/RTShaderSystem/src/OgreShaderParameter.cpp:141: error: expected primary-expression before ‘.’ token
make[2]: *** [Components/RTShaderSystem/CMakeFiles/OgreRTShaderSystem.dir/src/OgreShaderParameter.cpp.o] Error 1
make[1]: *** [Components/RTShaderSystem/CMakeFiles/OgreRTShaderSystem.dir/all] Error 2
make: *** [all] Error 2
Code: Select all
Index: OgreShaderParameter.cpp
===================================================================
--- OgreShaderParameter.cpp (revision 9248)
+++ OgreShaderParameter.cpp (working copy)
@@ -138,7 +138,8 @@
String val = Ogre::StringConverter::toString(mValue);
// Make sure that float params have always this representation #.#
- if(val.find(".") == String.npos)
+
+ if(val.find(".") == String::npos)
{
val += ".0";
}
@@ -682,4 +683,4 @@
}
}
-}
\ No newline at end of file
+}
I had the same failure on OS X and iPhone. Checking in the fix.dermont wrote:I think there may be a small typo in OgreShaderParameter.cpp, build fails on Linux:
Code: Select all
/home/dermont/Development/OGRE/svn-trunk/Components/RTShaderSystem/src/OgreShaderParameter.cpp: In member function ‘virtual Ogre::String Ogre::RTShader::ConstParameterFloat::toString() const’: /home/dermont/Development/OGRE/svn-trunk/Components/RTShaderSystem/src/OgreShaderParameter.cpp:141: error: expected primary-expression before ‘.’ token make[2]: *** [Components/RTShaderSystem/CMakeFiles/OgreRTShaderSystem.dir/src/OgreShaderParameter.cpp.o] Error 1 make[1]: *** [Components/RTShaderSystem/CMakeFiles/OgreRTShaderSystem.dir/all] Error 2 make: *** [all] Error 2
Code: Select all
Index: OgreShaderParameter.cpp =================================================================== --- OgreShaderParameter.cpp (revision 9248) +++ OgreShaderParameter.cpp (working copy) @@ -138,7 +138,8 @@ String val = Ogre::StringConverter::toString(mValue); // Make sure that float params have always this representation #.# - if(val.find(".") == String.npos) + + if(val.find(".") == String::npos) { val += ".0"; } @@ -682,4 +683,4 @@ } } -} \ No newline at end of file +}
Yeap - use the cache trick again - you'll have to track down the shaders you wanna debug (its easy in the Shader System Sample), then you canAny ideas how i can track this issuses better down?