Forum

Materials - Additive Shader

08 September 2015 10:53
Hello,

I have three real newbie questions.
How can I obtain a transparent, real additive shader effect/material (where three of those materials, in red, green and blue, would add/accumulate to white) ?

I tried with following material settings, but the type:'Add' do not really differ from type:'AlphaBlend' (except that in AlphaBlend z is written):

Show Transparency : true,
Alpha: 0.5,
Type: Add,
Shadeless: true

But overlapping/overlaying materials getting darker.



How can I achieve an additive transparent effect?


To my second question, how can I disable the writting to z buffer in the AlphaBlend material type? Is it possible, or would I have to dive deeper and inject my own shader? (Or is there a possibility with shader-nodes?)

Is there a possibility to control the drawing/execution- order of two transparent-shaders?

Many thanks
@ Emotional3D
08 September 2015 13:49

How can I obtain a transparent, real additive shader effect/material (where three of those materials, in red, green and blue, would add/accumulate to white) ?

This effect occurs only with light:

(additive = light / subtractive = filters)
http://phscs.ru/physicsus/spectrum

spectrum.blend
spectrum.html
Manager and 3D Generalist at Blend4Web
No pain, no gain.
mikhail@blend4web.com
08 September 2015 14:23
Hi,
I'll add that: the problem here lays in light physics. Everything we see is the reflected light. When light travels through transparent objects, it loses some photons - some are scattered, some are "absorbed" by material, etc. So when light goes through three transparent materials, it loses photons three times and there's no way it can be brighter: they are subtracting each other. It's like you're mixing inks of different colors - the result will always be dimmer.

And if three light sources are lighting on the same area, this area reflects the light from all those sources, every source's light is being added to another's, so in this case we can get a white light as a sum of RGB lights
09 September 2015 10:06
Thank you Mikhail and Pavel for your lightning fast answers!

Yes, that makes total sense.

And is there any possibility in Blend4Web to achieve an additive blending like in this picture (for a custom shader-node)?


Thanks again.
@ Emotional3D
09 September 2015 10:38

And is there any possibility in Blend4Web to achieve an additive blending like in this picture (for a custom shader-node)?

Yes, you need to set the value channel of color > 1 (I set it to 10000). And no shading ("Material/Extended Material" nodes), only "Output"!

Untitled blender 2.blend
Untitled blender 2.html
Manager and 3D Generalist at Blend4Web
No pain, no gain.
mikhail@blend4web.com
10 September 2015 11:58
Mikhail, thank you, that was the crucial bit of information. I perceived a color-slider range of [0..1] of the output-node and limited myself by my own assumptions.

It works.

For a smooth linear gradient from e.g. a transparent to an additive blue here an example, documenting the procedure:


The shader-node:


additiveAlphaBlendLinearGradient.blend
additiveAlphaBlendLinearGradient.html

Thank you for your excellent support.
@ Emotional3D
16 February 2018 10:32
Hi Pavel and Mikhail , I hope you are fine. I am looking a devoloper for my project. The project about jewelery configrator. I already created my models.

I
 
Please register or log in to leave a reply.