Jump to content

View more

Image of the Day

Adding some finishing touches...
Follow us for more
#screenshotsaturday #indiedev... by #MakeGoodGames https://t.co/Otbwywbm3a
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

Sign up now

Dynamic Texture Blending

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 riuthamus   Moderators   


Posted 11 February 2013 - 11:25 AM

I have no clue of the real name for this so I just made up something that seemed to fit. BTW skip to 36 min in, to see what i am talking about



I was searching through polycount the other day and found this video as well as this topic and it really struck me as something that we should all have the option/access to. Does anybody know how this tech is done?




Any guidance would be greatly appreciated as we are attempting to try and add in some form of blending. This would be really nice to have for base blocks that connect to the ground or cliffs!

Edited by riuthamus, 11 February 2013 - 11:26 AM.

#2 blackpawn   Members   


Posted 11 February 2013 - 02:11 PM

that's cool!


so it looked like as they moved the props around the map the projected textures updated nicely.  i couldn't tell for sure but looked like it wasn't just using one of the terrain tiles but had blending between the tiles as well.  so assuming the terrain is 2D XY + height the shader for the props would need to transform from its world space XY positions to the UV coordinates of the terrain block its sitting on then run the terrain shader to figure out the color to blend to (likely sampling a blend weights texture and a terrain tile sheet or 4 terrain tile textures).


seems that would work well for surfaces that like the terrain are pretty horizontal. to handle things like vertical surfaces perhaps using triplanar blending would be needed.  


could be possible to do this in screen space as well with an inferred or deferred pipeline.  like if the material shader wants to blend with terrain it could do the mapping from world position to terrain UV then sample virtual texture/megatexture/clipmap for the terrain blend map and tiles texture array and again triplanar map to handle non horizontal surfaces.

#3 BGB   Members   


Posted 11 February 2013 - 02:19 PM

special material property for relevant geometry (mostly to indicate to use this feature);
when used, it will proceed to try to look up the texture and texture coords of the nearest piece of geometry (probably the harder part);
faces near these vertices will be duplicated, drawing an alpha-blended version on top, probably calculating the alpha based on the distance from the intersecting face.

another possible strategy could involve CSG clipping and deformation:
find all intersecting polys between the object and the ground;
clip these faces against each-other;
allow the faces to pull on any newly created vertices (to smooth out edges), while keeping original vertices anchored;
make alternate versions of each poly, one set using the original textures, the other using the opposite sides' textures (probably per-edge);
for this second set of polys, use alpha blending or similar, and possibly subtract this alpha from the first-level's alpha (depends some on how lighting/... is performed).

#4 CC Ricers   Members   


Posted 11 February 2013 - 05:41 PM

With what was said previously, using the extents of an AABB could aid in determining texture coordinates in respect to the terrain. Take the XZ coordinates of the four sides and get the UV values this way. With the object's height, then you just set a coefficient for the blend distance. A large coefficient will have the grass blending all the way to the top.

New game in progress: Project SeedWorld

My development blog: Electronic Meteor

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.