About Store Forum Documentation Contact
Donations:
309$/mo



Post Reply 
Multipass HDR shader.
Author Message
georgatos7 Offline
Member

Post: #1
Multipass HDR shader.
Hi.

Among other stuff lately i've been experimenting on improving my glow but after many efforts i've encountered an issue that i need some help with, let me explain.
My shader involves a series of backbuffer passes like:

-Threshold (Pass)
-Downsample (Pass)
-Blur Horizontally (Pass)
-Blur Vertically (Pass)
-Store to shader Image A,B,C.. (6 Iterations)
-Combine A,B,C,D,E,F and draw outcome.

I do the various passes in the following manner.
Code:
D.highPrecColRT(true); //HDR render targets enabled
...
D.fxBegin();            
D.clearCol(BLACK);            
Shaders("User/Custom Shader").getTech("BlurHorizontal").draw(glow[i], &myRect); //myRect = downsampled dimensions of the screen that i want my shader to work on
rrt[i] = D.fxEnd(); //rrt[i] in an array of ImageRTPtr type used to store the pre-combined results

Everything seems to work ok except that some artifacts in the gradient of the glow seem like they come from LDR shader steps so i wanted to ask if the following...
D.fxBegin();
//Draw shader pass
storeImagePtr = D.fxEnd();
...breaks the HDR procedure by doing an intermediate downgrade to something like HDR->LDR Draw->HDR Store. Finally i don't see much difference when i turn HDR off on runtime.

I'm posting a screenshot that due to that is not so smooth.

[Image: Esenthel_Glow_Non_Smooth.jpg]
(This post was last modified: 01-14-2015 11:16 PM by georgatos7.)
12-18-2014 01:17 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Multipass HDR shader.
If you would like to do complex shader effects, then I would really recommend getting the source, so you could see how things work internally smile
D.fxBegin internally always uses an 8-bit per channel RGBA buffer.
And high precision render targets are reserved only for the rendering (inside Renderer) stage.
12-18-2014 10:07 PM
Find all posts by this user Quote this message in a reply
georgatos7 Offline
Member

Post: #3
RE: Multipass HDR shader.
Ah thanks a lot Esenthel, that was very informative, i'll try to tackle this by alternating my steps, maybe fewer but in higher resolution and wider blur. As for the source i am very interested but i got a bit tight financials atm, though i can surely afford the binary monthly subscription.

Again thanks a lot for the answer.
(This post was last modified: 12-19-2014 12:01 AM by georgatos7.)
12-18-2014 10:35 PM
Find all posts by this user Quote this message in a reply
Post Reply