MCPcopy Create free account
hub / github.com/OGRECave/ogre / sliderMoved

Method sliderMoved

Samples/ShaderSystem/src/ShaderSystem.cpp:174–200  ·  view source on GitHub ↗

--------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

172
173//--------------------------------------------------------------------------
174void Sample_ShaderSystem::sliderMoved(Slider* slider)
175{
176 if (slider->getName() == REFLECTIONMAP_POWER_SLIDER && mReflectionMapSubRS)
177 {
178 String luminance = std::to_string(slider->getValue());
179
180 // Grab the instances set and update them with the new reflection power value.
181 // The instances are the actual sub render states that have been assembled to create the final shaders.
182 // Every time that the shaders have to be re-generated (light changes, fog changes etc..) a new set of sub render states
183 // based on the template sub render states assembled for each pass.
184 // From that set of instances a CPU program is generated and afterward a GPU program finally generated.
185 auto instanceSet = mReflectionMapSubRS->getAccessor()->getSubRenderStateInstanceSet();
186 for (auto inst : instanceSet)
187 {
188 inst->setParameter("luminance", luminance);
189 }
190 }
191
192 if (slider->getName() == MODIFIER_VALUE_SLIDER)
193 {
194 if (mLayeredBlendingEntity != NULL)
195 {
196 Ogre::Real val = mModifierValueSlider->getValue();
197 mLayeredBlendingEntity->getSubEntity(0)->setCustomParameter(2, Vector4f(val,val,val,0));
198 }
199 }
200}
201
202//-----------------------------------------------------------------------
203bool Sample_ShaderSystem::frameRenderingQueued( const FrameEvent& evt )

Callers

nothing calls this directly

Calls 8

Vector4fClass · 0.85
getAccessorMethod · 0.80
getSubEntityMethod · 0.80
to_stringFunction · 0.50
getNameMethod · 0.45
getValueMethod · 0.45
setParameterMethod · 0.45
setCustomParameterMethod · 0.45

Tested by

no test coverage detected