• 12
• 10
• 10
• 13
• 10

# Specular Maps - I'm doing it wrong

This topic is 1250 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi D3D experts,

I've recently tried to move from a single specular intensity value to using a specular map, and it doesn't look good.

This is what a single specular intensity value looks like:

Pretty smooth, as you'd expect. This is what it looks like after I try and control the specular intensity with a specular map:

Not good. Here's what the specular map looks like:

And here's my HLSL (old code commented out). Specular color was sampled from the specular map. I just noticed that I needlessly sample into a float3 and then just use the x value, but I think that makes no difference:

// Blinn specular.
toEye = normalize(toEye);
float3 halfway = normalize(toEye + toLight);
float nDotH = saturate(dot(halfway, material.Normal));
//finalColor += pow(nDotH, material.SpecularPower) * material.SpecularIntensity;
finalColor += pow(nDotH, material.SpecularPower) * material.SpecularColor.x;


Any way I can get smooth specular highlights again whilst gaining the ability to only apply the highlights to certain parts of the textured model?

##### Share on other sites

Do you have mipmaps and bilinear filtering enabled for your specular map?

##### Share on other sites

Bilinear filtering yes, mipmaps no! When I started generating specular maps in ShaderMap2 I was remembering to generate mipmaps in the DX Tex Tool, but I'd forgotten that step recently. Generating mipmaps for the specular map solved the problem!

Thanks very much MJP, much appreciated.