shader problem for model


(twt_thunder) #1

this is my new helmet:


but i have a problem i cant get the protective visor to be transparent so or partly transparent so you can see the eyes…

here’s my shader:

models/players/temperate/allied/us.tga
{
    cull disable
    nomipmaps
    nopicmip
    surfaceparm nomarks
    surfaceparm alphashadow
    surfaceparm pointlight
    surfaceparm trans
    implicitMask -
}

is there anyone who can help me here?


(Justice) #2

Aren’t you supposed to add something like

{
clampmap models/players/temperate/allied/us.tga
blendfunc blend
}

I believe blendfunc blend makes it transparent. But I’m not a very good shaderwriter :stuck_out_tongue:


(Tardis) #3

[QUOTE='Just!ce.;390284]
I believe blendfunc blend makes it transparent. But I’m not a very good shaderwriter :P[/QUOTE]

It is manly - surfaceparm trans , that makes it transparent :wink:

this is from sfx glass

edited for the visor

models/players/temperate/allied/us.tga
{
qer_editorimage models/players/temperate/allied/us.tga
qer_trans 0.5
cull none
surfaceparm glass
surfaceparm trans
{
map models/players/temperate/allied/us.tga
blendFunc GL_ONE GL_ONE
rgbGen identity
tcgen environment
}
{
map $lightmap
blendFunc filter
rgbGen identity
}
}


(stealth6) #4

[QUOTE=Tardis;390329]It is manly - surfaceparm trans , that makes it transparent :wink:
[/QUOTE]

This is what q3 shader manual says about surfaceparm trans:

Tells q3map that pre-computed visibility should not be blocked by this surface. Generally, any shaders that have blendfuncs should be marked as surfaceparm trans.

aka it doesn’t make it transparent ingame, but makes it transparent as in it won’t block line of sight for -vis.


(twt_thunder) #5

[QUOTE=Tardis;390329]It is manly - surfaceparm trans , that makes it transparent :wink:

this is from sfx glass

edited for the visor

models/players/temperate/allied/us.tga
{
qer_editorimage models/players/temperate/allied/us.tga
qer_trans 0.5
cull none
surfaceparm glass
surfaceparm trans
{
map models/players/temperate/allied/us.tga
blendFunc GL_ONE GL_ONE
rgbGen identity
tcgen environment
}
{
map $lightmap
blendFunc filter
rgbGen identity
}
}[/QUOTE]

sorry didnt work either… wonder why… the first i shader i have used on textures earlier and got them trans ingame…


(ischbinz) #6

models/mapobjects/goldbox_sd/glass
{
cull disable
{
map models/mapobjects/goldbox_sd/glass.tga
blendfunc blend
}
}

just make it simple -
you need a tga with transparency

if that works you could try this additional lines (should result some shiny effect - not sure if it works with transparent stuff)
{
map models/players/temperate/allied/fieldops/envmap_slate_alpha.tga
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
rgbGen lightingdiffuse
tcmod scale 1.5 1.5
tcGen environment
}

don t forget to change the path for your shader
the env_slate is located in textures/effects

gl


(twt_thunder) #7

[QUOTE=ischbinz;390548]models/mapobjects/goldbox_sd/glass
{
cull disable
{
map models/mapobjects/goldbox_sd/glass.tga
blendfunc blend
}
}

just make it simple -
you need a tga with transparency

if that works you could try this additional lines (should result some shiny effect - not sure if it works with transparent stuff)
{
map models/players/temperate/allied/fieldops/envmap_slate_alpha.tga
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
rgbGen lightingdiffuse
tcmod scale 1.5 1.5
tcGen environment
}

don t forget to change the path for your shader
the env_slate is located in textures/effects

gl[/QUOTE]

I will try this ischbinz, but i made a shader that made it transparent… but i dont want it completly transparent. I want it like a bit dirty glass.

this shader does it totally transparent:

models/players/temperate/allied/us
{
cull disable
surfaceparm trans
surfaceparm alphashadow
{
map models/players/temperate/allied/us.tga
alphafunc ge128
rgbGen lightingDiffuse
}
}

EDIT:no…doesnt work either :frowning:

get some error and helmet turn black and yellow…

but i will try the addition you got on my shader…


(twt_thunder) #8

think maybe there’s a problem in the model itself…
but as i am no real 3d artist, i dont know how to fix this…
it seems some of the front of helmet becomes transparent when i try some other shaders…
so i guess i will have to drop this and make it somewhat look like glass…


(Mateos) #9

Is it a single-part model, or do you have the helmet+glasses separated?


(BackSnip3) #10

You should separate the helmet and the glass meshes and make two different shaders. One basic and the other one like sfx/glass.


(twt_thunder) #11

no problems guys, i came out pretty well as shades, and the light moves in it so it seems real, so i am happy :slight_smile: