ModMaterial (customize shader)

ModMaterial (customize shader)

Postby ikam » Sunday, 13.October 2013, 04:49

Hi

I need a tester for an extrem new cool feature :)

I have modified modmaterial operator. You can now edit the final shader code to modify as you want the shader or add special fx like in custommaterial :)

use this prototype and read comments in example file.

thanks
You do not have the required permissions to view the files attached to this post.
ikam
Operator
Operator
 
Posts: 911
Joined: Friday, 14.October 2011, 13:00
Location: France

Re: ModMaterial (customize shader)

Postby Skinnytorus » Sunday, 13.October 2013, 13:13

OK. I'll have a look. I don't understand shaders that much, but I'll give it a go ;)
Skinnytorus
Operator
Operator
 
Posts: 1300
Joined: Monday, 06.February 2012, 17:46

Re: ModMaterial (customize shader)

Postby Skinnytorus » Sunday, 13.October 2013, 13:48

Weird behaviour. Have a look.
You do not have the required permissions to view the files attached to this post.
Skinnytorus
Operator
Operator
 
Posts: 1300
Joined: Monday, 06.February 2012, 17:46

Re: ModMaterial (customize shader)

Postby ikam » Sunday, 13.October 2013, 15:44

If you have lights : You need to modify the shader only when you have shown your scene with lights. (2nd comment)

1. render your scene in the final stage of your stack
2. press Get the the shader code from modmaterial only at this moment
3. add your custom code and enable custom code and it is ok.

(lights modify initial materials of objects to add light and shadows instructions it is why you need to get the code only at this moment)
ikam
Operator
Operator
 
Posts: 911
Joined: Friday, 14.October 2011, 13:00
Location: France

Re: ModMaterial (customize shader)

Postby Skinnytorus » Sunday, 13.October 2013, 16:54

Thanks. Now it's working, but there's too much light now. Why is that?
You do not have the required permissions to view the files attached to this post.
Skinnytorus
Operator
Operator
 
Posts: 1300
Joined: Monday, 06.February 2012, 17:46

Re: ModMaterial (customize shader)

Postby ikam » Sunday, 13.October 2013, 17:06

change += to *= for the last line. i forgot to update the script code in the comment. :)

Code: Select all
o_color *= result;
ikam
Operator
Operator
 
Posts: 911
Joined: Friday, 14.October 2011, 13:00
Location: France

Re: ModMaterial (customize shader)

Postby Skinnytorus » Sunday, 13.October 2013, 17:19

Yey! It's now working. Thanks. Since I'm not into shader coding, I can't see much potential in this feature, but overall, this is awsome that people can edit shaders on the fly :). Another leap forward. Congrats! =D>
Skinnytorus
Operator
Operator
 
Posts: 1300
Joined: Monday, 06.February 2012, 17:46

Re: ModMaterial (customize shader)

Postby ikam » Sunday, 13.October 2013, 17:32

potential is huge :p

You can add all you want to complete modmaterial missing features. for example you can add fx (remebber those one used in customipp like tunell, plasma metaball etc ) only applied to the diffuse texture or emissve or any others... For example last new mod operators (sinwas and twist ) could be added manually here. So you can code what you want.

It is a mix with custommaterial and modmaterial, but instead of writing all the shader you can only complete it or modify as you want the modmaterial.

It is also a sandbox to test or debug some next mod feeatures before to add them in hard with operators
ikam
Operator
Operator
 
Posts: 911
Joined: Friday, 14.October 2011, 13:00
Location: France

Re: ModMaterial (customize shader)

Postby Skinnytorus » Sunday, 13.October 2013, 17:36

Very well. That is why I'm glad it's there. As for the potential, I meant myself (personally). I'm totally blind to code ](*,)
Skinnytorus
Operator
Operator
 
Posts: 1300
Joined: Monday, 06.February 2012, 17:46

Re: ModMaterial (customize shader)

Postby ikam » Sunday, 13.October 2013, 17:48

:) Honestly I think this is probably the best feature with materials in wz =)
ikam
Operator
Operator
 
Posts: 911
Joined: Friday, 14.October 2011, 13:00
Location: France

Re: ModMaterial (customize shader)

Postby Skinnytorus » Sunday, 13.October 2013, 17:58

Good for you :)
Skinnytorus
Operator
Operator
 
Posts: 1300
Joined: Monday, 06.February 2012, 17:46

Re: ModMaterial (customize shader)

Postby nikitos75 » Saturday, 19.October 2013, 20:18

sorry, Ikam, can I make real reflection with it?
nikitos75
Partikelmeister
Partikelmeister
 
Posts: 85
Joined: Monday, 04.April 2011, 19:27

Re: ModMaterial (customize shader)

Postby ikam » Sunday, 20.October 2013, 08:40

You can use the shader of the water reflection example, yes. didn't test it, but should work.
Real reflection for a non planar mesh is always the same : env reflection (supported) or raytracing (not implanted)
ikam
Operator
Operator
 
Posts: 911
Joined: Friday, 14.October 2011, 13:00
Location: France

Re: ModMaterial (customize shader)

Postby nikitos75 » Sunday, 20.October 2013, 18:20

Ikam, can you, please, implement:
1. Possibility to add unlimited number of lights to scene ( now only 8)
2. Add " multiply mesh with light" like was in wz3
nikitos75
Partikelmeister
Partikelmeister
 
Posts: 85
Joined: Monday, 04.April 2011, 19:27

Re: ModMaterial (customize shader)

Postby ikam » Sunday, 20.October 2013, 19:27

there is 8 lights per material, but you can have multiple modlight per scene, so infinite number of light in a scene...

But yes multiplying lighting should be nice and easier, maybe a ModLightMultiply operator, I will study that.

You also can use CustomMaterial (or edit shader of modmaterial) and add your own lighting, multiply works fine is this case.

edit : another idea, maybe a light operator to stack to the modmaterial this will add a light per object. multiplying should in this case too. I will try that too.
ikam
Operator
Operator
 
Posts: 911
Joined: Friday, 14.October 2011, 13:00
Location: France


Return to Development and contribution



Who is online

Users browsing this forum: No registered users and 8 guests

cron