Getting Multiple Shader Buffer Textures

BlitzMax Forums/MiniB3D Module/Getting Multiple Shader Buffer Textures

RustyKristi(Posted 2016) [#1]
If I need the CameraTex, DepthBufferToTex and NormalBufferToTex do I have to create multiple passes (camera) or can I include them in one pass?


markcw(Posted 2016) [#2]
When using FBOs they take an extra render so camera/depthtotex need that just to get the data, normal maps are precalculated so you don't need to render anything and can do them in one pass, see the sl_bumpmap example for using normal maps.


RustyKristi(Posted 2016) [#3]
Thanks munch, I will have a look on the bump example. So the maximum to get those values would be just 2 pass?


markcw(Posted 2016) [#4]
If you're doing a depth of field postfx shader that's a 2 pass, 1 for the camera and 1 for the depth on top of the normal render, there's no other way with realtime effects like that. The only time I used depthbuffertotex was for DOF but you could probably use it for fog or dark/light effects too.


RustyKristi(Posted 2016) [#5]
Thanks, I'll keep that in mind. Can you also get the normal map for the whole scene? like this one?



If I'm not mistaken the precalculated normal in the bump examples is per material, I hope this makes sense.