MCPcopy Create free account
hub / github.com/cinder/Cinder / draw

Method draw

samples/_opengl/ShadowMappingBasic/src/ShadowMappingBasicApp.cpp:189–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

187}
188
189void ShadowMappingBasic::draw()
190{
191 renderDepthFbo();
192
193 gl::clear( Color::black() );
194 gl::setMatrices( mCam );
195
196 gl::ScopedTextureBind texScope( mShadowMapTex, (uint8_t) 0 );
197
198 vec3 mvLightPos = vec3( gl::getModelView() * vec4( mLightPos, 1.0f ) ) ;
199 mat4 shadowMatrix = mLightCam.getProjectionMatrix() * mLightCam.getViewMatrix();
200
201 mGlsl->uniform( "uShadowMap", 0 );
202 mGlsl->uniform( "uLightPos", mvLightPos );
203 mGlsl->uniform( "uShadowMatrix", shadowMatrix );
204
205 drawScene( false );
206
207 // Uncomment for debug
208 /*
209 gl::setMatricesWindow( getWindowSize() );
210 gl::color( 1.0f, 1.0f, 1.0f );
211 float size = 0.5f*std::min( getWindowWidth(), getWindowHeight() );
212 gl::draw( mShadowMapTex, Rectf( 0, 0, size, size ) );
213 */
214}
215
216CINDER_APP( ShadowMappingBasic, RendererGl, ShadowMappingBasic::prepareSettings )

Callers 1

drawSceneMethod · 0.45

Calls 5

blackFunction · 0.85
setMatricesFunction · 0.85
getModelViewFunction · 0.85
uniformMethod · 0.80
clearFunction · 0.50

Tested by

no test coverage detected