Help With a Custom Texture

If you're looking for mapping help or you reckon you're a mapping guru, post your questions / solutions here

Moderator: Moderators

User avatar
Reish Vedaur
Sergeant
Posts: 64
Joined: Sat Apr 26, 2003 10:36 pm
Location: Illinois
Contact:

Help With a Custom Texture

Post 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?
My warning meant nothing. You're dancing in quicksand. Why don't you watch where you're wandering? Why don't you watch where you're stumbling? You're in knee-deep and going in, and you may never come back again.
~Tool.
User avatar
General Death
Moderator
Posts: 1116
Joined: Thu Nov 21, 2002 2:33 am
Location: NC, USA
Contact:

Post 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 :(
Image
User avatar
Reish Vedaur
Sergeant
Posts: 64
Joined: Sat Apr 26, 2003 10:36 pm
Location: Illinois
Contact:

Post 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.
My warning meant nothing. You're dancing in quicksand. Why don't you watch where you're wandering? Why don't you watch where you're stumbling? You're in knee-deep and going in, and you may never come back again.
~Tool.
panTera
Brigadier General
Posts: 573
Joined: Wed Jan 29, 2003 11:46 pm
Location: The Netherlands
Contact:

try this:

Post 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.]
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

I think you need surfaceparm noimpact to make bullets go through.
Image
User avatar
Reish Vedaur
Sergeant
Posts: 64
Joined: Sat Apr 26, 2003 10:36 pm
Location: Illinois
Contact:

Post 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.
My warning meant nothing. You're dancing in quicksand. Why don't you watch where you're wandering? Why don't you watch where you're stumbling? You're in knee-deep and going in, and you may never come back again.
~Tool.
panTera
Brigadier General
Posts: 573
Joined: Wed Jan 29, 2003 11:46 pm
Location: The Netherlands
Contact:

Post by panTera »

okay that's what I thought. Have you tried it yet? :wink:
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.)
User avatar
Reish Vedaur
Sergeant
Posts: 64
Joined: Sat Apr 26, 2003 10:36 pm
Location: Illinois
Contact:

Post 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. :?
My warning meant nothing. You're dancing in quicksand. Why don't you watch where you're wandering? Why don't you watch where you're stumbling? You're in knee-deep and going in, and you may never come back again.
~Tool.
panTera
Brigadier General
Posts: 573
Joined: Wed Jan 29, 2003 11:46 pm
Location: The Netherlands
Contact:

Post 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?
User avatar
Reish Vedaur
Sergeant
Posts: 64
Joined: Sat Apr 26, 2003 10:36 pm
Location: Illinois
Contact:

Post by Reish Vedaur »

Sir, just the screen, sir!
My warning meant nothing. You're dancing in quicksand. Why don't you watch where you're wandering? Why don't you watch where you're stumbling? You're in knee-deep and going in, and you may never come back again.
~Tool.
panTera
Brigadier General
Posts: 573
Joined: Wed Jan 29, 2003 11:46 pm
Location: The Netherlands
Contact:

phew....

Post 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 :wink:

K man, laters.
User avatar
Reish Vedaur
Sergeant
Posts: 64
Joined: Sat Apr 26, 2003 10:36 pm
Location: Illinois
Contact:

Post 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.
My warning meant nothing. You're dancing in quicksand. Why don't you watch where you're wandering? Why don't you watch where you're stumbling? You're in knee-deep and going in, and you may never come back again.
~Tool.
panTera
Brigadier General
Posts: 573
Joined: Wed Jan 29, 2003 11:46 pm
Location: The Netherlands
Contact:

Post 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)
User avatar
Reish Vedaur
Sergeant
Posts: 64
Joined: Sat Apr 26, 2003 10:36 pm
Location: Illinois
Contact:

Post by Reish Vedaur »

:shock:

A FELLOW TOOL FAN!!! <high-five>

And thank you ever so much for your help =)
My warning meant nothing. You're dancing in quicksand. Why don't you watch where you're wandering? Why don't you watch where you're stumbling? You're in knee-deep and going in, and you may never come back again.
~Tool.
User avatar
Reish Vedaur
Sergeant
Posts: 64
Joined: Sat Apr 26, 2003 10:36 pm
Location: Illinois
Contact:

Post by Reish Vedaur »

:cry:
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...
My warning meant nothing. You're dancing in quicksand. Why don't you watch where you're wandering? Why don't you watch where you're stumbling? You're in knee-deep and going in, and you may never come back again.
~Tool.
Post Reply