Quake3World.com Forums
     Level Editing & Modeling
        Problem with translucence and func_train


Post new topicReply to topic
Login | Profile | | FAQ | Search | IRC




Print view Previous topic | Next topic 
Topic Starter Topic: Problem with translucence and func_train

Insane Quaker
Insane Quaker
Joined: 28 Jan 2010
Posts: 308
PostPosted: 04-23-2010 12:13 AM           Profile Send private message  E-mail  Edit post Reply with quote


Hi guys!

I'm in serious trouble and need your help :)

1) I want to create transparent texture, where transparency is taken from alphachannel and this texture lightmap is also influenced by this alpha. I don't want such commands like GT0, LT128 and/or GE128. It creates "hard edges" of picture and I want soft gradient of transparency. And When I achieve soft transparency I can't achieve correct lightmapping of it - "not-transparent" areas are good colored, but "transparent" areas are black (doesn't have to be!). Does anybody know how to fix it? It means how to do lightmap of this texture same transparent as source image?

2) I don't know if anywhere here is the same topic, but my "func_trains" aren't moving :) I have simply cube, with originbrush in the center, linked with "path_corner"s (yes, brush and originbrush are parts of the "func_train" entity) but nothing is happening.

Thanks a LOT :)




Top
                 

I'm the dude!
I'm the dude!
Joined: 04 Feb 2002
Posts: 12307
PostPosted: 04-23-2010 06:55 AM           Profile Send private message  E-mail  Edit post Reply with quote


If you have something like a grate where some parts of the shader are transparent while other parts are not, and you want this properly lightmapped, you have to do an alpha test (alphaFunc). This tells other stages of the shader like the lightmap where areas are transparent. However, this will create hard edges as you have noticed. That's about as limited as the engine goes and there's not much you can do about it. Alpha becomes a 1-bit value.

If your transparent areas are more like glass, then you don't need to do any alpha testing and a traditional blendFunc will do. You also get to use the full 8-bit alpha.

Otherwise, you can try making the surface vertex lit only. Depending on the scenario, it might look decent. A screenshot of exactly what you are trying to do might help with giving suggestions.


Func_train tutorial:
http://www.1upclan.info/hosted/bubba-ma ... rain1.html



_________________
GtkRadiant | Q3Map2 | Shader Manual


Top
                 

Multidirectional
Multidirectional
Joined: 29 Jan 2003
Posts: 2895
PostPosted: 04-23-2010 07:07 AM           Profile Send private message  E-mail  Edit post Reply with quote


something like this scriipt will work for a gradiated transparency... that is... everything in the greyscale gets alpha'd..

Code:
textures/pn03/blue-force-sheild
{
      cull disable
      qer_trans 0.5
      surfaceparm nomarks
      surfaceparm trans
      surfaceparm nonsolid
      surfaceparm noimpact
      surfaceparm nolightmap
   {
      map textures/pn03/blue-force-sheild.tga
      blendfunc add
   }
}


or this.. as a sprite..

Code:
textures/pn03/blue_flare
{
   surfaceparm nolightmap
   qer_trans 0.5
   surfaceparm nomarks
   surfaceparm trans
   surfaceparm nonsolid
   deformvertexes autosprite
   cull disable
   sort 6
   {
      clampmap textures/pn03/blue_flare.tga
      blendfunc add
      tcMod rotate 30
      rgbGen wave inversesawtooth 0.5 0.5 0 0.5
   }
}


the images/textures for these are jpgs of color painted onto black. the same effect can be done on white.. but the coloration effect becomes different.. i belleive the on white works good for outdoor/sunlight applications where the on black is for trim lit areas. areas without light sources per/se

i believe the blendfunc add gets changed to subtract when working with white




Top
                 

I'm the dude!
I'm the dude!
Joined: 04 Feb 2002
Posts: 12307
PostPosted: 04-23-2010 07:29 AM           Profile Send private message  E-mail  Edit post Reply with quote


He's talking about getting lightmaps to work with transparency. You don't even have a lightmap stage.



_________________
GtkRadiant | Q3Map2 | Shader Manual


Top
                 

Insane Quaker
Insane Quaker
Joined: 28 Jan 2010
Posts: 308
PostPosted: 04-23-2010 01:11 PM           Profile Send private message  E-mail  Edit post Reply with quote


Obsidian - thanks! Look, I don't need transparent lightmap, I only want texture to be NOT black in shadow in transparent part of texture... :(

Thanks for func_train tutorial :)

NCmaster - thanks, but as said OBsidian - you have not lightmap enabled in your texture script :)




Top
                 

Multidirectional
Multidirectional
Joined: 29 Jan 2003
Posts: 2895
PostPosted: 04-23-2010 02:45 PM           Profile Send private message  E-mail  Edit post Reply with quote


noruen can you explain this furthur...

"not black in shadow in the transparent part"

like youve got a multi stage shader... projecting light.. AND allowing light to be projected onto itself? when the light hits the shader it scaled up the transparent pixel values from see through to opaque?




Top
                 

Insane Quaker
Insane Quaker
Joined: 28 Jan 2010
Posts: 308
PostPosted: 04-24-2010 12:15 AM           Profile Send private message  E-mail  Edit post Reply with quote


NCmaster - sorry, I have problem with english sentence structure :) There is screenshot:
Image

As you can see, texture is "softly" transparent (in blue area), but not influenced by lightmap (red area) and when it is, it is dark even where it should be transparent (green area).

You're right - when shadow hits my texture in transparent part, it makes texture less transparent, more opaque :)




Top
                 

The Afflicted
The Afflicted
Joined: 14 Oct 2001
Posts: 579
PostPosted: 04-24-2010 02:29 AM           Profile Send private message  E-mail  Edit post Reply with quote


So it's decal?
My normal decal shader for that kind of effect uses a negative blend, here's the relevant bit:

Code:
{
   surfaceparm trans
   surfaceparm nomarks
   polygonOffset
   qer_trans 0.5
   sort 6
   {
      map textures/mytexture/mytexture_decal.tga
      blendFunc GL_ZERO GL_ONE_MINUS_SRC_COLOR
      rgbGen identity
   }
}


The image I want to blend as the decal is on a white background in my 2d art application, then the whole image is inverted.
There is a decal thread here somewhere that goes through the different blend set ups you might like to try for various different results.




Top
                 

Multidirectional
Multidirectional
Joined: 29 Jan 2003
Posts: 2895
PostPosted: 04-24-2010 05:55 AM           Profile Send private message  E-mail  Edit post Reply with quote


love to see the original texture... please.. AND the script you've got setup for it..

and um/.. why are you adding a lightmap to a "marks" decal?

if its color on black background... and a decal.. try the first script i used.. theres no lightmap stage... no need... try it..

see your light is projected onto the floor...

turn off lightmap for the decal and you will still see the light and shadows on the floor beneath the decal..




Top
                 

I'm the dude!
I'm the dude!
Joined: 04 Feb 2002
Posts: 12307
PostPosted: 04-24-2010 06:48 AM           Profile Send private message  E-mail  Edit post Reply with quote


If this is indeed a decal, then read this:

http://robotrenegade.com/q3map2/docs/sh ... ricks.html



_________________
GtkRadiant | Q3Map2 | Shader Manual


Top
                 
Quake3World.com | Forum Index | Level Editing & Modeling


Post new topic Reply to topic


cron
Quake3World.com
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group