Some new shader stuff:

General questions about Indigo, the scene format, rendering etc...
User avatar
OnoSendai
Developer
Posts: 6204
Joined: Sat May 20, 2006 6:16 pm
Location: Wellington, NZ
Contact:

Some new shader stuff:

Post by OnoSendai » Sun Nov 29, 2009 3:16 pm

Access to the world space normal of the surface fragment from inside a shader:
normal.jpg
normal.jpg (38.24 KiB) Viewed 9084 times

Code: Select all

<diffuse>
			<albedo>
        <shader>
          <shader>
            <![CDATA[	
						def eval(vec3 pos) vec3 :
                  vec3(
                    doti(normalWS()), 
                    dotj(normalWS()), 
                    dotk(normalWS())
                  )
						]]>
          </shader>
        </shader>
      </albedo>
		</diffuse>
Access to the zenith angle of the incident and scattered rays, allowing effects like colour-changing paint:
colour_changing_paint.jpg
colour_changing_paint.jpg (74.6 KiB) Viewed 9086 times

Code: Select all

<material>
		<name>default</name>

		<phong>
			<diffuse_albedo>
        <shader>
          <shader>
            <![CDATA[	
						def eval(vec3 pos) vec3 :
                  lerp(
                    vec3(1.0, 0.0, 0.0),
                    vec3(0.0, 1.0, 0.0),
                    thetaMax()
                   )
						]]>
          </shader>
        </shader>
      </diffuse_albedo>

      <exponent>
        <constant>
          10000.0
        </constant>
      </exponent>
		</phong>
  </material>
I'll probably release this stuff after 2.2 stable is done.

User avatar
lycium
Developer
Posts: 1199
Joined: Wed Sep 12, 2007 7:46 am
Location: Leipzig, Germany
Contact:

Re: Some new shader stuff:

Post by lycium » Sun Nov 29, 2009 3:36 pm

rock on :) i've been wanting to write some ISL shaders for a while...

User avatar
psor
1st Place Winner
Posts: 1295
Joined: Sun Jun 25, 2006 1:25 am
Location: Berlin
Contact:

Re: Some new shader stuff:

Post by psor » Sun Nov 29, 2009 4:53 pm

Looking good! I'm wondering if we can create "dirt" shader in the near future too. ;o))



take care
psor
"The sleeper must awaken"

User avatar
OnoSendai
Developer
Posts: 6204
Joined: Sat May 20, 2006 6:16 pm
Location: Wellington, NZ
Contact:

Re: Some new shader stuff:

Post by OnoSendai » Sun Nov 29, 2009 5:48 pm

Hi, Psor, what do you mean by a dirt shader?

User avatar
lycium
Developer
Posts: 1199
Joined: Wed Sep 12, 2007 7:46 am
Location: Leipzig, Germany
Contact:

Re: Some new shader stuff:

Post by lycium » Sun Nov 29, 2009 5:52 pm

i think he means something like what you had on your blog (which i miss btw, those rainbow tests etc were awesome), the "dust" shader which blended in some constant "dirty" colour depending on y component of the normal (since dust mostly falls downwards).

User avatar
CTZn
Posts: 7240
Joined: Thu Nov 16, 2006 4:34 pm
Location: Paris, France

Re: Some new shader stuff:

Post by CTZn » Sun Nov 29, 2009 6:17 pm

Yeepee !

Sometimes distance/curvature based shaders are refered to as dirt shaders, because they affect small features more. Curvature shaders could be used as blend maps to figure weared corners and stuff... but I'm not sure what psor is refering to :)

I understand the second pic visually (and that's quite enough) but I'd like to understand more... is this involving the incoming light direction ? If that's the case then the scene is not self-explanatory (light position), either what I don't get the subtlety...

Anyways... very cool stuff Ono !
obsolete asset

User avatar
OnoSendai
Developer
Posts: 6204
Joined: Sat May 20, 2006 6:16 pm
Location: Wellington, NZ
Contact:

Re: Some new shader stuff:

Post by OnoSendai » Sun Nov 29, 2009 6:41 pm

CTZn: Basically the colour changes as the view direction of a surface moves from the normal direction to grazing direction.

neo0.
Posts: 1784
Joined: Thu Feb 28, 2008 7:11 am
Location: the US of A

Re: Some new shader stuff:

Post by neo0. » Sun Nov 29, 2009 7:34 pm

OnoSendai wrote:CTZn: Basically the colour changes as the view direction of a surface moves from the normal direction to grazing direction.
So like iridescence?

Stromberg
Posts: 693
Joined: Mon Mar 02, 2009 5:01 am
Location: Norway
Contact:

Re: Some new shader stuff:

Post by Stromberg » Sun Nov 29, 2009 7:40 pm

Realy cool :)
I see dirt shader like some sort of ambient occlusion, that you could blend and make dirt texture maps appear where the ao is... would be cool to have :)

User avatar
OnoSendai
Developer
Posts: 6204
Joined: Sat May 20, 2006 6:16 pm
Location: Wellington, NZ
Contact:

Re: Some new shader stuff:

Post by OnoSendai » Sun Nov 29, 2009 7:50 pm

neo0. wrote:
OnoSendai wrote:CTZn: Basically the colour changes as the view direction of a surface moves from the normal direction to grazing direction.
So like iridescence?
Yeah. I think that's how colour-changing car paint is made.

User avatar
djegoo
Indigo 100
Posts: 273
Joined: Thu Jul 16, 2009 10:19 pm

Re: Some new shader stuff:

Post by djegoo » Mon Nov 30, 2009 1:59 am

wohooooo this efect on this teapot was exactly what i was desperately trying to do tonight by noobishly blending materials (yeah i m not expert :oops: ) and no succes!!!!

aaay i m so impatient to have this kind of shader

User avatar
juan_irender
Indigo 100
Posts: 235
Joined: Tue Jun 23, 2009 12:37 pm
Location: Spain

Re: Some new shader stuff:

Post by juan_irender » Mon Nov 30, 2009 2:25 am

Perfect, Ono! Every add you make to ISL is very, very convenient for Indigo.
Many thanks!
C4D R17 Studio User - Modo 902 user
iMac Core i7, 16 Gb RAM, OSX 10.11
Intel Core 2 Quad Q9550, 8 Gb RAM, Windows 10 64 bits

User avatar
CTZn
Posts: 7240
Joined: Thu Nov 16, 2006 4:34 pm
Location: Paris, France

Re: Some new shader stuff:

Post by CTZn » Mon Nov 30, 2009 4:34 am

It's so obvious what the shaders are doing now... :oops: I know them !!! Dunno what happened yesterday, brain@sunday or something close for sure.

zeitmeister, is your request: closest to shaded point ?

ie: very close is very dark and vice-versa. Could be used for menisque creation (use a flat water surface in a glass, apply distance shader as displacement. Same applies to displace the soil around a tree), some weathering effects (as AO pass) and more SFX.

Hang on: light gray on all meshes with unform backround lighting, tonemap and go ! You know that already zeitmeister :)
obsolete asset

User avatar
psor
1st Place Winner
Posts: 1295
Joined: Sun Jun 25, 2006 1:25 am
Location: Berlin
Contact:

Re: Some new shader stuff:

Post by psor » Mon Nov 30, 2009 2:41 pm

Stromberg wrote:Realy cool :)
I see dirt shader like some sort of ambient occlusion, that you could blend and make dirt texture maps appear where the ao is... would be cool to have :)
Yupp, that's how I would explain it too. Maybe a dirt shader needs a few more options tho.
Cause I'd need it to be possible to have irregularities instead being as smooth as AO.

I've to admit that I haven't used a dirt shader for years now as my work was mainly archviz
and they like there stuff clean. :mrgreen: :wink:

I guess today you call it just AO and that's it. I'm a bit ol' school. ;o))



take care
psor
Last edited by Soup on Thu Jan 27, 2011 8:47 am, edited 1 time in total.
Reason: Images removed because of auth request from external link
"The sleeper must awaken"

Stromberg
Posts: 693
Joined: Mon Mar 02, 2009 5:01 am
Location: Norway
Contact:

Re: Some new shader stuff:

Post by Stromberg » Mon Nov 30, 2009 8:56 pm

Thanks Psor, for explaining this :)
And it's what i tought, but maybe with a turbulence option aswell, very usefull :D

Post Reply
21 posts

Who is online

Users browsing this forum: No registered users and 2 guests