Pages: [1]
  Print  
Author Topic: Transparent shaders (grates, trees and such)  (Read 10326 times)
Czestmyr
Half-Nub


Cakes 0
Posts: 87


Member, Player, Mapper


« on: January 05, 2007, 12:19:24 PM »

Hi, I tried to create my own tree branch texture with a transparent shader. Here's the code:

Code:
textures/trees/vetev
{
qer_editorimage textures/trees/vetev.tga
surfaceparm nomarks
surfaceparm nonsolid
cull enable
{
map textures/trees/vetev.tga
depthWrite
alphaFunc GE128
}
{
map $lightmap
blendfunc subtract
tcGen lightmap
depthFunc equal
}
}

But there are a few issues:
* The shader has to be one-sided because if I disable culling, both sides share the same portion of the lightmap, which looks weird.
* The surfaceparm nonsolid and surfaceparm nomarks parameters don't seem to work
* I want the surface to occlude the sunlight and cast nice shadows, which it doesn't (view the attached picture)

Edit: The bushes in the attached picture consist of three crossing planes, which in turn consist of two 3x3 patch meshes, so that these planes are visible from both sides (as I said, using just one patch mesh and making the shader two-sided would look odd)
« Last Edit: January 05, 2007, 12:22:16 PM by Czestmyr » Logged

Jabber ID: Czestmyr (rolled-herring-sign) jabber.cz
dmn_clown
Posts a lot
*

Cakes 1
Posts: 1324


« Reply #1 on: January 06, 2007, 06:47:49 AM »

Those look good, at least with that lighting.  The only bad thing is that it is insanely difficult to do realistic vegetation in a video game.  I think the better route would be to do a playerclipped md3 model.

Even the commercial games can't seem to get vegetation to look right, an example would be Croteam's Serious Sam 2 which had awesome looking fields of wildflowers until you looked at it closely and realized that everything was an autosprite (in q3 shader terms). 
Logged

fromhell
Administrator
GET A LIFE!
**********

Cakes 35
Posts: 14520



WWW
« Reply #2 on: January 06, 2007, 02:11:32 PM »

In speaking of vegetation, JKMakowka's tree models for q3a are under the GNU GPL, i haven't bothered committing them to the project yet

Logged

asking when OA3 will be done won't get OA3 done.
Progress of OA3 currently occurs behind closed doors alone

I do not provide technical support either.

new code development on github
Pages: [1]
  Print  
 
Jump to: