Advertisement Jump to content
Sign in to follow this  
Paul Griffiths

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.

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
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

 

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

Edited by paulgriffiths

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!