Jump to content
The Dark Mod Forums

Real Translucency Anyone?


rich_is_bored

Recommended Posts

Fair enough. I'll incorporate this into the material shaders I produce.

 

I just want to know it's working for this use, then I'll happily go and make the necessary changes skins+materials to the current TDM foliage :)

 

Only reason I cant check is that I'm playing with the 3d features in photoshit at the moment, which completely maxes out system mem and doesnt allow me to save other work that I opened along side like a tard :( (That said, some of the new textures look really awesome with a displaced mesh(1mil tri)+diffuse+normal)

  • Like 1
Link to comment
Share on other sites

This is great! :D

 

Going from:

 

1) Not possible.

 

to

 

2) Possible! ...but lots of custom Asset creation.

 

to

 

3) Possible and practically automatic.

 

Rich, rebb, OrbWeaver, and Serpentine all deserve kudos for their part in the investigation!

 

And Tels gets credit for this tangent on foliage decals! :D

 

Great work all!

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

  • 3 weeks later...

So what exactly needs to be added to the material shader for this to work? I'm working on the werebeast textures right now and it might work well for the hair.

Link to comment
Share on other sites

Wow,

 

thats beautiful.

|=-=------=-=|

happycheeze.deviantart.com

 

Moddb

 

Gamers Outreach, a nonprofit that uses videogames to raise money for chairty.

|=-=------=-=|

Link to comment
Share on other sites

This is as simplified as I can make it...

 

translucent/example
{

// one set comprised of a normal map and diffuse map utilizing the vertexcolor keyword

{
	blend	bumpmap
	map	normalmap.tga
	vertexcolor
}
{
	blend	diffusemap
	map	diffusemap.tga
	vertexcolor
}

// a second set using the same images with the inversevertexcolor keyword

// the scale function here is "inverting" the normal map so that it catches light from the opposite side.

{
	blend	bumpmap
	map	scale(normalmap.tga, 1, 1, 0, 1)
	inversevertexcolor
}
{
	blend	diffusemap
	map	diffusemap.tga
	inversevertexcolor
}
}

 

You'll have a couple additional stages in practice because of the way you guys are handling ambient light but I hope this conveys the idea.

 

My only concern is I don't know if the MD5mesh format supports vertex colors. It doesn't look like it does...

 

http://www.modwiki.net/wiki/MD5MESH_%28file_format%29

Link to comment
Share on other sites

hmm, be a bummer if vert clors aren't useable, was planning on using them for a mesh I'm finishing up. Would make more skins available easily.

 

-----

What does this mean on the wiki page you linked then?:

 

 

Flags

Etqwsquare_25.png

Note: Enemy Territory: Quake Wars only: This type of ordered list only exists in ET:QW.The ordered list should be defined even when empty. Each line may specify one of the following known flags:

 

 

noAnimate

vertexColor

----------

 

 

It shows vertcolor and this is under md5.mesh, and it appears that what it means is 'the ordered list' is a quake wars thing, not the vertex color specifically.

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

My only concern is I don't know if the MD5mesh format supports vertex colors.

 

Yeah, it just shows up as black. Too bad.

Link to comment
Share on other sites

I'm trying this with some old sacking curtains but can't get it to work. I get total black texture in-game but there is no error in the console that I can see. The sacking shows in DR so it's not a typo in the map. Can someone check my material to see if I've made a blunder please?

 

textures/manor_royale/fabric/translucent2/cloth_coarse
{
qer_editorimage	models/md5/chars/guards/proguard/old_cloth_ed
surftype15
description "cloth"

       // one set comprised of a normal map and diffuse map utilizing the vertexcolor keyword

       {
               blend   bumpmap
               map     models/md5/chars/guards/proguard/old_cloth_local
               vertexcolor
       }
       {
               blend   diffusemap
               map     models/md5/chars/guards/old_cloth
               vertexcolor
       }

       // a second set using the same images with the inversevertexcolor keyword

       // the scale function here is "inverting" the normal map so that it catches light from the opposite side.

       {
               blend   bumpmap
               map     scale(models/md5/chars/guards/proguard/old_cloth_local, 1, 1, 0, 1)
               inversevertexcolor
       }
       {
               blend   diffusemap
               map     models/md5/chars/guards/old_cloth
               inversevertexcolor
       }
}

Link to comment
Share on other sites

I thought that this would only work with models because you have to set the Vertex Color to 50% (cant be done to Brush work)?

 

Vertex colour. Models can provide vertex colours which are multiplied with the model texture to introduce low-frequency colour variation over the model surface. Brushes and patches do not support vertex colours.

 

Yep.

 

http://www.modwiki.n...dels_vs_brushes

 

(this is presuming that your curtain design is similar to your table-cloth in the other thread)

Edited by nbohr1more

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

The model texture shows OK but no translucency. I wonder if this is because I have two patches back to back, one inverted matrix. It was the only way to get the shadows working correctly. A two sided texture just gave the venetian blind shadow. How does foliage deal with that? noshadow? Mmm... maybe it's different for models and a two-sided texture would work? But that makes no sense. Texture is texture.

 

post-400-128332685673_thumb.jpg

 

 

Here's an old picture I just found showing the single patch 2-sided texture with the bad shadow.

 

post-400-128332695332_thumb.jpg

Link to comment
Share on other sites

You're using the same diffuse map in both stages. In the inversevertex color set, you need to paint a new diffusemap that looks like it's being backlit.

 

Think of it this way, you're using an image editing program. You have two layers and your erasing parts of the first layer. If the second layer is identical, you won't see any difference.

Link to comment
Share on other sites

  • 10 months later...

Thread necromancy! Heck yeah! :huh:

 

Rich, I want to implement translucency for my trees but I'm not sure how a backlit leaf texture would look like so could you upload yours? Also does this work without the twosided keyword in the material (I want to just duplicate and invert normals in my 3D program)?

Link to comment
Share on other sites

Also does this work without the twosided keyword in the material (I want to just duplicate and invert normals in my 3D program)?

That's actually the best way for this :)

 

Did Blender's export get it's normal export problems fixed? Might run into issues with that, and since you cant merge the vertices, hmmmm

Link to comment
Share on other sites

@Nosslak:

 

Example TGAs are here...

 

http://min.us/mvfedmr

 

It's not hard to paint the back lit diffuse. You just take the existing diffuse and paint over it so it looks like a light is behind it like this...

 

http://robertgilbert...eaves-140469098

 

@Serpentine:

 

You wouldn't want to merge the vertices when manually producing a twosided surface as you want a clear seam between the back and front faces.

Link to comment
Share on other sites

Did Blender's export get it's normal export problems fixed? Might run into issues with that, and since you cant merge the vertices, hmmmm

I think the problem actually was in Xnormals generated normalmaps and not in Blender, but I'm not sure if my normalmaps are correct so I should probably go take a look at that. I don't really understand why I'd want to merge the vertices either?

 

@Nosslak:

 

Example TGAs are here...

 

http://min.us/mvfedmr

 

It's not hard to paint the back lit diffuse. You just take the existing diffuse and paint over it so it looks like a light is behind it like this...

 

http://robertgilbert...eaves-140469098

Thanks! I'll try it out after I've successfully imported the tree as a regular object. Also should I offset (move) the faces at all (it looked like they were in your video)?

 

Is this more performance heavy than just the ordinary lighting method? I would assume so, but I'm not sure, because then I probably should turn it off for the LOD-versions. Is it enough to turn it off by just changing to a mesh without vertex colors?

Link to comment
Share on other sites

I think the problem actually was in Xnormals generated normalmaps and not in Blender, but I'm not sure if my normalmaps are correct so I should probably go take a look at that. I don't really understand why I'd want to merge the vertices either?

 

You don't, but the blender exporter somehow mangles the vertex normals, as such the easiest way to avoid letting it use the broken vertex normals is to merge them all. If the vertices are all merged then doom3 just recalculates them, the down side is that you cant make sharp corners and you might get shading issues on polygons using shared vertices. If the exporter is working correctly then the vertices will have valid normals, and as such there's no reason to really merge them (tho, for the sake of simplicity it's often easier to merge non-edge clusters, since they most likely are not being manually oriented).

 

But umm, I'd just carry on the way you are now, if you're getting good bakes and the surfaces dont show up black in game, then this is not a problem :)

 

@Serpentine:

You wouldn't want to merge the vertices when manually producing a twosided surface as you want a clear seam between the back and front faces.

Yup, that's what I meant with not being able to merge them :)

Link to comment
Share on other sites

No foliage is moving in my video. I guess you're talking about this...

 

 

And yes this translucency trick is slightly more taxing than a standard material. When you start on lower LOD versions I would recommend that you use a different material just to be certain it doesn't render two passes.

Link to comment
Share on other sites

Nah, I meant this:

If you look right there at 0:20 the planes are a bit offset, they are still very close but they are offset a tiny bit, which makes it possible to see a thin black outline in places. Is this needed or can I just duplicate my planes and flip their normals (without moving them)?

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

    • 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
    • The Black Arrow

      Hope everyone has the blessing of undying motivation for "The Dark Mod 15th Anniversary Contest". Can't wait to see the many magnificent missions you all may have planned. Good luck, with an Ace!
      · 0 replies
×
×
  • Create New...