Page 1 of 1

[done] CustomMaterial

PostPosted: Sunday, 15.September 2013, 12:21
by ikam
Yop

I updated the CustomMaterial op. It can now support time and transformations...

Re: CustomMaterial

PostPosted: Sunday, 15.September 2013, 12:45
by Skinnytorus
That is fantastic, man! At last! =D> =D> =D>
Can you post a quick example for reference?

Re: CustomMaterial

PostPosted: Sunday, 15.September 2013, 13:03
by ikam
Yes of course

Re: CustomMaterial

PostPosted: Sunday, 15.September 2013, 13:22
by Skinnytorus
As far as I can see, "time" is now a variable directly inside the pixel shader, right?
I tried to disconnect textures one by one and the result is confusing: from shader code I see that only one sampler 2d is used,
but no sooner that I disconnect a "useless" texture, the shader changes the picture...

Re: CustomMaterial

PostPosted: Sunday, 15.September 2013, 13:30
by ikam
time is not optimal yet, I will try to link it to modmisc (to bind others variable too)

for texture: look in the pixel shader (the second text)
sampler2D s0 : register(s2);

It's a bad example, because it is not really an explicit code but register(s2) mean the (third texture) (s0 .. 15)
sampler2D s0 <= you can name it as you want, it is just a variable that refer to the register(s2) (the third slot of textures)...

Re: CustomMaterial

PostPosted: Sunday, 15.September 2013, 13:39
by Skinnytorus
Yeah. It would be cool to control time from Modmisc via spline.
Ahhh. I see. In order for the shader to count input textures, some textures must be present at positions 0 and 1.

Re: CustomMaterial

PostPosted: Sunday, 15.September 2013, 13:52
by Skinnytorus
And I can't see how to change texture projection mode. Is that in model projection mode by default?

Re: CustomMaterial

PostPosted: Sunday, 15.September 2013, 14:13
by ikam
in custommatarial all is manual. You will need to write the code in the shader to do that.

Re: CustomMaterial

PostPosted: Sunday, 15.September 2013, 14:20
by Skinnytorus
OK. I see. Thanks.

Re: CustomMaterial

PostPosted: Sunday, 15.September 2013, 16:50
by ikam
great it works with a new "customMiscenv" operator, I'll send the update tonight ;)

Re: CustomMaterial

PostPosted: Sunday, 15.September 2013, 17:20
by Skinnytorus
Awesome! :)

Re: CustomMaterial

PostPosted: Sunday, 15.September 2013, 21:40
by ikam
Ok it's done.
Updated customMaterial and added A new operator (customMtrlEnv) to control shader variables (like ModMisc...)

and here an example

Re: CustomMaterial

PostPosted: Monday, 16.September 2013, 08:17
by Skinnytorus
Cool. I will check this out this evening.

Re: [done] CustomMaterial

PostPosted: Thursday, 19.September 2013, 15:54
by ikam
I updated CustomMaterial to simplify the vertex shader.
now code is (same used with CustomIpp) :

Code: Select all
void main
(
  in float3 in_pos : POSITION,
  in float2 in_uv0 : TEXCOORD0,
  out float2 out_uv0 : TEXCOORD0,
  out float4 out_pos : POSITION
)
{
  out_uv0 = in_uv0;
  out_pos = mul(float4(in_pos,1),mvp);
}

Re: [done] CustomMaterial

PostPosted: Thursday, 19.September 2013, 20:33
by Skinnytorus
Cool. Thanks :)