mirror of https://github.com/axmolengine/axmol.git
Merge branch 'v3FrameBufferObject' into v3Viewport
This commit is contained in:
commit
2f32fcabba
|
@ -475,6 +475,11 @@ void Camera::applyFrameBufferObject()
|
|||
}
|
||||
}
|
||||
|
||||
void Camera::apply()
|
||||
{
|
||||
applyFrameBufferObject();
|
||||
}
|
||||
|
||||
int Camera::getRenderOrder() const
|
||||
{
|
||||
int result(0);
|
||||
|
|
|
@ -213,9 +213,17 @@ public:
|
|||
* Get the default camera of the current running scene.
|
||||
*/
|
||||
static Camera* getDefaultCamera();
|
||||
|
||||
/**
|
||||
Before rendering scene with this camera, the background need to be cleared.
|
||||
*/
|
||||
void clearBackground(float depth);
|
||||
|
||||
/**
|
||||
Apply the FBO, RenderTargets and viewport.
|
||||
*/
|
||||
void apply();
|
||||
/**
|
||||
Set FBO, which will attacha several render target for the rendered result.
|
||||
*/
|
||||
void setFrameBufferObject(FrameBufferObject* fbo);
|
||||
void setViewport(const Viewport& vp) { _viewport = vp; }
|
||||
CC_CONSTRUCTOR_ACCESS:
|
||||
|
|
|
@ -164,7 +164,7 @@ void Scene::render(Renderer* renderer)
|
|||
|
||||
director->pushMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION);
|
||||
director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION, Camera::_visitingCamera->getViewProjectionMatrix());
|
||||
camera->applyFrameBufferObject();
|
||||
camera->apply();
|
||||
//clear background with max depth
|
||||
camera->clearBackground(1.0);
|
||||
//visit the scene
|
||||
|
|
Loading…
Reference in New Issue