Jump to content

Pre-Pull Request: Deferred Shading


JeffR

Recommended Posts

Github branch: https://github.com/Azaezel/Torque3D/tree/Deferred_Complete_3.8


This implements the full deferred shading pipeline. As there's a few things that need fixing with the DX11 branch that Timmy's still looking into, for the moment we'll push forward on giving the Deferred work a test-over so it can be rolled in first. As far as I or Az are aware of, it's all functional, so it should just be a matter of pulling the changes into a build(preferrable a game build!) and testing everything to make sure it all behaves as one expects.

Link to comment
Share on other sites

@razvanab

Az means that in the Deferred_Complete_3.8 branch that we'll be testing to make sure the Deferred stuff is ready, he's merged in those OpenGL fixes that Lopuska made.


Once this branch has been sufficiently tested though, yes, it will be PR'd and rolled into the main repository. So, if you'd like to see that happen sooner, feel free to grab it and do some testing :)

Link to comment
Share on other sites

@razvanab

Az means that in the Deferred_Complete_3.8 branch that we'll be testing to make sure the Deferred stuff is ready, he's merged in those OpenGL fixes that Lopuska made.


Once this branch has been sufficiently tested though, yes, it will be PR'd and rolled into the main repository. So, if you'd like to see that happen sooner, feel free to grab it and do some testing :)

 

I already did that and so far it looks good. But I noticed some bugs on the water planes when I enable some post_fx for example bloom.

Are there some deferred specific bugs that I should be looking for?

Link to comment
Share on other sites

Won't deferred shading make the engine much slower?

Prepass Lighting (advanced) is a deferred variant. Only major difference is we don't throw buffers out between prepass then multiply on diffuse.

 

But I noticed some bugs on the water planes when I enable some post_fx for example bloom.

Are there some deferred specific bugs that I should be looking for?

 

http://i.imgur.com/R1kV0wY.jpg

Link to comment
Share on other sites

Won't deferred shading make the engine much slower?

 

Depending on your scene and hardware configuration, deferred shading can be faster than Prepass Lighting. While it certainly uses more bandwidth it also avoids rendering everything twice.

Link to comment
Share on other sites

Did some testing on that here. Does indeed add the bloom back in, but it looks like the bloom is on even at night time in the Outpost level. Probably an artifact of how specularity is calculated on the water than anything else though.


Otherwise, seems like a solid fix. Anyone else noting any other problems? Because if not, this'll probably get rolled in in the next couple days if no one elses spots any issues.

Link to comment
Share on other sites

What changes do you need to make to custom materials / shaders that worked in 3.8 to get them to work here? They are always replaced with a white mat in the deferred branch. Can't share the shader code, I didn't write it.

Edited by newaged
Link to comment
Share on other sites

  • 3 weeks later...

https://github.com/Azaezel/Torque3D/commit/65238d320fd97c7498cf788efecf41244b3f934c


With this fix it works.

On deferred lighting we use the prepass buffer (normal+z) and now in fully deferred pipeline we have 2 additional render targets (color + material) used to avoid the forward step (draw everything twice).

Briefly, the correct way to fix this, is to draw custom materials as forward rendering because custom materials have custom shaders that bypass torque material system. (and obviously these are not the shaders used during the prepass draw). Effectively, deferred shading allow to use only one material type. ( it's one of the limitations ). However we support also traditional forward render and that's the correct way to draw custom or complex materials as other engines does.


Hope it helps.


Anis

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...