Need a correct window shader for 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
diego
Captain
Posts: 245
Joined: Sun Dec 21, 2003 10:47 pm

Post by diego »

Code: Select all

textures/Praetoria/windows/window_transparent_01
{
	qer_editorimage textures/Praetoria/windows/window_transparent_01.tga
	qer_keyword glass
	qer_keyword window
	surfaceparm glass
	{
		map textures/Praetoria/env/env_bright.tga
		tcGen environment
		alphagen const .2
		blendFunc blend
	}
	{
		map textures/Praetoria/windows/window_transparent_01_frame.tga
//		blendFunc blend
				depthWrite
		alphaFunc GE128
	nextbundle
		map $lightmap
	}

}

textures/Praetoria/windows/window_transparent_02
{
	qer_editorimage textures/Praetoria/windows/window_transparent_01.tga
	qer_keyword broken
	qer_keyword window
	qer_keyword glass
//	surfaceparm fence
	surfaceparm glass
	{
		map textures/Praetoria/env/env_bright.tga
		tcgen environment
		alphagen const .2
		blendFunc blend
		alphaFunc GT0
	nextbundle
			map textures/Praetoria/windows/window_transparent_01.tga //full white alpha channel
	}
	{
		map textures/Praetoria/windows/window_transparent_01_frame.tga
		depthWrite
		alphaFunc GE128
	nextbundle
		map $lightmap
	}
}


These are 2 shaders directly from Tom's map. The frames still draw on top, but at this point, I don't care. I've reduced the effect enough that I doubt if anyone will notice much.

However, Now I have a bigger problem. Even when My windows are explicitly surfaceparm GLASS, I get the wood effects when shooting the entire thing.

I know those FCM files are the cause of this. I've tried the map with and without them. But I can't find anything that will let me edit or create these files. How did you get all those custom files for you Tut map?

I tried copying yours and renaming Tom's FCM's to my corresponding textures, but it doesn't make any difference. Could there be another setting in the shader causing this?

I would be perfectly happy with wood frames that have glass particles. But I don't want wood particles coming off my windows glass.
Diego
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

FCM

Post by tltrude »

I don't remember where the fcm files came from. I suspect they came from the original texture folder which contained the window images I modified.

Have you tried putting my windows in your building? If they work, then it is probably your tga images. If they are the problem, try using my image files and pasting your windows over them--alpha too.
Tom Trude,

Image
User avatar
diego
Captain
Posts: 245
Joined: Sun Dec 21, 2003 10:47 pm

Post by diego »

That was going to be my next test. I noticed that your window texture has a solid white Alpha channel and that you are using the alphagen const .2 to actually create the transparency effect. Then layering the window frame texture with the holes cut out for the glass in the second stage.

I copied this same setup for my own textures.

But tonight, I'll try to use your window shaders and textures and see if they work. If that works, maybe I can recreate my window textures on top of yours so I don't have to use the generic white window frame.
Diego
User avatar
diego
Captain
Posts: 245
Joined: Sun Dec 21, 2003 10:47 pm

Post by diego »

The inconsistency of the MOHAA compiler never ceases to amaze me.

As a test, I installed your custom window textures (broken and whole), the .fcm files and your shaders into my pk3 file. I assigned your textures to my windows and the glass parameter worked fine on the whole window. The broken window emmitted wood particles on the edges, and nothing in the center. (In your Tut map, the broken window emits no particles at all).

I also noticed that my textures were suddenly emitting the glass particle instead of the wood one even though I had not changed the shaders.

In the end, I have removed your shaders, textures, and .fcm files from my pk3 file. I am now using only my own stuff and it is still working fine.

Here's the rub:

Code: Select all


textures/Praetoria/windows/window_transparent_01
{
	qer_editorimage textures/Praetoria/windows/window_transparent_01_frame.tga
	qer_keyword glass
	qer_keyword window
	qer_keyword custom
	surfaceparm glass
	{
		map textures/Praetoria/env/env_bright.tga
		tcGen environment
		alphagen const .2
		blendFunc blend
	}
	{
		map textures/Praetoria/windows/window_transparent_01_frame.tga
		depthWrite
		alphaFunc GE128
	nextbundle
		map $lightmap
	}

}
This is the final shader I am using. Notice it is exactly the same as the first shader above. The only difference is the editor image. So why the shader is behaving correctly today, I have no idea.

I'll keep my fingers crossed and hope it stays this way. I have a few more custom windows to make. :?
Diego
Post Reply