Making Semi-transparent textures: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
(New page: ''written by Springheel'' I don't know if people already know about this, but it's news to me. When I was working on the lantern textures, I noticed that if I used the following shader:...)
 
No edit summary
Line 15: Line 15:
  map models/darkmod/props/textures/lamp_glass_lit
  map models/darkmod/props/textures/lamp_glass_lit
  rgb 1
  rgb 1
}
}
  }
  }


Line 23: Line 23:


You can clearly see the texture, but you can also nicely see through it.  Imagine this as a window.  And no vertex shaders necessary, so it should have conflicts with water (though I haven't tested it).  The only downside is that you can't apply a normalmap or specular to the texture--if you do it becomes opaque.  But for glass that wouldn't be important anyway.  I think this might be a cool way to provide transparent windows but still keep the warm glowy effect.  You wouldn't be able to use it for all window textures (since any frame or crosspiece in the texture would also become transparent unless they were straight black) but it will be very effective for some models, and might be useful in other places I haven't thought of yet (an underwater overlay comes to mind).
You can clearly see the texture, but you can also nicely see through it.  Imagine this as a window.  And no vertex shaders necessary, so it should have conflicts with water (though I haven't tested it).  The only downside is that you can't apply a normalmap or specular to the texture--if you do it becomes opaque.  But for glass that wouldn't be important anyway.  I think this might be a cool way to provide transparent windows but still keep the warm glowy effect.  You wouldn't be able to use it for all window textures (since any frame or crosspiece in the texture would also become transparent unless they were straight black) but it will be very effective for some models, and might be useful in other places I haven't thought of yet (an underwater overlay comes to mind).
An example of it in models (the second and fourth ones).
http://www.mindplaces.com/save/lamps2.jpg


[[category: tutorials]]
[[category: tutorials]]


[[category: textures]]
[[category: textures]]

Revision as of 22:33, 10 July 2007

written by Springheel


I don't know if people already know about this, but it's news to me.

When I was working on the lantern textures, I noticed that if I used the following shader:

textures/darkmod/metal/flat/lamp_glass_lit_transparent     //glass is partially transparent
{
	glass
	noshadows

	{
		blend   add 
		map	models/darkmod/props/textures/lamp_glass_lit
		rgb 1
	 }
}

the texture turned out to be transparent. Not totally transparent--you could still see the texture itself, but you could see through it. The effect was pretty neat, so I tried it on a simple brush in a map. Here's the result.

transparency1.jpg

You can clearly see the texture, but you can also nicely see through it. Imagine this as a window. And no vertex shaders necessary, so it should have conflicts with water (though I haven't tested it). The only downside is that you can't apply a normalmap or specular to the texture--if you do it becomes opaque. But for glass that wouldn't be important anyway. I think this might be a cool way to provide transparent windows but still keep the warm glowy effect. You wouldn't be able to use it for all window textures (since any frame or crosspiece in the texture would also become transparent unless they were straight black) but it will be very effective for some models, and might be useful in other places I haven't thought of yet (an underwater overlay comes to mind).

An example of it in models (the second and fourth ones).

lamps2.jpg