Jump to content

Multiple UV Maps in a single material?


El Newto
 Share

Recommended Posts

Hi,

I'm new to GLSL coding so I hope this isn't a silly question.

 

I am trying to use a second UV map for a diffuse detail texture on models imported from blender. I made a modified version of the diffuse+normal+specular shader by adding the extra code:

 

 

 

//Extra code added to vertex shader

//Attributes
in vec2 vertex_texcoords1;

//Outputs
out vec2 ex_texcoords1;
void main()
{
ex_texcoords1 = vertex_texcoords1;
}

//Extra code added to fragment shader

//Uniforms
uniform sampler2D texture4; //detail map

//Inputs
in vec2 ex_texcoords1;

void main(void)
{
outcolor += texture(texture4,ex_texcoords1);
}


 

This does not appear to work, this may be because the code is wrong or because the model does not get imported into leadwerks with more than one UV map.

 

If someone could enlighten me I would be very grateful.

 

Thanks, El

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...