Page 1 of 1

Shader problem

Posted: Wed May 03, 2006 4:26 pm
by Waylander76
Ok i borrowed the radar shader and gfx from return to Castle Wolfenstein for my new map.
It works execpt the tcmod rotate in the first stage of the shader...it doesen't rotate the texture using the centre as the rotation point...any ideas why?

I tried the shader in the Q3A Shader Editor and it all works...just in Spearhead it doesn't rotate properly.

Do I need to add anything so SH will rotate it correctly?

Shader is below

Code: Select all

textures/rtcw/radar_01a
{
	qer_editorimage textures/rtcw/radar_01
	{
		map textures/rtcw/radarsweep.tga
		tcMod rotate 130
	}
	{
		map textures/rtcw/radarbeeps.tga
		blendfunc blend
		rgbGen wave sin 1 0.5 0 0.25 
		tcMod scroll 0.1 0.001
	}
	{
		map textures/rtcw/radar_01.tga
		blendfunc blend
		rgbGen Vertex
	}
}

thanks for any info

Posted: Wed May 03, 2006 7:50 pm
by Rookie One.pl
Weird. :? What does it rotate around, then? The top-left corner? Are you using the original texture from RtCW?

Posted: Wed May 03, 2006 8:16 pm
by Waylander76
Yep it's the original texture and shader from RTCW and it looks like it's rotating round the top left corner.

Posted: Fri May 05, 2006 4:22 am
by tltrude
You need to center the texture on the brush (key S). My guess is you have seen this web page, but just in case, here is the URL to the shader manual.

http://www.qeradiant.com/manual/Q3AShad ... /index.htm

Posted: Fri May 05, 2006 5:27 am
by Waylander76
Tom, yes I have seen the shader manual and the texture is centered on the
brush.

I don't understand why it works in the shader editor and not in SH.

Posted: Fri May 05, 2006 5:40 am
by Rookie One.pl
Well, it could be a random bug in the code. Truth is, EA messed a lot with the shader code during the game development, breaking some of the cooler features. Could be that this was broken as well.

Posted: Fri May 05, 2006 10:23 am
by Waylander76
Will do some tests when i get home later today and report back.

I hope EA haven't broken this one!!! :roll:

Posted: Fri May 05, 2006 5:15 pm
by Waylander76
ok after a little testing with another graphic....it works as it should!
so the rotating is not broken.

I then created a shader for the radarweep graphic on it's own (see below)

Code: Select all

textures/rtcw/radarsweep_test
{
   qer_editorimage textures/rtcw/radarsweep.tga
   {
      map textures/rtcw/radarsweep.tga
      tcMod rotate 130
   } 
And this rotates around the centre point as it should! :D
So i've come to the conclusion that when this is applied to the other parts
of the shader *something* causes the rotation point to go off centre.
Could it be the graphic itself?

I'm now experiamenting with the order of things in the shader......

Posted: Fri May 05, 2006 5:33 pm
by Waylander76
Problem solved!!

The 3rd graphic overlayed was causing the problem...when this was lined up
on the brush the centre of the other 2 textures was moved.
this caused them to be off centre so the rotation point of the radarsweep graphic was the centre of the 3rd graphic if that makes sense!! :lol:

Out with PSP for a bit of editing i think....

What?

Posted: Fri May 05, 2006 5:49 pm
by tltrude
What, a misaligned image center you say? Who'ed a thunk it?