Jump to content
The Dark Mod Forums

Texture Creation Suggestion: The Generation Leap


J.C.Denton

Recommended Posts

Oh, now I've got a clear idea of what you wanted to do.

 

The blend modulate works if you want a decal to blend with destination surface and to match with it's lighting.

 

I'll like to try to get the desired result if you could provide me with your test map, materials, textures etc, before writing the engine off on this.

Link to comment
Share on other sites

You're the best! :) Here you go...

 

http://www.dramtheth...s/alphatest.pk4

 

Tried a lot of different combination and even wrote a shader to do the blending, but to no avail. Doom 3 does provide a rather crude lit alpha blended surfaces, wherein the opacity of the surface is determined by the lighting itself. I mean, full bright is fully opaque, completely dark is totally transparent.

 

However, the problem that you are facing does necessarily requires alpha blending on lit surfaces. You can use vertex blending to achieve the kind of surface blending you want. Make the floor and the elevated geometry the same mesh in any third party software (3dsMax for instance). paint the vertices of floor as black and the elevated surfaces as white. Export your geometry and the vertex color will be used by doom 3. Then write a material for this surface based on following format :

 

shaderDemos/vertexBlend
{
{
	blend bumpmap
	map		addnormals( textures/base_wall/bluetex3e_local.tga, heightmap( textures/base_wall/bluetex3ebmp.tga, 6 ) )
}
{
	blend diffusemap
	map		textures/base_wall/dlongwall_d.tga
	vertexColor
}
{
	blend diffusemap
	map		textures/base_wall/redtex1dif.tga
	inverseVertexColor
}
}

 

OR

 

haderDemos/blendBumpMap
{
// blended part

{
	blend bumpmap
	map		heightmap (textures/rock/skysand1_bmp.tga, 4)
	// note that you do NOT put vertexColor on the bumpmap
}
{
	blend diffusemap
	map		textures/rock/skysand1_d.tga
	vertexColor
}
{
	blend specularmap
	map		textures/rock/skysand1_s.tga
	vertexColor
}

// inverse blended part

{
	blend	bumpmap
	map		models/seneca/textures/factoutwall1_local.tga
}
{
	blend	diffusemap
	map		models/seneca/textures/factoutwall1_d.tga
	inverseVertexColor
}
}

 

You'll get a surface that blends textures between the border where vertices are black on one side and white on the other. Sorry, I couldn't do it myself. I am not good at modeling at all.

Link to comment
Share on other sites

Ok. What a shame. Stuff like this would be useful in many places. We've already setup a few materials with the aplhatest keyword, because alphablending does not work properly... :mellow: I was just thinking, maybe we could do something about it. And doing vertex blending for every small ash-heap we put in a fireplace is just tedious.

Link to comment
Share on other sites

Ok. What a shame. Stuff like this would be useful in many places. We've already setup a few materials with the aplhatest keyword, because alphablending does not work properly... :mellow: I was just thinking, maybe we could do something about it. And doing vertex blending for every small ash-heap we put in a fireplace is just tedious.

 

The renderer code is not at all exposed in SDK. Making lit alpha blended surfaces would require a complete re-arrange of current rendering order. There needs to be a lot of feasibility study done (might take a man-month or two) to evaluate whether we can have our custom render path with what's exposed. I think that there's a fair chance of this being possible. We can do a lot of things faster and good looking in addition to feature you wanted.

Link to comment
Share on other sites

So if it blends with the other texture on the model won't that produce what we want? That is, the heap is ash texture and the floor part of the model is nodraw. They are vertex blended together on the model. Does not the ash texture fade out and the nodraw fade in at the crossover point? And since nodraw shows nothing then if that patch is resting on a stone floor will the stone show through where the nodraw is?

Link to comment
Share on other sites

Good point. But the part where the ash heap starts fading, it will start fading to darker shade until it reaches black and not the transparent background.

 

Edit:

But that also means we can try mapping _currentRender with the inverseVertexColor part. This approach, if worked, might cause particles to not draw over blended part since stages referring to _currentRender are always drawn in the end and thus any particles or other alpha blended stuff which is overlapping this portion will be overwritten by the vertexblend.

Link to comment
Share on other sites

Wahoo! It friggin' works! So this means we could make at least some generic models of grass path edges that can be laid half over grass and half over any stone or dirt. Heaps of dirt or ash that can be stood on any surface. Snow edge on any surface.

Link to comment
Share on other sites

Wahoo! It friggin' works! So this means we could make at least some generic models of grass path edges that can be laid half over grass and half over any stone or dirt. Heaps of dirt or ash that can be stood on any surface. Snow edge on any surface.

 

Screenshots or it didn't happen! :D

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Ahh - not quite. I was misunderstanding the model. I'm seeing translucent grass alright but translucent all over. I though I was looking at a translucent overlap but it should be solid grass then fading to transparent. What I'm seeing is translucent all over. It should work as an overlap laid across a normal grass and stone boundary but needs more testing.

 

I need a different model. This is the archery ground from the trainer. I need something more flat. Then see if there is any other variation can be made in the shader def.

Link to comment
Share on other sites

Clearly not going to work. The best I can suggest is this:

 


  •  
  • A series of model panels of various generic shapes are made: long rectangles, curves, a couple of heaps, etc each with two template textures; can be grass and stone by default say. Let's say 8 panels. Even two would be useful.
  • Multiply the above by say 8 using different texture pairs. Even one texture pair would be useful.
  • 8 material defs for above as default texture combos. Even one would be useful.

 

Application 1:


  •  
  • For a single application, say a snow map and the mapper wants various edges of fading snow onto 5 types of cobbles and nothing else he takes the 8 material defs and changes 5 of them to say snow/cobble1, snow/cobble2 etc.
  • He creates the map with snow directly against the cobbles allowing for where he will expect to put panels.
  • He places the appropriate panel models to overlap.
     

Application 2:


  •  
  • The mapper just wants an ash heap in his fireplace fading onto square stone tiles.
  • He take 1 material def and changes it (may already be an ash default)
  • He uses only one of the heap models from the 64 models available (the one that is using his material def.)

 


  •  
  • Each model group might be numbered, eg, Group 3 names might be eg, blend_rect_long3.ase, blend_heap_big3.ase, etc. [edit prob just heap_big3 if in a 'blend models' folder] Each group would only use one matching material def also numbered 3.
  • The material defs would be named eg, blend_1, blend_2, etc. So all 8 models in Group 6 would use blend_6. By example, blend_2 might be dry dirt over cobbles_multi or something by default (whichever is most popular and commonly used.)
  • Each material def would have a suitable editor image. There could be some rough defaults: a rectangle with grass fading to blank mid-grey stone would do for all stone for example so you can see where it lies (might need some though as to lining up.)
  • The mapper has to look up in a list which the real defaults are and any he changes he would need also to keep note.
  • For even wider use the mapper can (if ase models) duplicate the model files and edit them to point to another material def.

 

If I could find some info how to set up the vertex painting on the model I would be willing to make a couple of test models to see if of any practical use, say one heap and one edging rectangle for a straight path.

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

    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 4 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
    • nbohr1more

      Please vote in the 15th Anniversary Contest Theme Poll
       
      · 0 replies
×
×
  • Create New...