Hey guys!
I'm implementing SSAO for s44, and I'm having some troubles...
First, is that I have a map depth buffer, and a model depth buffer, so I should blend both to generate the global depth buffer. Even worst, there are some "features" which are not never drawn in such buffers, like trees. Do you know how could I get the depth buffer of the "final rendered image" from LUA?
Second, I have a lot of z-fighting. Do you know a way to control the near/far camera parameters at the time of producing the depth buffer?
Thanks!
Pepe
Create new depth buffer from LUA
Moderator: Moderators
Re: Create new depth buffer from LUA
gl.CopyToTexture or (in 103+, pass nil to read from the default fb) gl.BlitFBO in DrawWorld.how could I get the depth buffer of the "final rendered image" from LUA?
not currently possible.control the near/far camera parameters
-
- Posts: 823
- Joined: 21 Oct 2008, 02:54
Re: Create new depth buffer from LUA
watKloot wrote:
not currently possible.
-
- Posts: 26
- Joined: 19 Apr 2016, 21:11
Re: Create new depth buffer from LUA
Finally I used gl.CopyToTexture, which is working like a charm.
Is there an equivalent way to get the smoothed normals map?
Is there an equivalent way to get the smoothed normals map?
Re: Create new depth buffer from LUA
$model_gbuffer_normtex or $map_gbuffer_normtex perhaps?
See the gl.texture section of https://springrts.com/wiki/Lua_OpenGL_Api
See the gl.texture section of https://springrts.com/wiki/Lua_OpenGL_Api
-
- Posts: 26
- Joined: 19 Apr 2016, 21:11
Re: Create new depth buffer from LUA
I'm already using those... However:
* They should be blended, wasting time and resources
* Depending whether you are using a custom shader or not, some object may not be included
* I have problems with some drivers (e.g. NVidia Quadro 2000, Ubuntu 16.04)
* They should be blended, wasting time and resources
* Depending whether you are using a custom shader or not, some object may not be included
* I have problems with some drivers (e.g. NVidia Quadro 2000, Ubuntu 16.04)
Re: Create new depth buffer from LUA
If by "custom shader" you mean a custom unit or feature shader within the COS framework used by S44, those can write to the model g-buffer too.
There is no callout to combine the map and model buffer components into one, mostly due to lack of demand.
There is no callout to combine the map and model buffer components into one, mostly due to lack of demand.
-
- Posts: 26
- Joined: 19 Apr 2016, 21:11
Re: Create new depth buffer from LUA
Where may I find an example? because I'm failing miserablythose can write to the model g-buffer too.
That's a pity...There is no callout to combine the map and model buffer components into one, mostly due to lack of demand.
Re: Create new depth buffer from LUA
look at the lines containing 'deferred' in http://imolarpg.dyndns.org/trac/balates ... apping.lua
also, wrt controlling the near/far parameters: these shaders can easily be passed a custom uniform projection matrix.
also, wrt controlling the near/far parameters: these shaders can easily be passed a custom uniform projection matrix.
-
- Posts: 26
- Joined: 19 Apr 2016, 21:11
Re: Create new depth buffer from LUA
Thanks man! I'll try ASAP