Jump to content

Additional buffers for postprocessing


nick.ace
 Share

Recommended Posts

Would it be possible for developers to specify additional custom buffers? It would make effects like heat haze and x-ray vision easy to do.

I'm not sure I understand the suggestion. You can make additional custom buffers now... take a look at the post-process lua scripts available and you will see that they create buffers in some of them. The 'bloom' script is a good example.

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

Yeah, but those are made after everything rendered (during postprocessing). I want to write to custom buffers using the fragment shader of the models. So for heat haze for example, you would want it to be occluded since it's a depth-based effect. The fragments that are visible at the end of this should have a special effect applied to them. Currently you can kind of do this by overloading the alpha channel of the normal buffer if you're careful (because it's used for other things a well such as decals and selection state for the editor)

 

So, being able to write to FragData3, FragData4, ...

 

Another example is your cool effect:

 

You have to do two passes right? Well, if you could write to an x-ray buffer instead, you wouldn't have to do this. You would definitely need another buffer for this to do in one pass because the occluded fragments get discarded by the GPU (unless you mess with the depth buffer, but then that messes up a ton of stuff).

Link to comment
Share on other sites

Another example is your cool effect:

 

You have to do two passes right? Well, if you could write to an x-ray buffer instead, you wouldn't have to do this. You would definitely need another buffer for this to do in one pass because the occluded fragments get discarded by the GPU (unless you mess with the depth buffer, but then that messes up a ton of stuff).

 

In that effect, I am writing to a custom buffer in another world, comparing its depth buffer to the main world's depth buffer, and based on the differences, determining what to write to fragData0.

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

Yeah, but that's slow. You have to do up to twice the transformations on the CPU. You also have to send up to twice as much data from the CPU to the GPU. Also, you don't get to take advantage of the GPU discarding nearby fragments, and you still end up using two buffers (actually, probably all of the buffers because you have to render the second world). If lights are in the scene, you would have to rerender all of the lights twice. Basically, it's not fast, which is why if you have transparency has a high performance hit for deferred renderers.

Link to comment
Share on other sites

Well, no I don't have to render the lights twice for the look I was going for... essentially I was just writing the character's normal map texture to fragData0. For that effect, I don't see how you could get away without using two buffers? It needs a comparison of depths to determine if an object is behind something. And for heathaze, LE2 just used a modified particle effect shader with a normal texture that had access to LE2's light buffer, which I do not think we have access to in LE4 since the rendering lights stage is done behind the scenes in World:Render().

 

But anywho - so your request is that you want the ability to write to custom buffers/channels specified in a model shader?

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

Yeah sorry, on second thought your example wasn't the best example. I was more or less thinking of just silhouettes, and with another buffer you could modify SSAO to ignore changes in depth. Anyway, the heat haze example would be more appropriate.

 

But anywho - so your request is that you want the ability to write to custom buffers/channels specified in a model shader?

 

Yes, that's what I want.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...