pascal.winistoerfer Posted October 2, 2012 Posted October 2, 2012 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: NO DOF: 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: With Filter: Thanks for any help in Advance
ulf.schroeter Posted October 2, 2012 Posted October 2, 2012 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
pascal.winistoerfer Posted October 2, 2012 Author Posted October 2, 2012 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 :)
ulf.schroeter Posted October 3, 2012 Posted October 3, 2012 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.
ulf.schroeter Posted October 3, 2012 Posted October 3, 2012 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.
ulf.schroeter Posted October 3, 2012 Posted October 3, 2012 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.
pascal.winistoerfer Posted October 3, 2012 Author Posted October 3, 2012 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.
ulf.schroeter Posted October 3, 2012 Posted October 3, 2012 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.
pascal.winistoerfer Posted October 3, 2012 Author Posted October 3, 2012 Ulf you brought me to the idea to test it with a NODE REFERENCE which contains a MESH. Here is what i get 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)
ulf.schroeter Posted October 3, 2012 Posted October 3, 2012 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. Doing the same for ObjectBillboards shows that there seems to be nothing rendered to the auxiliary buffer, which looks like a bug.
pascal.winistoerfer Posted October 3, 2012 Author Posted October 3, 2012 Yep. Thanks once more for your research!
ulf.schroeter Posted October 3, 2012 Posted October 3, 2012 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)
ulf.schroeter Posted October 3, 2012 Posted October 3, 2012 In addition blending has to be deactivated for ObjectBillboards surface material. 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.
pascal.winistoerfer Posted October 3, 2012 Author Posted October 3, 2012 Well that makes a difference, but the effect is still not the desired one. for example: DOF on, Def off DOF on, Def on DOF off, Def off <-- as it should look like final DOF off, Def on
pascal.winistoerfer Posted October 7, 2012 Author Posted October 7, 2012 @ Unigine Seems there is a bug in the billboards, that they can't be rendered via Auxilliary Pass Could you look into this?
manguste Posted October 12, 2012 Posted October 12, 2012 Pascal, sorry, SDK is on the way, hot-hot-hot times. Will surely look into this on early next week!
pascal.winistoerfer Posted October 13, 2012 Author Posted October 13, 2012 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:
frustum Posted October 22, 2012 Posted October 22, 2012 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.
manguste Posted October 22, 2012 Posted October 22, 2012 Pascal, :D Nope, we won't skip your questions even if a topic is marked as solved. Fer shur!
Recommended Posts