I would like to use the development branch (latest and greatest 'in progress') build but it's difficult to know which is which on the downloads.
what is the branch furthest along in upgrades?
thanks,
latest branch
Re: latest branch
svn trunk is the main development branch and will be Irrlicht 1.9.
release branches are only getting patches once in a while if they have no risk breaking compatibility (so you should be able to replace a dll and it still all works), but those changes always get merged into trunk immediately. So basically only use those if you need full compatibility to a release.
And ogl-es is the Android branch. It will have some stuff main development branch does not have (aka ogl-es and webgl drivers), but is only updated once in a while from trunk and less tested. Thought if you need something from trunk in there you can always ask me to do a merge and I'll update it.
release branches are only getting patches once in a while if they have no risk breaking compatibility (so you should be able to replace a dll and it still all works), but those changes always get merged into trunk immediately. So basically only use those if you need full compatibility to a release.
And ogl-es is the Android branch. It will have some stuff main development branch does not have (aka ogl-es and webgl drivers), but is only updated once in a while from trunk and less tested. Thought if you need something from trunk in there you can always ask me to do a merge and I'll update it.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: latest branch
this is the code I have been using
https://svn.code.sf.net/p/irrlicht/code/trunk
sounds like it is the latest so thanks!
on another note, is there a way to access the depth buffer in a shader?
https://svn.code.sf.net/p/irrlicht/code/trunk
sounds like it is the latest so thanks!
on another note, is there a way to access the depth buffer in a shader?
Re: latest branch
Yeah, sounds good.
You can't directly access the depth buffer I think. Also it's modified with each polygon, so not sure if it would be useful at that stage.
But you can render it to a texture.
So you need 2 render-stages and a rendertargettexture.There's 2 ways for that I suppose, but I've not much experience with this.
First is figuring out the calculations yourself and then create a specific vertex/pixel shader combination that writes the depth of each point in camera-space (linear or non-linear - your choice in that case). Please don't ask me for formulas for this - I'm struggling with this myself and would have to spend some days to figure it out (or get lucky on google, but I learned to not trust the results you get for that stuff too much). Totally naive my first guess would be to use the model-view matrix and subtract near value from z and then divide by (far-near) to get some linear 0-1 range in the vertex shader and pass that just on to the pixel-shader and that writes it simply out. Thought you still have to set gl_Position to clip-space (aka WorldViewProj * gl_Vertex) so maybe you could get it back from that as well. But I think that one is not linear and depends on if you are on D3D or OpenGL. Sorry, been 1-2 years again since I read up on that once :-(
The other solution - which I haven't tested yet, but should be easier I hope and has the advantage that you can render scene and depth-buffer in one stage (which may or may not be useful as once you need depth-buffers you tend to have several stages anyway):
Create some texture with a depth format (ECF_D16, ECF_D32 or ECF_D24S8). Then set that texture in the new IRenderTarget interface (only available in svn trunk). Then render to that rendertarget and you should automatically get it. I think. Thought not sure about value distribution (linear or non-linear). So you might have to google to find out how linearize it.
You can't directly access the depth buffer I think. Also it's modified with each polygon, so not sure if it would be useful at that stage.
But you can render it to a texture.
So you need 2 render-stages and a rendertargettexture.There's 2 ways for that I suppose, but I've not much experience with this.
First is figuring out the calculations yourself and then create a specific vertex/pixel shader combination that writes the depth of each point in camera-space (linear or non-linear - your choice in that case). Please don't ask me for formulas for this - I'm struggling with this myself and would have to spend some days to figure it out (or get lucky on google, but I learned to not trust the results you get for that stuff too much). Totally naive my first guess would be to use the model-view matrix and subtract near value from z and then divide by (far-near) to get some linear 0-1 range in the vertex shader and pass that just on to the pixel-shader and that writes it simply out. Thought you still have to set gl_Position to clip-space (aka WorldViewProj * gl_Vertex) so maybe you could get it back from that as well. But I think that one is not linear and depends on if you are on D3D or OpenGL. Sorry, been 1-2 years again since I read up on that once :-(
The other solution - which I haven't tested yet, but should be easier I hope and has the advantage that you can render scene and depth-buffer in one stage (which may or may not be useful as once you need depth-buffers you tend to have several stages anyway):
Create some texture with a depth format (ECF_D16, ECF_D32 or ECF_D24S8). Then set that texture in the new IRenderTarget interface (only available in svn trunk). Then render to that rendertarget and you should automatically get it. I think. Thought not sure about value distribution (linear or non-linear). So you might have to google to find out how linearize it.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: latest branch
I like it. thanks for the help!