Jump to content
The Dark Mod Forums

Vertex Blending in DR


grayman

Recommended Posts

my poor English isn't responsible in this instance, 'sup' is a shortened version of "what's up"

Didn't know that. Sorry.

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

  • 3 weeks later...

Yes. Add

scale X,X

to the blends in the material file to make the texture appear X times smaller.

  • Like 1

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

Thanks. Gotta test the vertex blending with the Blender terrain.

 

The limitation of only two textures bugs me, but I suppose I can walk around it by first unwrapping the whole model, applying vertex paint, then cleaving the big model into smaller pieces and use different vertex colors when replacing the *BITMAP section for the models.

 

I that works, one could use an arbitrary amount of vertex blended textures in a seemingly singular terrain piece, which in reality is broken into separate models, each possessing only two vertex colors.

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

That's the idea ;)

 

However, you can use several shaders on one model.

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

  • 2 weeks later...

Yes. Add

scale X,X

to the blends in the material file to make the texture appear X times smaller.

 

Can you confirm this really works? I tried to change the scale, but it did not change anything.

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

Can someone post an example blend material with texture scaled down 5x? I don't seem to be able to do it. I played with the scale params, and the texture seems to change, but cannot understand how it changes. It is different looking, but it doesn't seem to be really changing its scale.

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

It should look something like this...

 

textures/example
{
  // first set
  {
  blend bumpmap
  map bump_1.tga
  scale 0.2, 0.2
  inverseVertexColor
  }
  {
  blend diffusemap
  map diff_1.tga
  scale 0.2, 0.2
  inverseVertexColor
  }
  {
  blend specularmap
  map spec_1.tga
  scale 0.2, 0.2
  inverseVertexColor
  }
  // second set
  {
  blend bumpmap
  map bump_2.tga
  scale 0.2, 0.2
  VertexColor
  }
  {
  blend diffusemap
  map diff_2.tga
  scale 0.2, 0.2
  VertexColor
  }
  {
  blend specularmap
  map spec_2.tga
  scale 0.2, 0.2
  VertexColor
  }
}

 

If it were me however, I'd forego editing the material shader. Just open the model in Blender and scale the UV coordinates up. One change versus a fair amount of text editing.

Link to comment
Share on other sites

Don'T use vertecColor/inverseVertexColor on the bumps.

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

If it were me however, I'd forego editing the material shader. Just open the model in Blender and scale the UV coordinates up. One change versus a fair amount of text editing.

I found the ambient lighting stage needs to be added though, eg.

 

//This texture is for the blend brush's that will intersect the patch/brush you want to blend your textures on
textures/common/blend
{
 description  "a brush texture that is used to blend two textures when used on a patch/brush via the .ase blend export script."
qer_editorimage textures/common/blend.tga
noshadows
}
//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
{
blend diffusemap						 //blend mode
map textures/darkmod/nature/grass/short_dry_grass_dark  //name of the image to apply
VertexColor					    //apply vertex coloring
}
// TDM Ambient Method Related
{		
 if (global5 == 1)
 blend add  
 map    textures/darkmod/nature/grass/short_dry_grass_dark
 scale 1,1								    //decrease size by factor of 'x' in both x- and y-direction
//rotate 90								  //rotate of the texture, as this can't be done in DR
 red    global2
 green   global3
 blue   global4
 VertexColor
}		
{		
 if (global5 == 2)
 blend add  
 program ambientEnvironment.vfp
 vertexParm  0  1, 1, 1, 1  // UV Scales for Diffuse and Bump
 vertexParm  1  1, 1, 1, 1 // (X,Y) UV Scale for specular
 vertexParm  2  global2, global3, global4, 1

 fragmentMap  0  cubeMap env/gen1  
 fragmentMap  1  textures/darkmod/nature/grass/short_dry_grass_local   // Bump  
 fragmentMap  2  textures/darkmod/nature/grass/short_dry_grass_dark   // Diffuse 
 fragmentMap  3  _black   // Specular
 VertexColor
}
// 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
}
// TDM Ambient Method Related
{
 if (global5 == 1)
 blend add
 map    textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour
 scale 1,1								    //decrease size by factor of 'x' in both x- and y-direction
 rotate 90								   //rotate of the texture, as this can't be done in DR
 red    global2
 green   global3
 blue   global4
 inverseVertexColor
}
{
 if (global5 == 2)
 blend add
 program ambientEnvironment.vfp
 vertexParm  0  1, 1, 1, 1  // UV Scales for Diffuse and Bump
 vertexParm  1  1, 1, 1, 1 // (X,Y) UV Scale for specular
 vertexParm  2  global2, global3, global4, 1
 fragmentMap  0  cubeMap env/gen1
 fragmentMap  1  textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour_local   // Bump
 fragmentMap  2  textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour   // Diffuse
 fragmentMap  3  _black   // Specular
 inverseVertexColor
}
}

Link to comment
Share on other sites

I wouldn't mind seeing that changed now that we have the ability to. The image textures to be used for ambient lighting are already specified elsewhere in a material declaration. By cutting out the manual copy paste work you'd reduce the length of nearly every TDM material shader to one third it's size and they'd be less intimidating for newcomers to work with.

Link to comment
Share on other sites

I'm practically positive that the second stage:

 


{
 if (global5 == 2)
 blend add
 program ambientEnvironment.vfp
 vertexParm  0  1, 1, 1, 1  // UV Scales for Diffuse and Bump
 vertexParm  1  1, 1, 1, 1 // (X,Y) UV Scale for specular
 vertexParm  2  global2, global3, global4, 1
 fragmentMap  0  cubeMap env/gen1
 fragmentMap  1  textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour_local   // Bump
 fragmentMap  2  textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour   // Diffuse
 fragmentMap  3  _black   // Specular
 inverseVertexColor
}

 

is no longer valid for TDM 2.0 as the Enhanced Ambient was set to use Rebb's shader rather than JC Dentons.

 

I suppose you could be cruel to low-end folks and just include:

 


{
 if (global5 == 1)
 blend add
 program ambientEnvironment.vfp
 vertexParm  0  1, 1, 1, 1  // UV Scales for Diffuse and Bump
 vertexParm  1  1, 1, 1, 1 // (X,Y) UV Scale for specular
 vertexParm  2  global2, global3, global4, 1
 fragmentMap  0  cubeMap env/gen1
 fragmentMap  1  textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour_local   // Bump
 fragmentMap  2  textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour   // Diffuse
 fragmentMap  3  _black   // Specular
 inverseVertexColor
}

 

rather than the first low cost ambient stage and allow folks to choose between them...

 

The one question I have is about the the "dynamic" ambient which still appears to use this shader? (it looks like it anyway)...

Not sure if what happens if you don't include the second stage. Maybe a little experiment to test this tonight.

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

I'm practically positive that the second stage:

is no longer valid for TDM 2.0 as the Enhanced Ambient was set to use Rebb's shader rather than JC Dentons.

 

That's what I was told, and I hope it's correct, as I have not been including them in any new materials for a while.

Link to comment
Share on other sites

Here is the full example:

 


//This texture is for the blend brush's that will intersect the patch/brush you want to blend your textures on
textures/common/blend
{
 description  "a brush texture that is used to blend two textures when used on a patch/brush via the .ase blend export script."
qer_editorimage textures/common/blend.tga
noshadows
}
//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
{
blend diffusemap                                                 //blend mode
map textures/darkmod/nature/grass/short_dry_grass_dark  //name of the image to apply
VertexColor                                         //apply vertex coloring
}
// TDM Ambient Method Related
{               
 if (global5 == 1)
 blend add  
 map    textures/darkmod/nature/grass/short_dry_grass_dark
 scale 1,1                                                                 //decrease size by factor of 'x' in both x- and y-direction
//rotate 90                                                               //rotate of the texture, as this can't be done in DR
 red    global2
 green   global3
 blue   global4
 VertexColor
}               

// 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
}
// TDM Ambient Method Related
{
 if (global5 == 1)
 blend add
 map    textures/darkmod/stone/cobblestones/blocks_mixedsize02_multicolour
 scale 1,1                                                                 //decrease size by factor of 'x' in both x- and y-direction
 rotate 90                                                                //rotate of the texture, as this can't be done in DR
 red    global2
 green   global3
 blue   global4
 inverseVertexColor
}

}

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

  • 1 year later...

Is there an up-to-date text written tutorial how to do this vertex blending terrain?

 

I tried this:

https://www.youtube.com/watch?v=jZm-XlOpuyo

using the files given here: http://forums.thedarkmod.com/topic/12554-tutorials-in-darkradiant/?p=321015

 

But it seems be old and does not work:

Bikers tutorial script doesn't have "Level of blending in percent" parameter. What number should I use here?

I followed the tutorial with the script that comes with DR 2.0.2, but my end product is just grass and does not have vertex blending.

 

So, how to do vertex blended terrain nowadays?

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

Link to comment
Share on other sites

  • 2 weeks later...

 

Nope. Just doesn't work.

 

Here:

1) I made a terrain patch. I gave it the right texture. I put brushes with blend-texture on it.

lvFZTpc.png

 

2) I choose the whole mess and use the following parameters in the blended .ase export script.

mCIUqH0.png

 

3) Result is not what I wanted. The blending is applied like a blob on the center, and not according to the blend-brushes. What also sucks is that the blend-brushes are invisibly present on the terrain model and solid. They block the way and can be climbed onto.

KaDbgj6.jpg

 

How do I do this correctly? I just don't get it.

 

Thanks!

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

You are using an (very) outdated version of the script. Download the one in the linked thread and place it in the proper folder.

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

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

    • nbohr1more

      Was checking out old translation packs and decided to fire up TDM 1.07. Rightful Property with sub-20 FPS areas yay! ( same areas run at 180FPS with cranked eye candy on 2.12 )
      · 2 replies
    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 3 replies
    • 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.
      · 7 replies
    • 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
×
×
  • Create New...