lfnetwork.com mark read register faq members calendar

Thread: Shader alpha problem
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 07-07-2003, 03:33 AM   #1
rgoer
 
rgoer's Avatar
 
Join Date: Jan 2003
Location: Raleigh
Posts: 316
Shader alpha problem

Ok, ok, this is a real pain in the ass. I've got a four-step shader and it just isn't working out the way I predicted. Here are two shots of it in-game, illustrating the problem:

shot 1 and shot 2

See how, in the second shot, the "words" start getting alpha-added again over the "back" of the bottom? Here's my shader code:

Code:
textures/roger/round_ad
{
	surfaceparm	nomarks
	surfaceparm	nonsolid
	q3map_nolightmap
	q3map_onlyvertexlighting
	cull	disable
    {
        map textures/roger/round_ad
        blendFunc GL_ONE GL_ONE
        tcMod scroll 0.3 0
    }
    {
	map textures/roger/text_1
	blendFunc GL_ONE GL_ONE
	tcMod scroll 0 -0.1
    }
    {
	map textures/roger/text_1_alpha
	blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
	detail
    }
}
and here is a shot that shows what the various images for the different steps are.

Can anybody tell me what I need to do to fix this shader?
rgoer is offline   you may: quote & reply,
Old 07-07-2003, 05:25 AM   #2
Lil Killa
lunatic
 
Lil Killa's Avatar
 
Join Date: Sep 2002
Location: Pants
Posts: 1,502
I might be wrong but I don't think there is a way to fix this. The grates have that same problem that your shader is having if they are on top of each other. I would suggest putting in a cylinder that is covered in black on the inside but then again you loose that "transparent" effect . I have had the same problem with some of my shaders before too and it sucks...... maybe Leslie knows some shader stuff all we need now is for him to see your helpless pless for help

Lil Killa is offline   you may: quote & reply,
Old 07-07-2003, 07:20 AM   #3
Leslie Judge
Teacher
 
Leslie Judge's Avatar
 
Join Date: Aug 2002
Location: Budapest, Hungary
Posts: 1,382
map maker 101 is right in a way. But if you take a look at LDJ's original of DOTF there the beams in the reactor have four transparent layers and they are correct.

As I'm at work now I can't try things out, but there is a thing I can suggest.

Why do you have the text itself and the alpha in separate textures? I think you could give the text_1_alpha's alpha channel to text_1 itself and leave out the 3rd stage like:
Code:
textures/roger/round_ad
{
        surfaceparm nomarks
        surfaceparm nonsolid
        surfaceparm trans
        q3map_nolightmap
        q3map_onlyvertexlighting
        cull	disable
    {
        map textures/roger/round_ad
        blendFunc GL_ONE GL_ONE
        tcMod scroll 0.3 0
    }
    {
        map textures/roger/text_1
        blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
        tcMod scroll 0 -0.1
    }
}
I added surfaceparm trans too to be sure that it is transparent. At home I'll try to do these because I'm not quite sure I'm right about the 2-stages-only solution if I'll not forget.


L. J.
Leslie Judge is offline   you may: quote & reply,
Old 07-07-2003, 07:41 AM   #4
rgoer
 
rgoer's Avatar
 
Join Date: Jan 2003
Location: Raleigh
Posts: 316
The reason for the alpha being separate is this: the "words" texture is 2048 pixels tall and it tcMod scrolls vertically. However, I want the "words" to fade away as they fall down, so I needed an alpha map that was separate from the image. The alpha map is only 512 pixels tall. Am I making sense?
rgoer is offline   you may: quote & reply,
Old 07-07-2003, 06:08 PM   #5
wedge2211
Commander, Rogue Squadron
 
wedge2211's Avatar
 
Join Date: Jul 2002
Location: Ithaca, NY
Posts: 2,320
Do you have two cylinders there? You only need one (doesn't matter which way the matrix faces) if you use the keyword cull disable. But you probably already knew that.

LJ knows a bit more about shaders and alphas than I do...:P


wedge2211 is offline   you may: quote & reply,
Old 07-07-2003, 06:37 PM   #6
rgoer
 
rgoer's Avatar
 
Join Date: Jan 2003
Location: Raleigh
Posts: 316
nope, just the one cylinder. I think I'm going to have to just give up on this effect... here is a .pk3 of a little test map that shows off, sort-of, the effect I was trying to get. You also can see the error. Maybe if you devmap the map you'll have a better idea of what I'm trying to do, and maybe somebody will know if it's fixable?
rgoer is offline   you may: quote & reply,
Old 07-10-2003, 09:25 AM   #7
Leslie Judge
Teacher
 
Leslie Judge's Avatar
 
Join Date: Aug 2002
Location: Budapest, Hungary
Posts: 1,382
Quote:
Originally posted by rgoer
The reason for the alpha being separate is this: the "words" texture is 2048 pixels tall and it tcMod scrolls vertically. However, I want the "words" to fade away as they fall down, so I needed an alpha map that was separate from the image. The alpha map is only 512 pixels tall. Am I making sense?
Hehh, sorry, I wasn't able to get online since my last post. And of course I didn't recognize that the words scroll vertically. Again: if I'll have time at home today I'll play with it a little to see if I can find out something.


L. J.
Leslie Judge is offline   you may: quote & reply,
Old 07-12-2003, 01:53 PM   #8
lauser
 
lauser's Avatar
 
Join Date: Jan 2003
Location: CANADA
Posts: 428
Bah!! I'm just trying to get the silly shader to work period!! All I get is a solid brush when I play the map. I made the shader file and stuck it in the shader folder. The shader I made is the forcefield from doomgiver. All I did was change the color of it.

Any help would be greatly appreciated.

Should I try doing a devmap or?


My kung fu is also very weak
lauser is offline   you may: quote & reply,
Old 07-12-2003, 04:01 PM   #9
rgoer
 
rgoer's Avatar
 
Join Date: Jan 2003
Location: Raleigh
Posts: 316
Ging, until you pak your stuff up into a .pk3, you have to make sure you "set sv_pure 0" before you "devmap <yourmap>"
rgoer is offline   you may: quote & reply,
Old 07-12-2003, 04:43 PM   #10
lauser
 
lauser's Avatar
 
Join Date: Jan 2003
Location: CANADA
Posts: 428
Yes I know that I was just checking thanks buddy!!


My kung fu is also very weak
lauser is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > JediKnight Series > Editing Central > JO Mapping > Shader alpha problem

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:44 AM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.