Jump to content
The Dark Mod Forums

Vertex Blending in DR


grayman

Recommended Posts

I'm working on blending dry cobblestones with snowy cobblestones along a single edge.

 

Is the VertexColor material the one that gets painted on the patch? In blend.map, this would be the grass.

 

And then the blend brushes are placed inside the patch tesselations that are to be blended from the VertexColor material at the outer tesselation edges, to the inverseVertexColor material at the center of the tesselations?

 

Biker, what's missing from blend.map is the original patch and blend brushes. It would be helpful if we could see what those look like before the model is made. For example, I could've answered my first question if these were present.

 

Never mind, I see them.

 

Thanks.

Link to comment
Share on other sites

What is a single-edge blend.

 

Again. The texture using the vertex coloring must be put on your patch or brush or whatever you want the blendeffect on. The blend brushes, thus meaning those textured with common/blend, are there to mark the vertices which should use the second texture, which you've marked with inverseVertexColor. All vertices inside the AABB's of said brushes will use the second one.

 

Blending takes place on all tris, which have both vertices colored with 1 1 1 (the default value) and 0 0 0 (the value applied to the vertices inside the blend brushes).

 

I really have no idea how to make this more clear. :(

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

What is a single-edge blend.

 

I have an overhang. Under the overhang, the ground texture is one thing. Beyond the overhang, the ground texture is different. Rather than a 2-edge blend (a stone path across a lawn), this is a single-edge blend.

 

Again. The texture using the vertex coloring must be put on your patch or brush or whatever you want the blendeffect on.

 

So the patch gets the blended texture or the texture defined inside the blended texture that is marked VertexColor? Biker's demo uses the latter, but it's not clear from the demo or from how you're describing it.

 

The blend brushes, thus meaning those textured with common/blend, are there to mark the vertices which should use the second texture, which you've marked with inverseVertexColor. All vertices inside the AABB's of said brushes will use the second one.

 

Ah, okay. Biker's demo wasn't clear that the script uses vertexes rather than tris. So the blend brushes must envelope the vertexes at which the second texture is used. So between two vertexes that are enveloped, the second texture is used, and between one vertex that uses one color and another vertex that uses the other color, the script blends from one texture to the other, along the line between the vertexes.

 

I really have no idea how to make this more clear. :(

 

That's okay. I'm sure questions and answers will reveal all.

Link to comment
Share on other sites

Got it working.

 

I was able to create a single transition from a snowy cobblestone street to a dry cobblestone street, which was the objective.

 

Very nice.

 

I just needed the idiot's guide hand-holding to reach full awareness.

 

I am now one with blended patches.

 

Thanks!

Link to comment
Share on other sites

Glad you got it working. :)

 

This should make your already great looking FM's even more delicious to the eye.

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

Right then, Obs/Gman - give me some bullet points of what I need to change when i redue my video tut.

 

I'm tweaking my model to put the blend right where I want it. I'll make a couple suggestions when that's done and I'm sure I fully understand what's going on.

 

I do know you can omit the comment about the script needing to center the model at 0,0,0. As Obs mentioned above, you can center it when you export the ASE, using the "Center objects at 0,0,0 origin" checkbox.

Link to comment
Share on other sites

Here are the key points I was missing, but eventually got with Obs's answers to my questions, plus re-reading his OP on the script.

 

These are relevant to using a patch, but I suppose they also apply to brush faces.

 

- A tri whose 3 vertexes are all outside a blend brush will use 100% of the "VertexColor" texture (texture 1).

 

- A tri whose 3 vertexes are all inside a blend brush will use 100% of the "inverseVertexColor" texture (texture 2).

 

- A tri that has vertexes both inside and outside a blend brush will get painted with a blend of the two textures.

 

- When you import the model in DR, DR doesn't display the blend. You'll see the blend when you run the mission. [This one threw me for the longest time. I thought I was doing something wrong, since we normally see correct painting of models when we import them in DR. But DR doesn't understand the blending info in the ASE file?]

 

- The patch should be textured with the blended texture (not texture 1 or texture 2).

 

 

 

@Obs, please correct anything I said above that's wrong.

Link to comment
Share on other sites

Another question.

 

How are the bumpmaps for the two textures defined?

 

In Biker's material file, no bump map is given for the grass, and the bumpmap for the stones is defined this way:

 


// TDM blend Method Related - author Obsttorte

bumpmap textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour_local
{
 blend diffusemap							//blend mode
 map textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour  //name of the image to apply
 inverseVertexColor						  //apply vertex coloring
}

 

How does the script know to apply two different bumpmaps for the two textures?

 

This wasn't a problem for my previous blend of dry and snowy cobblestone, because they both use the same bumpmap.

 

But now I'm working on dirt->snowy grass, which have different bump maps.

Link to comment
Share on other sites

Check again as you'll find there is a bumpmap entri for the grass

 

//This is the definition for the two textures you want to blend

// TDM blend Method Related - author Obsttorte

textures/blend/grass_stone_blend
{
surftype15
description "grass & stone blend texture"

bumpmap textures/darkmod/nature/grass/short_dry_grass_local

Link to comment
Share on other sites

Regarding the bumpmaps, I can't really tell you why you don't have to "color" them. I found this syntax in an old thread in this froum. The only thing I know for sure here is that it is important that the bumpmaps come before the diffusemaps etc.. they are belonging to, or the wrong bumpmaps will be used. So I guess the bumpmaps are auto-assigned to the correct diffuses or whatever. Actually, I've never tried out what happens if I add "colors" to them as well.

 

Here are the key points I was missing, but eventually got with Obs's answers to my questions, plus re-reading his OP on the script.

 

These are relevant to using a patch, but I suppose they also apply to brush faces.

 

- A tri whose 3 vertexes are all outside a blend brush will use 100% of the "VertexColor" texture (texture 1).

 

- A tri whose 3 vertexes are all inside a blend brush will use 100% of the "inverseVertexColor" texture (texture 2).

 

- A tri that has vertexes both inside and outside a blend brush will get painted with a blend of the two textures.

 

- When you import the model in DR, DR doesn't display the blend. You'll see the blend when you run the mission. [This one threw me for the longest time. I thought I was doing something wrong, since we normally see correct painting of models when we import them in DR. But DR doesn't understand the blending info in the ASE file?]

 

- The patch should be textured with the blended texture (not texture 1 or texture 2).

 

 

 

@Obs, please correct anything I said above that's wrong.

Everything you said is correct. I may add that the formulation "A tri that has vertexes both inside and outside a blend brush will get painted with a blend of the two textures" is a bid blur. There is not one blend. But maybe you don't meant that.

 

Regarding the DR preview. The "texture" shown in DR is not the one actually defined by the material shader, it is the preview image. At least if you use the normal rendering mode (without lighting). I never use the full preview mode, where lights are rendered as well, so I can't say much about that one, though.

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

Everything you said is correct. I may add that the formulation "A tri that has vertexes both inside and outside a blend brush will get painted with a blend of the two textures" is a bid blur. There is not one blend. But maybe you don't meant that.

 

Right. I meant that blending occurs, but since I don't know the algorithm, I didn't want to speculate on how it was done.

Link to comment
Share on other sites

I don't know the algorithm either, but I guess it is just a simple additive blend.

 

I thought about the different use of bumpmaps in those shader definition. I guess, that due to the fact that bumps store height information encoded in colors, it may not be possible to easely blend two bump maps together in a way, that the result fits the result of the visible blending. In this case, I could imagine that the engine just skips bump mapping on all tris that needs blending, thus meaning that at least two of the vertices store different vertex color informations. I will test that later on.

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

So "Sup" means "Why the unhapp smiley..."!? Is there actually a dictionary: Bikerdude - English :: English - Bikerdude :P

 

However, I don't really see a reason to move the posts to another thread. I mean, I opened up a thread for the blending stuff, than you posted a tut video in a different thread. Than grayman opened up another thread and now we should start moving some of the stuff back in the first thread.

 

This is more then confusing :blink:

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

  • So "Sup" means "Why the unhapp smiley..."!?
  • This is more then confusing :blink:

  • my poor English isn't responsible in this instance, 'sup' is a shortened version of "what's up"
  • the reason the thread was moveed was because the video tut thread was getting cluttered up with chat that should have been in a separate thread or your original blending thread.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recent Status Updates

    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 1 reply
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
    • nbohr1more

      Looks like the "Reverse April Fools" releases were too well hidden. Darkfate still hasn't acknowledge all the new releases. Did you play any of the new April Fools missions?
      · 5 replies
×
×
  • Create New...