What's it like mixing parallax mapping?

Started by
1 comment, last by Paul Griffiths 7 years, 1 month ago

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

Advertisement

You can get very nice texture transitions by taking your heightmaps into account. See: http://gamedevs.org/uploads/quadtree-displacement-mapping-with-height-blending.pdf

You can get very nice texture transitions by taking your heightmaps into account. See: http://gamedevs.org/uploads/quadtree-displacement-mapping-with-height-blending.pdf

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:

heightmap.jpg

This topic is closed to new replies.

Advertisement