Help needed with phong shader


(Thej) #1

hiya.

Im trying to add a phong shader to my rocket, but it dont seem to work :confused:

here are 2 screenies:

here is the shader drom the rocket texture:

textures/eagle/rocket1
{
surfaceparm metalsteps
implicitMap -
q3map_nonplanar
q3map_shadeangle 360

}

and this is the light compile i used:

@rem to use this batch file, drop a .map file on it or run it from a dos window:
@rem > compile rocketbase

@set Q3MAP_PATH=“C:/Program Files/GtkRadiant-ET-1.3/q3map2.exe”
@set ET_PATH=“D:/Program Files/Wolfenstein - Enemy Territory”
@set MAP_PATH=“D:/Program Files/Wolfenstein - Enemy Territory/etmain/maps/scripttest.map”
@set GEN_OPTIONS=-fs_basepath D:/Program Files/Wolfenstein - Enemy Territory -game et

@rem
%Q3MAP_PATH% -light -fast -samples 2 -filter -patchshadows -external -lightmapsize 256 -approx 8 %GEN_OPTIONS% -v %MAP_PATH%

Hope someone can help me out, and any help would be much apreciated.

Grts Thej


(chavo_one) #2

360 is not a valid value for q3map_shadeangle.

I believe 180 is the max. I would try setting it to 120, and seeing if that looks ok. If not increase it from there.


(ydnar) #3

BTW, you need to quote any paths in your bat file that have spaces in them:

@set GEN_OPTIONS=-fs_basepath D:/Program Files/Wolfenstein - Enemy Territory -game et

Becomes:

@set GEN_OPTIONS=-fs_basepath “D:/Program Files/Wolfenstein - Enemy Territory” -game et

y


(ydnar) #4

Note that -filter generally gives you visible seams on joints between surfaces. Try compiling without it.

Also, you might consider making the rocket out of patch meshes or an ASE model instead of brushes, for best shading results.

y


(Thej) #5

The rocket is made out of a cylinder :confused:

see here:

I am compiling with these settings

@rem to use this batch file, drop a .map file on it or run it from a dos window:
@rem > compile rocketbase

@set Q3MAP_PATH=“C:/Program Files/GtkRadiant-ET-1.3/q3map2.exe”
@set ET_PATH=“D:/Program Files/Wolfenstein - Enemy Territory”
@set MAP_PATH=“D:/Program Files/Wolfenstein - Enemy Territory/etmain/maps/scripttest.map”
@set GEN_OPTIONS=-fs_basepath “D:/Program Files/Wolfenstein - Enemy Territory” -game et

@rem
%Q3MAP_PATH% -light -fast -samples 2 -shade -patchshadows -external -lightmapsize 256 -approx 8 %GEN_OPTIONS% -v %MAP_PATH%

and shader

textures/eagle/rocket1
{
surfaceparm metalsteps
implicitMap -
q3map_nonplanar
q3map_shadeangle 90

}

But still nothing :frowning:


(chavo_one) #6

You’re taking your q3map_shadeangle value the wrong way, but it doesn’t matter. If you are using cylinders, there’s no use for phong shading.

Are you compiling the bsp, with -patchmeta or something?!


(Thej) #7

no, first i compile

single bsp-meta
then single-vis and then i use the compile from the post above for the light stage


(chavo_one) #8

What do you have r_subdivisions set to in the game?

EDIT: what happens if you remove the q3map_nonplanar from the shader?


(Thej) #9

nope
This is just a test map i made to create the Crane and test it together with the rocket.

This is the worldspawn

“classname” “worldspawn”
“mapcoordsmins” “7000 -7000”
“mapcoordsmaxs” “-7000 7000”

Edit lemme try that


(chavo_one) #10

No, r_subdivisions is a game setting that overrides the level of detail for patch meshes. ‘1’ is the highest detail with the best looking curves.

I’m thinking you might want to try removing the q3map_nonplanar and q3map_shadeangle lines from the shader. ydnar would know for sure, but I wonder if the phong shading code is messing up your cylinder.


(Thej) #11

ROFLMAO :rofl:

my r_subdivisions were at 12 :smiley:
Not they are at 1.

here are the new piccies :slight_smile:

Thx alot for the great help Chavo! :notworthy:
And Ydnar to ofcourse :slight_smile:


(chavo_one) #12

Now THAT rocket likes nice! :cool:


(Thej) #13

Thx :slight_smile:

Made the textures myself :smiley:


(hummer) #14

Hell yeah!

Can I get a tris count on that rocket though? Those curves are hella smooth.


(Thej) #15

heres the piccie i made from the tris


(Stektr33) #16

May I ask what Phong shading means? Sorry im teh n00b.


(Thej) #17

Read in this thread for the explanation

http://www.splashdamage.com/forums/viewtopic.php?t=3068&highlight=phong


(hummer) #18

Holy hell! 12k tris for a rocket! Maybe you should try a less detail on that curve… unless there isn’t much else in that room :slight_smile: Does look nice though.