If statements in Shaders?

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Random
Moderator
Posts: 401
Joined: Sun Jun 01, 2003 11:00 pm

If statements in Shaders?

Post by Random »

Ok so i was messin around with another game based on Q3 and i noticed there were if statements in the shaders. Here is an example of one of the ones i found.

Code: Select all

weapons/compressionscreen-locked

{
      //nomipmaps
	{
		clampmap models/weapons/comp_rifle/viewmodel/cscreen-base.tga
	}
if mtex	
	{
		map models/weapons/comp_rifle/viewmodel/cscreen-base.tga
		blendFunc GL_SRC_ALPHA GL_ONE
		nextbundle
		map models/weapons/comp_rifle/viewmodel/cscreen-scroll.tga
		tcMod scroll 0.2 0
	}
endif		
	{
		clampmap models/weapons/comp_rifle/viewmodel/cscreen-reticle2.tga
		blendfunc add
		rgbGen wave sin 1.0 0.55 1.0 3.25
	}

	
}
I havent actually played the game yet but i was thinkin this changes the crosshairs when the weapon is firing. Has anyone had any experience with this or if it can be applied to mohaa. I hope this hasnt been asked but i did a couple of searches and didnt come up with anything.

Ok so i was messin around with it some more and I found the same if statements refering to door textures. It appears that there is a light bar on the door that changes when the door is either open or closed as well as open or locked... Anythoughts or insights on this would be great.
Moderator
Image
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Only 'if mtex' is available for shaders, so no custom conditions can be used.
Image
Post Reply