Phong shading problem


(nUllSkillZ) #1

Hi,

not sure if I should post this in the q3map2 forum.
I’ve tried to use phong-shading to make the earthwork shown in the following picture “round”.

credits:

  • prefabs: Ifurita and bubba
  • shader: sock
Edit:

  • sky: ydnar
  • sky shader: obsidian + ydnar
  • textures: evillair

Here’s the shader (it’s been taken from sock’s side except the lines pointing to the pictures of course):


textures/p7/p7_grass_dense1
{
	q3map_nonplanar
	q3map_shadeangle 120
	qer_editorimage textures/p7/p7_grass_dense1_phong.tga
	{
		map $lightmap
		rgbGen identity
	}
	{
		map textures/temperate_sd/grass_dense1.tga
		blendFunc filter
	}
}

I’ve tried “q3map_shadeangle 60”, “120” and “270”.
But with the same, no, result.

Compile parameter’s:


BSP -meta, -vis, -light -fast -filter

Version of q3map2:
For “120” I’ve used v2.5.11 (the version that ships with GTKRadiant v1.4.0).
For “60” and “270” I’ve used v2.5.15.

I don’t know what’s wrong.

Thank you in advance for your help.

p.s.:
The picture reflects the layout of my map project “p7” (for “Prüfstand VII” = “test stand VII”):
http://www.splashdamage.com/index.php?name=pnPHPbb2&file=viewtopic&t=2347&start=192


(MadMaximus) #2

did you add your shader to the shader list?


(nUllSkillZ) #3

Yes.


(WolfWings) #4

-light -shade -fast -filter

You need to enable phong-shading on Q3map2. :slight_smile:


(nUllSkillZ) #5

Oops!
Thanks, will try it.


(chavo_one) #6

http://www.splashdamage.com/index.php?name=pnPHPbb2&file=viewtopic&t=8795#84354


(nUllSkillZ) #7

Thanks for the link.

Tried “-shade”.
No effect as it has been posted by ydnar in chavo_one’s link.

Now trying “-shadeangle 60”.


(MadMaximus) #8

i don’t use -shade or at least have not used it yet. i use a standard bsp -meta, -vis and light -fast and all my phonged textures work proper… i’ll post one i use for terrain and another i use for walls,


// wall phonged
textures/ztextures/town_c38_phong
{
	qer_editorimage textures/ztextures/town_c38_phong.jpg
	q3map_nonplanar
	q3map_shadeangle 135
	implicitMap textures/ztextures/town_c38ap.jpg
}


//terrain phonged
textures/ms_terrain/base_9
{
	nopicmips
	q3map_nonplanar
	q3map_shadeangle 155
	q3map_forcemeta
	q3map_tcGen ivector ( 256 0 0 ) ( 0 256 0 )
}

textures/ms_terrain/ms_dirt3
{
	q3map_baseshader textures/ms_terrain/base_9
	qer_editorimage textures/temperate_sd/dirt3.tga
	surfaceparm landmine
	surfaceparm grasssteps
	{
		map textures/temperate_sd/dirt3.tga
		rgbGen identity
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		rgbGen identity
	}
}



the phong works proper, and i have used these shaders on previous q3map2’s with no problem so far.

EDIT:

ok, im just tossing things out here, but what if you tried this shader and see what happens,


textures/p7/p7_grass_dense1
{
   q3map_nonplanar
   q3map_shadeangle 120
   qer_editorimage textures/p7/p7_grass_dense1_phong.tga
   {
	map textures/temperate_sd/grass_dense1.tga
	rgbGen identity
   }
   {
	map $lightmap
	blendFunc GL_DST_COLOR GL_ZERO
	rgbGen identity
   }

}


(The Wanderer) #9

I’m not sure what you expect phong to do for that map. From what I see in that picture your map is just a flat surface with a bunch of cubes in it. Phong is great for smoothing out shadows on relatively round objects, but it can’t work miracles.
It’s not gonna make your cubes look round. Also the texture on your “ring” like thing is too dark(at least on that picture) to notice any shadows in it.


(nUllSkillZ) #10

Makes sense.
The effect is there but not noticeble.

As I’ve mentioned it’s only the layout.
The blocks will be replaced by houses, turrets etc. (as the wooden turret).

I 've thought that it is possible to make the earthwork look more “round”.
But then I have to do it by hand.

Thank you all for your help.