Page 1 of 1

phong shader on cylinder

Posted: Tue Apr 20, 2010 9:07 pm
by dave-0
I followed Sock's tutorial on creating a phong shader, left it mapping a grey texture for now.

When I apply it to a brush, in this case a curved 1/4 cylinder the coords flip
at the half way point or something, and a hard edge is generated, and an artifact in the shadow map.

What I am doing wrong ?

Code: Select all

//-----------------------------------------------------
// phong shader for curved brushes in the map

textures/daveo/grey_phong

{
	q3map_nonplanar
	q3map_shadeangle 360 //--- I tried other shade angles also ...
	qer_editorimage textures/daveo/grey_phong_REI.tga
	
	{
		map $lightmap
		rgbGen identity
	}
	{
		map textures/daveo/grey_phong.tga
 		blendFunc filter
	}
}
phong.jpg

Re: phong shader on cylinder

Posted: Tue Apr 20, 2010 9:12 pm
by skinNCNmaster
how is it applied in gtk in the patch surface properties dialog box?

fit natural set or cap?

Re: phong shader on cylinder

Posted: Tue Apr 20, 2010 9:28 pm
by Hipshot
Group the patch and set the _lightmapscale to .25, .025 or something and see...

And, 360, won't that give strange results?

Re: phong shader on cylinder

Posted: Tue Apr 20, 2010 9:34 pm
by obsidian
Are you applying phong shading to a curve patch? FYI, curves are automatically "phonged".

Yes, shadeangle usually ranges between 0 and 180 (or 179 to prevent straight surfaces from being "phonged").

Re: phong shader on cylinder

Posted: Tue Apr 20, 2010 9:37 pm
by dave-0
No, its just a brush, 1/4 of a cylinder. I was messing around with the shade angle :) I think I started with 90. I will see how its mapped with the surface inspector.

Re: phong shader on cylinder

Posted: Wed Apr 21, 2010 5:50 pm
by dave-0
thanks for the help, I just adjusted the mapping to axial and it looks fine now, at least in the test map I compiled :)