Untitled

mail@pastecode.io avatar
unknown
java
2 years ago
721 B
3
Indexable
Never
public void updateScene()
{
	modelCache.begin();
	scenes.forEach(s -> modelCache.add(s));
	modelCache.end();
}


protected void doRender()
{
	sceneManager.getRenderableProviders().clear();
	sceneManager.getRenderableProviders().add(modelCache);

	// renderTransmission(): we must save the current FBO
	SGLUtil.pushFBOBinding();

	// renderTransmission(): it will change the current viewport!
	GL11.glPushAttrib(GL11.GL_VIEWPORT_BIT);

	// mandatory
	PBRCommon.enableSeamlessCubemaps();

	// transmission
	sceneManager.renderTransmission();

	// restore viewport
	GL11.glPopAttrib();

	// restore fbo bindings
	SGLUtil.popFBOBinding();

	// now we can render our color buffer to dest fbo
	sceneManager.renderColors();
}