# What's it like mixing parallax mapping?

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

## Recommended Posts

'm starting to create terrain by heightmap, and am going to use different textures at different heights, question I have is what's it like mixing parallax mapping? Does it look good?

Thanks.

##### Share on other sites

Thanks, I read it but does not give much code.

I'm going to be using this code to decide which textures to blend:

http://www.mbsoftworks.sk/index.php?page=tutorials&series=1&tutorial=24

   const float fRange1 = 0.15f;
const float fRange2 = 0.3f;
const float fRange3 = 0.65f;
const float fRange4 = 0.85f;

if(fScale >= 0.0 && fScale <= fRange1)vTexColor = texture2D(gSampler[0], vTexCoord);
else if(fScale <= fRange2)
{
fScale -= fRange1;
fScale /= (fRange2-fRange1);

float fScale2 = fScale;
fScale = 1.0-fScale;

vTexColor += texture2D(gSampler[0], vTexCoord)*fScale;
vTexColor += texture2D(gSampler[1], vTexCoord)*fScale2;
}
else if(fScale <= fRange3)vTexColor = texture2D(gSampler[1], vTexCoord);
else if(fScale <= fRange4)
{
fScale -= fRange3;
fScale /= (fRange4-fRange3);

float fScale2 = fScale;
fScale = 1.0-fScale;

vTexColor += texture2D(gSampler[1], vTexCoord)*fScale;
vTexColor += texture2D(gSampler[2], vTexCoord)*fScale2;
}
else vTexColor = texture2D(gSampler[2], vTexCoord);



If I generate each TexCoord by individual parallax mappings will it look ok at different angles? Will it mix well?

Or is there more I have to do?

This is parallax mapping I have with just one texture:

Edited by paulgriffiths

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 13
• 9
• 15
• 14
• 46
• ### Forum Statistics

• Total Topics
634060
• Total Posts
3015300
×