Page 1 of 2
Help With a Custom Texture
Posted: Thu Jun 12, 2003 5:59 am
by Reish Vedaur
I've been trying to make a custom texture for a screen (as in a screen door), and I've run into a few problems.
At first, I wanted something that bullets could pass through reguardless of where it hit but made a spark, and made a custom bullet hole that made wherever it hit transparent. If someone knows how to do this, I'd be grateful; however, that's only if you can and want to, not the main problems. Here's the main problems.
First problem: screen.tga doesn't seem to have the right kind of alpha shadowing. Only a small hole is visible. The .tga is 2x2 pixels, top-left and bottom-right are gray, and the two left over are black and alpha-shadowed by my friend. Maybe it's the triple-buffering. Is there a surfaceparm that diminishes triple buffering for a specific texture?
Second problem:
Code: Select all
//Screen
textures/somewhereinmiddleamerica/screen
{
qer_editorimage textures/somewhereinmiddleamerica/screen.tga
qer_keyword masked
surfaceparm nonsolid
surfaceparm alphashadow
surfaceparm playerclip
surfaceparm nomarks
cull none
nopicmip
{
map textures/somewhereinmiddleamerica/screen.tga
depthWrite
alphaFunc GE128
nextbundle
map $lightmap
}
}
Even with all these settings, bullets refuse to go through the screen. Can you see something wrong?
Posted: Thu Jun 12, 2003 11:37 am
by General Death
I also have this problem on a grass texture.....I want players to run through it yet have a surfaceparm foliage. You can move through it by the surfaceparm nonsolid yet I believe that remove the foliage effect.
Im sure this is the same prob you are having. You do need to add a surfaceparm metal though.
Im thinking in both cases we are limited as to what we want to do since the surfaceparms conflict one another

Posted: Thu Jun 12, 2003 4:28 pm
by Reish Vedaur
Actually, I recently made an ivy shader that works perfectly. All you need to do is make a block of foliageclip and add the texture where you want it. You may want to add "surfaceparm nomarks" if you are gonna put it up against something, like a tree trunk (strangely enough) :
Code: Select all
// Ivy ground cover
textures/TEXTUREFOLDER/IVY1
{
qer_editorimage textures/TEXTUREFOLDER/IVY1.tga
qer_keyword natural
qer_keyword foliage
qer_keyword masked
surfaceparm foliage
surfaceparm nonsolid
surfaceparm alphashadow
cull none
nopicmip
{
map textures/TEXTUREFOLDER/IVY1.tga
depthWrite
alphaFunc GE128
nextbundle
map $lightmap
}
}
But again, for some reason replacing "surfaceparm foliage" with "surfaceparm playerclip" has taken away all that capability that I wanted it to have.
try this:
Posted: Thu Jun 12, 2003 5:24 pm
by panTera
Question: do you only want
certain parts of that screen to be 'see-through'/'passable to bullets' or the
whole screen itself to be 'transparent'/'passable to bullets'?
If it's the first case, then don't use 'nonsolid', just playerclip (*see below). However, I think with a texture that size, the black parts will be too small for bullets to pass through in the first place.)
Code: Select all
//surfaceparms:
surfaceparm fence
surfaceparm metal
surfaceparm playerclip
surfaceparm monsterclip
surfaceparm nomarks
cull none
nopicmip
In the second case, just use shades of gray in the alpha and try to use 'blendFunc blend' instead of 'alphaFunc GE128', also add a surfaceparm of 'nolightmap'. (note: You need to compile again in order to see the effect, which is calculated in the q3map-stage.)
Code: Select all
textures/somewhereinmiddleamerica/screen
{
surfaceparm fence
surfaceparm metal
surfaceparm playerclip
surfaceparm monsterclip
surfaceparm nomarks
surfaceparm nolightmap
cull none
nopicmip
{
map textures/somewhereinmiddleamerica/screen.tga
blendFunc blend //this makes gray alpha parts transparent
rgbgen constant .4 .4 .4
}
}
//(I found this by checking some of the original transparent window textures)
*
[
from Q3 shader-manual->
Playerclip: Blocks player movement through a nonsolid texture. Other game world entities can pass through a brush marked playerclip. The intended use for this is to block the player but not block projectiles like rockets.
Alphashadow: Does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture.]
Posted: Thu Jun 12, 2003 5:53 pm
by jv_map
I think you need surfaceparm noimpact to make bullets go through.
Posted: Thu Jun 12, 2003 10:40 pm
by Reish Vedaur
Okay, so I'm trying to wrap my head around this.
The shader is supposed to block players, rockets and grenades without stopping bullets... no marks, no sparks (unless you can find a way for it not to stop the bullet), and not a fence.
The only thing I really wrapped my head around was the blendFunc... x_x sorry.
Posted: Thu Jun 12, 2003 10:53 pm
by panTera
okay that's what I thought. Have you tried it yet?
a shader with 'surfaceparm fence' will stop grenades, rockets, players and initially bullets. But combined with 'surfaceparm playerclip', bullets will go through your masked parts.
(The blendFunc-thing will make your texture partially transparent according to your alphamask.)
Posted: Thu Jun 12, 2003 11:02 pm
by Reish Vedaur
Okay, most of that helps... except that, like you said, the holes would be too small for any bullets to go through in the first place. Considering I don't want it to stop bullets, no matter where they hit, this doesn't help me any more than putting a partially-transparent brick wall there.

Posted: Fri Jun 13, 2003 12:44 am
by panTera
Hang in there, Corporal. I will look into it some more tomorrow cause I'm sure what you want is possible.
I've been trying to make a custom texture for a screen (as in a screen door)
Does this texture consist of a door+screen or just the screen?
Posted: Fri Jun 13, 2003 1:16 am
by Reish Vedaur
Sir, just the screen, sir!
phew....
Posted: Fri Jun 13, 2003 5:46 pm
by panTera
Yes, I've got it working! But you'll need to make two textures, otherwise it won't work! First you need your actual screen texture that will act as a dummy. Meaning, you'll see it, but that's it. Literally all entities can go through.
Shader for the first texture:
textures/somewhereinmiddleamerica/screen_dummy
{
surfaceparm noimpact
surfaceparm nonsolid
surfaceparm trans
cull none
nopicmip
{
map textures/somewhereinmiddleamerica/screen_dummy.tga
rgbGen identity
depthWrite
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
rgbGen identity
depthFunc equal
}
}
Or use this one if you want to make it transparent:
textures/somewhereinmiddleamerica/screen_dummy_transparent
{
surfaceparm noimpact
surfaceparm nonsolid
surfaceparm trans
surfaceparm nolightmap
cull none
nopicmip
{
map textures/somewhereinmiddleamerica/screen.tga
blendFunc blend //this makes gray alpha parts transparent
rgbgen constant .4 .4 .4
}
}
Next, for the second (invisible) texture, make an empty TGA-texture (I'd say just fill it with a colour, or add your own tag, doesn't matter) and make it the same size as the 'screen_dummy' texture. Now add an alpha mask and just leave the whole alpha layer black! Save as TGA-32bits! This texture won't be visible in game (to the eye) but will act like a fence that stops 'nades, rockets & Players but NOT bullets, since 'fence+playerclip' makes the black alpha parts passable to bullets only.
Shader for the second texture:
textures/somewhereinmiddleamerica/screen_alpha
{
surfaceparm fence
surfaceparm metal
surfaceparm playerclip
{
map textures/somewhereinmiddleamerica/screen_alpha.tga
depthWrite
alphaFunc GE128
nextbundle
map $lightmap
}
}
Create your screen and apply the first (visible) texture. Then create a new brush and apply the second (invisible alpha) texture. (Use the common/nodraw-texture on all other sides of the two brushes).
I've actually tested this and it does exactly what you are after. However, it does seem a little weird that tiny bullets can pierce through but not rockets
K man, laters.
Posted: Fri Jun 13, 2003 8:25 pm
by Reish Vedaur
I'm waiting for someone (I won't name names) to make my purely-alpha'd texture since the software I have has no such capabilities. I tried "surfaceparm nodraw" instead of the new texture without thinking, and -- surprise surprise -- it didn't work. I can be a bit of a numbskull sometimes, ya know? =) I'll let you know how it goes as soon as this someone -- or you, if you want to make it for me (it's just 2x2 pixels) -- makes the .tga for me.
Posted: Fri Jun 13, 2003 10:38 pm
by panTera
It doesn't have to be
that small;) Right, here ya go, I made it 32x32:
alphaTooL.tga (rightclick and save as).
Lemme know if you got it working 8)
Posted: Fri Jun 13, 2003 11:46 pm
by Reish Vedaur
A FELLOW TOOL FAN!!! <high-five>
And thank you ever so much for your help =)
Posted: Sat Jun 14, 2003 4:18 am
by Reish Vedaur

It's refusing to work.
Code: Select all
textures/somewhereinmiddleamerica/alphaTooL
{
surfaceparm fence
surfaceparm metal
surfaceparm playerclip
{
map textures/somewhereinmiddleamerica/alphaTooL.tga
depthWrite
alphaFunc GE128
nextbundle
map $lightmap
}
}
As you can see, I followed your example to a key. I removed the surfaceparm metal because it wasn't working, but neither did removing it; now it just acts like it's stone. And I removed the surfaceparm playerclip because the surfaceparm fence takes care of that already, but again, it just acts like stone. I made sure the rest of the brush was common_nodraw and not alphaTooL just like you said, as well. And I didn't put the "dummy" visible screen over it yet, either, since it's not supposed to have anything physical to do with it anyway.
This is getting ridiculous...