Jump to content

[SOLVED] Excluding material from DOF, but not HDR etc


photo

Recommended Posts

Posted

Hello Everyone

 

Is it possible to exclude a material from DOF, but not HDR?

 

I only see the POST Effects, which adds them after HDR and DOF etc., but not an option to just exclude from DOF.

 

Is there a function or something we could use to exclude our Moon and Stars from DOF? Same goes for Sky and Clouds.

 

DOF:

post-56-0-40241000-1349160039_thumb.jpg

 

NO DOF:

post-56-0-86562300-1349160031_thumb.jpg

 

I Also tried this POST Filter, but i think this one is just for on Screen effects and with the exclusion of HDR not what we could use... so it just darkens the picture.

 

Without Filter:

post-56-0-73373300-1349160095_thumb.jpg

 

With Filter:

post-56-0-27316700-1349160103_thumb.jpg

 

 

Thanks for any help in Advance

Posted

Per-material DOF can be achived via render_composite shader based on auxiliary masking. There is also a UNIGINE sample for selective DOF.

 

dof_mask Mask to exclude objects from DOF effect.
Skip - all materials are blurred.
red - materials that have Auxiliary Color with non-zero Red channel value are excluded from DOF effect.
green - materials that have Auxiliary Color with non-zero Green channel value are excluded from DOF effect.

 

@manguste: BTW there is a copy & past error in the ducumentation for this dof_mask paragraph: ..... are excluded from blur. Should be most probably: DOF effect

Posted

i enabled in my star billboards material auxiliary with color fffffff, made a composite material (inherit from the base one) and put that name in the composite field in render settings / common. Auxiliary is enabled in ESC Menu.

 

The Samples are with Meshes.. hope that doesn't make a difference for Billboards..? Just to go sure.

 

i used the "red" setting for the auxiliary pass. Mode was skip (also overlay had no effect), same goes for green effect.

 

i attached screenshots of all settings involved in this. i don't get it :) :)

 

thanks in advance for the help :)

post-56-0-18381500-1349213155_thumb.jpg

post-56-0-42944600-1349213161_thumb.jpg

post-56-0-00738700-1349213169_thumb.jpg

post-56-0-75784300-1349213178_thumb.jpg

Posted

Have you enabled same auxiliary rendering for sky and clouds ? Please verify auxiliary texture output (I think via editor-tools-render textures) and post screenshot. Maybe setting auxiliary_mode state to overlay instead of skip will also show proper/improper auxiliary output within normal scene rendering for verification.

Posted

Just checked shaders: there is no auxiliary rendering for sky material, but auxiliary rendering for billboards should work. So please verify auxiliary texture output, your billboards should show some color overlay (BTW I would assign red 0xff0000ff as auxiliary color for better visibility instead of white) as in these old screenhots (just posted because they look so cool). Otherwise please post small test scene (sky, stars billboards) for more detailed problem analysis.

Posted

ok, tried to enable auxiliary rendering for stars billboards with the unigine billboards_3 sample for selective DOF rendering. Does not seem to work -> UNIGINE should check if this is a bug.

 

Unfortunately auxiliary buffer is no longer rendered via editor-tools-render textures, so I cannot verify if auxiliary color is rendered into aux buffer or not.

Posted

hi ulf, thank you for your efforts!

 

currently there are NO sky boxes enabled and also ObjectSky is disabled.

 

i tried aroud with the settings and changed the color also to what you suggested to see better what changes. However i didn't find an exact setting for showing auxilary - just to skip it :)

 

i attached some screenshots with that.

post-56-0-65425600-1349252009_thumb.jpg

post-56-0-63578700-1349252017_thumb.jpg

post-56-0-02239200-1349252031_thumb.jpg

post-56-0-45851900-1349252044_thumb.jpg

post-56-0-97229600-1349252051_thumb.jpg

Posted

Hi Pacal, you are welcome. I had a look into the render_composite shader and its material definition, but couldn't find any bug there. I would guess that there might be a problem with auxiliary buffer mask writing within billboards shader code (though there is an auxiliary shader defined)

 

Unformatunately auxiliary buffer output as render texture for debugging seems to be gone, most probably it has been replaced with render_composite auxiliary_mode = overlay rendering as sceen overlay.

 

@UNIGINE: would it be possible to get back auxiliary texture output ? It really simplifies shader debuggung when auxiliary buffer effects are involved.

Posted

Ulf you brought me to the idea to test it with a NODE REFERENCE which contains a MESH.

 

Here is what i get

 

post-56-0-76570300-1349255220_thumb.jpg

 

post-56-0-56560000-1349255227_thumb.jpg

 

works like a charm on first try - really easy to achieve.

 

So there are 2 possible things:

First: I failed somewhere with the billboards and don't get where that is

 

Second: BIllboards are not correctly passed through the Auxilary Pass

 

(i changed DOF Focus to see the difference more clear btw, our normal DOF is not that extreme)

Posted

Yep, the behaviour is quite strange. First of all it seems that auxiliary texture is outputted, but proper name is missing (see red box in screenshot) It would be helpful if proper title would be available.

post-82-0-17541700-1349258325_thumb.jpg

 

Doing the same for ObjectBillboards shows that there seems to be nothing rendered to the auxiliary buffer, which looks like a bug.

post-82-0-54431900-1349259135_thumb.jpg

Posted

Yep.

 

Thanks once more for your research!

Posted

It seems that deferred shader pass has to be set to default (instead of none) for ObjectBillboards surface material to enable rendering of auxiliary buffer mask. If set to none no output to auxiliary buffer seems to occure (see screnshots)

post-82-0-45414100-1349262232_thumb.jpgpost-82-0-97463900-1349262243_thumb.jpg

Posted

In addition blending has to be deactivated for ObjectBillboards surface material.

post-82-0-10439200-1349263277_thumb.jpg

 

With these setting I get auxiliary output working, so DOF composite shading should have a non-0.0 input pixel mask for per-pixel DOF supression.

Posted

Well that makes a difference, but the effect is still not the desired one.

 

for example:

DOF on, Def off

post-56-0-42519000-1349263315_thumb.jpg

DOF on, Def on

post-56-0-34047300-1349263309_thumb.jpg

 

DOF off, Def off <-- as it should look like final

post-56-0-55277300-1349263303_thumb.jpg

DOF off, Def on

post-56-0-52110300-1349263296_thumb.jpg

Posted

@ Unigine

 

Seems there is a bug in the billboards, that they can't be rendered via Auxilliary Pass

 

Could you look into this?

Posted

Pascal, sorry, SDK is on the way, hot-hot-hot times. Will surely look into this on early next week!

Posted

Pascal, sorry, SDK is on the way, hot-hot-hot times. Will surely look into this on early next week!

 

Hi manguste

 

just wanted to go sure this doesn't get away unsolved, as the topic is "solved" B)

Thanks for the notification.

 

Cheers

Pascal

 

 

 

 

 

PS:New SDK:

 

aww-yeah-meme.png

  • 2 weeks later...
Posted

It's not possible to render white moon on black skies without white halo with DOF enabled, since it takes an image from a color buffer.

 

What you can do is to write your own shader that renders a moon into the auxiliary buffer with correct shading (scattering, lighting, etc.) Deferred, ambient and light passes should be disabled for moon material in this case. After that, enable Overlay state in composite material and assign it to Render.

 

I have changed the depth test of auxiliary rendering pass (from equal to less equal), so objects can be rendered into the auxiliary buffer when rendering into the deferred buffer is disabled.

Posted

Pascal, :D Nope, we won't skip your questions even if a topic is marked as solved. Fer shur!

×
×
  • Create New...