--------------------------------------------------------------------------
| 172 | |
| 173 | //-------------------------------------------------------------------------- |
| 174 | void 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 | //----------------------------------------------------------------------- |
| 203 | bool Sample_ShaderSystem::frameRenderingQueued( const FrameEvent& evt ) |
nothing calls this directly
no test coverage detected