Jump to content

Detail texture shader


YouGroove
 Share

Recommended Posts

Usefull to make rocks variations just changing the detail map.

 

It can be used for walls , clothes micro details or anything else.

 

detailtexture.jpg

 

 

Material details :

- Rock general diffuse/color and/or baked AO

- Rock general normal map

Specular detail texture

Diffuse detail texture

 

detail_Slots3.jpg

 

 

Specular red channel from the material color picker is used to choose the detail maps multiplicator factor, play with it to adjust the UV scaling easily.

(The only specular material used for your 3D model is the specular map)

 

detail_Specular.jpg

 

 

Todo if i have time as i don't need it , use a detail normal map.

 

Have fun smile.png

diffuse+normal+specular+detail.zip

  • Upvote 5

Stop toying and make games

Link to comment
Share on other sites

Try replacing line 79 with this and see if you like it:

outcolor *= texture(texture3,ex_texcoords0*materialcolorspecular.r*20.0)*2.0;

 

Multiplying the detail texture lookup by two will ensure that the detail texture doesn't darken the image. This is what a Mod2X blend is, which was originally used with lightmapping. It means the detail map can lighten AND darken the surface, and solid gray has no effect. Usually these types of textures will have an average color 128,128,128, so they will have no effect at the lower-res mipmap levels. Also, you can use the "soften mipmaps" setting to make these fade out at lower mipmap resolutions. This will prevent your material from getting a repetitive appearance.

 

Detail.jpg

 

The textureQueryLod() might be able to be used in some interesting ways with this:

float mipmapLevel = textureQueryLod(myTexture, textureCoord).x;
fragColor = textureLod(myTexture, textureCoord, mipmapLevel);

  • Upvote 3

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

outcolor *= texture(texture3,ex_texcoords0*materialcolorspecular.r*20.0)*2.0;

 

Multiplying the detail texture lookup by two will ensure that the detail texture doesn't darken the image. This is what a Mod2X blend is, which was originally used with lightmapping.

Just some personnal taste :

It was too bright with material color full white and a directionnal light with intensity = 1 , because it did not respect original texture diffuse contrast or power. I find 1,3 or 1.5 lot better and not too overbright.

 

 

 

Also, you can use the "soften mipmaps" setting to make these fade out at lower mipmap resolutions. This will prevent your material from getting a repetitive appearance.

But you will loose all details benefits of a detail texture.

 

Anyway the shader is free anyone can customize it for their needs smile.png

Stop toying and make games

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