Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Supposedly in a scenario there are, among other things, a tarmac strip and a meadow. The tarmac has an asphalt texture and its model is a triangle strip long that might bifurcate at some point into other tinier strips, and suppose that the meadow is covered with grass.

What can be done to make the two graphical entities seem less cut out from a photo and just pasted one on top of the other at the edges? To better understand the problem, picture a strip of asphalt and a plane covered with grass. The grass texture should also "enter" the tarmac strip a little bit at the edges (i.e. feathering effect).

My ideas involve two approaches:

  • put two textures on the tarmac entity, but that involves a serious restriction in how the strip is modeled and its texture coordinates are mapped

or

  • try and apply a post-processing filter that mimics a bloom effect where "grass" is used instead of light. This could be a terrible failure to achieve correct results.

So, is there a better or at least a more obvious way that's widely used in the game dev industry?

UPDATE:

This is a conceptual question, I do not require a specific shading language or framework. In real life, I use Cg with Ogre for rendering experiments. If I supply two textures and two different texture coordinate sets for the tarmac entity, I can analyze the second texture coordinate set in the fragment shader and do some blending depending on the .y component of the uv pair, but that requires the artist to hand-craft every asphalt/tarmac runway in the scenario and it looked to me that this is probably the wrong way to tackle the issue.

share|improve this question
1  
You need a workflow and tools that allow to make designers life easy in the first place. When the road gets placed, said blending should be applied automatically or with a least effort (f.e. "blend through gravel/blend through sand" switch). Do not hardcode/bake the blends in case road needs to be moved. –  Krom Stern Sep 27 '12 at 18:34
    
Is the grass just a 2d texture, or something more complicated? –  Jari Komppa Sep 27 '12 at 18:51
    
@KromStern that's a very good remark, I'm also interested in this idea you mention. Do you suggest to store a details/blendmap texture and through that decide which particular terrain texture to use at the edges of the road strip? As the OP suggested, blending at the edges could be done based on the uv components, provided that attribute is cleverly mapped. If this is not what you had in mind, do you know of any way a "road" strip can be made aware what texture it has in its vicinity? (this sounds like another of the OPs suggestions, i.e. some sort of blur/bloom, but that's too expensive). –  teodron Sep 27 '12 at 20:37

1 Answer 1

Multi-texturing.

Add a weight to each texture by adding extra texcoords in a shader to your vertex declaration.

You haven't supplied what language you'd like this in (or even whether it's a programming question, but that's an assumption on my part), but Riemers provides a good tutorial using C# and XNA and also explains the concept here.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.