Page 1 of 1

If statements in Shaders?

Posted: Sun Sep 28, 2003 9:39 pm
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.

Posted: Mon Sep 29, 2003 4:18 pm
by jv_map
Only 'if mtex' is available for shaders, so no custom conditions can be used.