next gen RTSS
Posted: Fri Nov 16, 2018 7:56 pm
A major RTSS update just landed in the 1.11 branch. It updates the API following the DRY (do not repeat yourself) principle making it considerably easier to write new functionality.
The difference is best visualised by an example. So lets take a look at a rather simple snippet from FFPTransform before
and after
the new code is quite close to being readable I would say. The the RTSS documentation has been updated accordingly:
https://codedocs.xyz/OGRECave/ogre/rtss ... extensions
The difference is best visualised by an example. So lets take a look at a rather simple snippet from FFPTransform before
Code: Select all
FunctionInvocation* transformFunc = OGRE_NEW FunctionInvocation(FFP_FUNC_TRANSFORM, FFP_VS_TRANSFORM);
transformFunc->pushOperand(wvpMatrix, Operand::OPS_IN);
transformFunc->pushOperand(positionIn, Operand::OPS_IN);
transformFunc->pushOperand(positionOut, Operand::OPS_OUT);
vsEntry->addAtomInstance(transformFunc);
UniformParameterPtr pointParams = vsProgram->resolveAutoParameterReal(GpuProgramParameters::ACT_POINT_PARAMS, 0);
ParameterPtr pointSize = vsEntry->resolveOutputParameter(
Parameter::SPS_TEXTURE_COORDINATES, -1, Parameter::SPC_POINTSPRITE_SIZE, GCT_FLOAT1);
transformFunc = OGRE_NEW FunctionInvocation("FFP_DerivePointSize", FFP_VS_TRANSFORM);
transformFunc->pushOperand(pointParams, Operand::OPS_IN);
transformFunc->pushOperand(positionOut, Operand::OPS_IN, Operand::OPM_W);
transformFunc->pushOperand(pointSize, Operand::OPS_OUT);
vsEntry->addAtomInstance(transformFunc);
Code: Select all
auto stage = vsEntry->getStage(FFP_VS_TRANSFORM);
stage.callFunction(FFP_FUNC_TRANSFORM, wvpMatrix, positionIn, positionOut);
UniformParameterPtr pointParams = vsProgram->resolveParameter(GpuProgramParameters::ACT_POINT_PARAMS);
ParameterPtr pointSize = vsEntry->resolveOutputParameter(Parameter::SPC_POINTSPRITE_SIZE);
stage.callFunction("FFP_DerivePointSize", pointParams, In(positionOut).w(), pointSize);
https://codedocs.xyz/OGRECave/ogre/rtss ... extensions