Jump to content

Material for second UV channel


Michael Betke
 Share

Recommended Posts

Write a shader that makes use of the second uv set.

 

The

varying vec2 texcoord1;

value is already calculated in the default .vert shader, so you only need to modify the pixel shader.

 

Just add another texture lookup somewhere and use that color however you like.

E.g.

uniform sampler2D TEX_PRECALCLIGHT;
...
precalculatedLighting = texture2D(TEX_PRECALCLIGHT,texcoord1);
...
diffuse *= precalculatedLighting;

 

And the wrapper .frag shader defines TEX_PRECALCLIGHT as texture1 or so.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...