Hey,
I was wondering, where the depth buffer is written in the code.
I have a depth sensor in gazebo, which uses ogre to render everything.
In the Code they allways load from the depth buffer but I cant find in Ogre where they write into it.
As far as I understand, the SceneManager should do it, but I dont see any obvious function.
Thank you for any help
Write into depth buffer
-
- OGRE Team Member
- Posts: 1993
- Joined: Sun Mar 30, 2014 2:51 pm
- x 1073
- Contact:
Re: Write into depth buffer
the same code that writes the color buffer, also writes the depth buffer
- Zeckurbo
- Gnoblar
- Posts: 9
- Joined: Wed Nov 11, 2020 6:13 pm
Re: Write into depth buffer
Do you know in which class I can search for it, or maybe even whats the name of the function?
-
- OGRE Team Member
- Posts: 1993
- Joined: Sun Mar 30, 2014 2:51 pm
- x 1073
- Contact:
Re: Write into depth buffer
thats rendersystem dependant. E.g. with GL3+ the buffers are set up here:
https://github.com/OGRECave/ogre/blob/a ... ct.cpp#L80
the actual writing takes place when glDraw* is called.
https://github.com/OGRECave/ogre/blob/a ... ct.cpp#L80
the actual writing takes place when glDraw* is called.
- Zeckurbo
- Gnoblar
- Posts: 9
- Joined: Wed Nov 11, 2020 6:13 pm
Re: Write into depth buffer
Thank you so much
I have found that the depth buffer is now initialized in GL3PlusFrameBufferObject::attachDepthBuffer()
https://github.com/OGRECave/ogre/blob/a ... t.cpp#L278
And I think the depth buffer is set in RenderSystem::setDepthBufferFor()
https://github.com/OGRECave/ogre/blob/a ... m.cpp#L667
I have found that the depth buffer is now initialized in GL3PlusFrameBufferObject::attachDepthBuffer()
https://github.com/OGRECave/ogre/blob/a ... t.cpp#L278
And I think the depth buffer is set in RenderSystem::setDepthBufferFor()
https://github.com/OGRECave/ogre/blob/a ... m.cpp#L667
-
- OGRE Team Member
- Posts: 1993
- Joined: Sun Mar 30, 2014 2:51 pm
- x 1073
- Contact:
Re: Write into depth buffer
these are write-only depth-buffers (RenderBuffer in GL terms). If the depth is read somewhere it must go through the code that I linked.