* @param[in] context The GL context.
* @param[in] defaultShader The default shader to use.
* @param[in] buffer The current render buffer index (previous update buffer)
- * @param[in] frameTime The elapsed time between the last two updates.
* @param[in] viewMatrix The view matrix from the appropriate camera.
* @param[in] projectionMatrix The projection matrix from the appropriate camera.
* @param[in] cullMode True if the renderers should be subjected to clipspace culling
SceneGraph::TextureCache& textureCache,
SceneGraph::Shader& defaultShader,
BufferIndex bufferIndex,
- float frameTime,
const Matrix& viewMatrix,
const Matrix& projectionMatrix,
bool cullMode )
//Enable depth writes if depth buffer is enabled and item is opaque
context.DepthMask( depthBufferEnabled && item.IsOpaque() );
- item.GetRenderer().Render( context, textureCache, bufferIndex, item.GetNode(), defaultShader, item.GetModelViewMatrix(), viewMatrix, projectionMatrix, frameTime, cullMode, !item.IsOpaque() );
+ item.GetRenderer().Render( context, textureCache, bufferIndex, item.GetNode(), defaultShader, item.GetModelViewMatrix(), viewMatrix, projectionMatrix, cullMode, !item.IsOpaque() );
}
}
else
const RenderItem& item = renderList.GetItem( index );
DALI_PRINT_RENDER_ITEM( item );
- item.GetRenderer().Render( context, textureCache, bufferIndex, item.GetNode(), defaultShader, item.GetModelViewMatrix(), viewMatrix, projectionMatrix, frameTime, cullMode, !item.IsOpaque() );
+ item.GetRenderer().Render( context, textureCache, bufferIndex, item.GetNode(), defaultShader, item.GetModelViewMatrix(), viewMatrix, projectionMatrix, cullMode, !item.IsOpaque() );
}
}
}
-/**
- * Render items from the currentIndex until the depth index changes.
- * Leaves currentIndex pointing at the
- *
- * @param[in] renderList The render-list to process.
- * @param[in] context The GL context.
- * @param[in] defaultShader The default shader to use.
- * @param[in] buffer The current render buffer index (previous update buffer)
- * @param[in] frameTime The elapsed time between the last two updates.
- * @param[in] viewMatrix The view matrix from the appropriate camera.
- * @param[in] projectionMatrix The projection matrix from the appropriate camera.
- * @param[in] cullMode True if the renderers should be subjected to clipspace culling
- * @param[in] depthIndex The current depth index
- * @param[inout] currentIndex On entry, the index in the render list of the first item at the given depth index. On exit, the index of the first item at the next depth index.
- */
-inline void RenderItemsAtDepthIndex(
- const RenderList& renderList,
- Context& context,
- SceneGraph::TextureCache& textureCache,
- SceneGraph::Shader& defaultShader,
- BufferIndex bufferIndex,
- float frameTime,
- const Matrix& viewMatrix,
- const Matrix& projectionMatrix,
- bool cullMode,
- int depthIndex,
- size_t& currentIndex ) // Out parameter
-{
- const size_t count = renderList.Count();
-
- // Don't initialise currentIndex. Ever.
- for( ; currentIndex < count ; currentIndex++ )
- {
- const RenderItem& renderItem = renderList.GetItem( currentIndex );
- DALI_PRINT_RENDER_ITEM( renderItem );
-
- if( renderItem.GetDepthIndex() == depthIndex )
- {
- const Matrix& modelViewMatrix = renderItem.GetModelViewMatrix();
- renderItem.GetRenderer().Render( context, textureCache, bufferIndex, renderItem.GetNode(), defaultShader, modelViewMatrix, viewMatrix, projectionMatrix, frameTime, cullMode, !renderItem.IsOpaque() );
-
- }
- else
- {
- break; // Stop iterating when we reach a new depth index
- }
- }
-}
-
-
-
void ProcessRenderInstruction( const RenderInstruction& instruction,
Context& context,
SceneGraph::TextureCache& textureCache,
SceneGraph::Shader& defaultShader,
- BufferIndex bufferIndex,
- float frameTime )
+ BufferIndex bufferIndex )
{
DALI_PRINT_RENDER_INSTRUCTION( instruction, bufferIndex );
if( renderList &&
!renderList->IsEmpty() )
{
- ProcessRenderList( *renderList, context, textureCache, defaultShader, bufferIndex, frameTime, *viewMatrix, *projectionMatrix, instruction.mCullMode );
+ ProcessRenderList( *renderList, context, textureCache, defaultShader, bufferIndex, *viewMatrix, *projectionMatrix, instruction.mCullMode );
}
}
}
* @param[in] textureCache The texture cache used to get textures.
* @param[in] defaultShader The default shader.
* @param[in] buffer The current render buffer index (previous update buffer)
- * @param[in] frameTime The elapsed time between the last two updates.
*/
void ProcessRenderInstruction( const SceneGraph::RenderInstruction& instruction,
Context& context,
SceneGraph::TextureCache& textureCache,
SceneGraph::Shader& defaultShader,
- BufferIndex bufferIndex,
- float frameTime );
+ BufferIndex bufferIndex );
} // namespace Render
resourcePostProcessQueue( resourcePostProcessQ ),
instructions(),
backgroundColor( Dali::Stage::DEFAULT_BACKGROUND_COLOR ),
- frameTime( 0.0f ),
- lastFrameTime( 0.0f ),
frameCount( 0 ),
renderBufferIndex( SceneGraphBuffers::INITIAL_UPDATE_BUFFER_INDEX ),
defaultSurfaceRect(),
Vector4 backgroundColor; ///< The glClear color used at the beginning of each frame.
- float frameTime; ///< The elapsed time since the previous frame
- float lastFrameTime; ///< Last frame delta.
-
unsigned int frameCount; ///< The current frame count
BufferIndex renderBufferIndex; ///< The index of the buffer to read from; this is opposite of the "update" buffer
mImpl->backgroundColor = color;
}
-void RenderManager::SetFrameDeltaTime( float deltaTime )
-{
- mImpl->frameTime = deltaTime;
-}
-
void RenderManager::SetDefaultSurfaceRect(const Rect<int>& rect)
{
mImpl->defaultSurfaceRect = rect;
// reset the program matrices for all programs once per frame
// this ensures we will set view and projection matrix once per program per camera
- // @todo move programs out of context onto a program controller and let that handle this
mImpl->programController.ResetProgramMatrices();
// if we don't have default shader, no point doing the render calls
{
RenderInstruction& instruction = mImpl->instructions.At( mImpl->renderBufferIndex, i );
- DoRender( instruction, *mImpl->defaultShader, mImpl->lastFrameTime );
+ DoRender( instruction, *mImpl->defaultShader );
const RenderListContainer::SizeType countRenderList = instruction.RenderListCount();
if ( countRenderList > 0 )
PERF_MONITOR_END(PerformanceMonitor::DRAW_NODES);
- // Update the frame time
- mImpl->lastFrameTime = mImpl->frameTime;
-
// check if anything has been posted to the update thread
bool updateRequired = !mImpl->resourcePostProcessQueue[ mImpl->renderBufferIndex ].empty();
return updateRequired;
}
-void RenderManager::DoRender( RenderInstruction& instruction, Shader& defaultShader, float elapsedTime )
+void RenderManager::DoRender( RenderInstruction& instruction, Shader& defaultShader )
{
Rect<int> viewportRect;
Vector4 clearColor;
mImpl->context,
mImpl->textureCache,
defaultShader,
- mImpl->renderBufferIndex,
- elapsedTime );
+ mImpl->renderBufferIndex );
if(instruction.mOffscreenTextureId != 0)
{
* Helper to process a single RenderInstruction.
* @param[in] instruction A description of the rendering operation.
* @param[in] defaultShader default shader to use.
- * @param[in] elapsedTime from previous render.
*/
- void DoRender( RenderInstruction& instruction, Shader& defaultShader, float elapsedTime );
+ void DoRender( RenderInstruction& instruction, Shader& defaultShader );
private:
const Matrix& modelViewMatrix,
const Matrix& viewMatrix,
const Matrix& projectionMatrix,
- float frametime,
bool cull,
- bool blend)
+ bool blend )
{
- // @todo MESH_REWORK Fix when merging! :D
-
NewRenderer* renderer = dynamic_cast<NewRenderer*>(this);
if( renderer )
const Vector4& color = node.GetRenderColor( bufferIndex );
program->SetUniform4f( loc, color.r, color.g, color.b, color.a );
}
- loc = program->GetUniformLocation(Program::UNIFORM_TIME_DELTA);
- if( Program::UNIFORM_UNKNOWN != loc )
- {
- program->SetUniform1f( loc, frametime );
- }
//@todo MESH_REWORK Remove after removing ImageRenderer
DoSetUniforms(context, bufferIndex, mShader, program );
* @param[in] modelViewMatrix The model-view matrix.
* @param[in] viewMatrix The view matrix.
* @param[in] projectionMatrix The projection matrix.
- * @param[in] frametime The elapsed time between the last two updates.
* @param[in] cull Whether to frustum cull this renderer
*/
void Render( Context& context,
const Matrix& modelViewMatrix,
const Matrix& viewMatrix,
const Matrix& projectionMatrix,
- float frametime,
bool cull,
bool blend);
"uViewMatrix", // UNIFORM_VIEW_MATRIX,
"uNormalMatrix", // UNIFORM_NORMAL_MATRIX
"uColor", // UNIFORM_COLOR
- "uCustomTextureCoords", // UNIFORM_CUSTOM_TEXTURE_COORDS
"sTexture", // UNIFORM_SAMPLER
"sTextureRect", // UNIFORM_SAMPLER_RECT
"sEffect", // UNIFORM_EFFECT_SAMPLER
- "sEffectRect", // UNIFORM_EFFECT_SAMPLER_RECT
- "uTimeDelta", // UNIFORM_TIME_DELTA
- "sOpacityTexture", // UNIFORM_SAMPLER_OPACITY
- "sNormalMapTexture", // UNIFORM_SAMPLER_NORMAL_MAP
"uSize" // UNIFORM_SIZE
};
UNIFORM_VIEW_MATRIX,
UNIFORM_NORMAL_MATRIX,
UNIFORM_COLOR,
- UNIFORM_CUSTOM_TEXTURE_COORDS,
UNIFORM_SAMPLER,
UNIFORM_SAMPLER_RECT,
UNIFORM_EFFECT_SAMPLER,
- UNIFORM_EFFECT_SAMPLER_RECT,
- UNIFORM_TIME_DELTA,
- UNIFORM_SAMPLER_OPACITY,
- UNIFORM_SAMPLER_NORMAL_MAP,
UNIFORM_SIZE,
UNIFORM_TYPE_LAST
const BufferIndex bufferIndex = mSceneGraphBuffers.GetUpdateBufferIndex();
- // Update the frame time delta on the render thread.
- mImpl->renderManager.SetFrameDeltaTime(elapsedSeconds);
-
// 1) Clear nodes/resources which were previously discarded
mImpl->discardQueue.Clear( bufferIndex );