Page 1 of 2

Werkkzeug4 light

PostPosted: Wednesday, 07.May 2014, 09:37
by CybeREX
Here is same scene (close environment with 3 light on it - red, white and blue) made in both wz3 and wz4 demotool.
So my question is it possible to make light spot with the same color on the floor reflection with light color have?
I made screenshot from same angle to see the difference on the floor color.
wz4 version (on the floor white spotted color only)
wz4_light spot white.jpg

wz3 version (on the floor original color spot presented - blu and red and white)
wz3_color light spot.jpg

Re: Werkkzeug4 light

PostPosted: Wednesday, 07.May 2014, 22:27
by Skinnytorus
It looks like in wz4 ModLight affects only the diffuse channel. However you can modulate phong reflection color (regretfully, it affects all the lights :( ) by placing Const operator above Phong. That will reveal some new options in the phong shader. Among them find Color(rgb) and enable it. Play with Const color to see the effect.

Re: Werkkzeug4 light

PostPosted: Thursday, 08.May 2014, 06:36
by CybeREX
Yes its half help, I can select only one color reflection to the all lights.
PS. ikam can you correct wz4 light or it's hard work to do?

Re: Werkkzeug4 light

PostPosted: Friday, 09.May 2014, 09:49
by CybeREX
Here is what I found in demo fr-063.

http://www.youtube.com/watch?v=PXOcLIlEB6o#t=211 Here you can see different color lightning from window on the test table.

http://www.youtube.com/watch?v=PXOcLIlEB6o#t=268 Here you can see green light in the cave and on the top where man stand is white light.

Now need to somehow unpack data from this demo, to see, how it was done.

Re: Werkkzeug4 light

PostPosted: Friday, 09.May 2014, 10:22
by Skinnytorus
1) Those are diffuse lights on the table (not phong reflections). Diffuse lights retain their color ok.
2) There the green light also uses diffuse channel (not phong reflections).
3) No need to unpack here. That's not what we are after...

Re: Werkkzeug4 light

PostPosted: Friday, 09.May 2014, 10:35
by CybeREX
Oh, I see, my mistake. So phong reflections is available on the material only now. and only one color.

Re: Werkkzeug4 light

PostPosted: Friday, 09.May 2014, 10:44
by Skinnytorus
Take a look at this setup. Not exactly what you want but might give you some rough idea.
Play with Const color.

Re: Werkkzeug4 light

PostPosted: Friday, 09.May 2014, 11:07
by Skinnytorus
Basically, if you want to have different reflection colors, you can use specular or gloss channel with envi texture in there.

Re: Werkkzeug4 light

PostPosted: Friday, 09.May 2014, 11:13
by ikam
Yop

This can be fixed manually (in wait of a code fix)
In ModMaterial :
- get the PixelShader (EditShader = Pixel shader),
- click GetPS
- click CustomCode = enabled

Find the "phong shader" code section

get the line :

Code: Select all
col_specular += (pow(s,spec)*li*ls*tran)*speccol;


just add a col_light multiply at end of this line :

Code: Select all
col_specular += (pow(s,spec)*li*ls*tran)*speccol * col_light;


(repeat for each lights, there is a col_specular line for each light)

Re: Werkkzeug4 light

PostPosted: Friday, 09.May 2014, 11:31
by Skinnytorus
Thanks, man. It works. But once I enable shadows for all the lights. Diffuse lighting disappears... :(

Re: Werkkzeug4 light

PostPosted: Friday, 09.May 2014, 11:37
by ikam
You need to enable shadows before add any shader code modification, re-get the pixel shader code and re-add your modification.

If you change any paremeters or add/remove operators in modMaterial, sahder code will be different than the last time you did a GetPS, it's why you need update your code. Shadows works in the shaders (look at shadows sub section in code), so it modify the existing one.

Shader code modifications must be the last operation to do in the material creation process to be sure to have all parameters et co...

Re: Werkkzeug4 light

PostPosted: Friday, 09.May 2014, 11:47
by Skinnytorus
I see. Thanks. Haven't used this feature for too long now...

Re: Werkkzeug4 light

PostPosted: Friday, 09.May 2014, 15:06
by CybeREX
Thank you guys! It's work like a magic now! Very nice that we have ikam here!
Final question is - how to increase the ammount of specular color power on the reflection and not to change scene light? because its semms too dark now =)

Specular light work.jpg

Re: Werkkzeug4 light

PostPosted: Friday, 09.May 2014, 15:49
by ikam
as you are using a custom shader code now, phong parameters will be bypassed, so you can't play with its parameters to adjust power (specular and transparency).

so you have 2 choices :

1) disable custom shader, increase specular in phong operator, swith to csutom shader, rewrite "* col_light"

2) increase manually specular power in the shader code with a simple multiply factor at end of the same line, example :
col_specular += (pow(s,spec)*li*ls*tran)*speccol*col_light*2;

Re: Werkkzeug4 light

PostPosted: Friday, 09.May 2014, 16:07
by CybeREX
It's what I need!
Thank you very much for help ikam!