Problems with phong shading
Posted: Fri Jan 08, 2010 10:32 am
I am experiencing a problem with phong shading on my terrain.
I was doodling some cave sections in GTK for a CTF level. My cave has a base rock texture and two separate alpha blended section, one on the floor, one on the ceiling. All in all I have 3 separate shaders, one for the rock-to-floor blend, one for the rock-to-ceiling blend and one phong shaded rock.
My problem is that the phong shaded rock isn't being smoothed:

All the dark area is the non-blended shader.
I've spent anytime aligning textures yet, this was just a first test. However I got stuck when I ran into this problem. I guess I could simply use the two blending shaders, but being a bit anal I wanted to solve the problem not go around it.
Just in case it's my scripts here they are...the blending script first and then the phong only script:
The screenshot was taken after a light -fast compile
Thanks
I was doodling some cave sections in GTK for a CTF level. My cave has a base rock texture and two separate alpha blended section, one on the floor, one on the ceiling. All in all I have 3 separate shaders, one for the rock-to-floor blend, one for the rock-to-ceiling blend and one phong shaded rock.
My problem is that the phong shaded rock isn't being smoothed:

All the dark area is the non-blended shader.
I've spent anytime aligning textures yet, this was just a first test. However I got stuck when I ran into this problem. I guess I could simply use the two blending shaders, but being a bit anal I wanted to solve the problem not go around it.
Just in case it's my scripts here they are...the blending script first and then the phong only script:
Code: Select all
textures/fi/rock_to_rock2
{
qer_editorimage textures/fi/2.tga
q3map_nonplanar
q3map_shadeAngle 179
{
map textures/fi/rock.tga
rgbGen identity
}
{
map textures/fi/rock_2.tga
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
rgbGen identity
alphaGen oneMinusVertex
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
rgbGen identity
}
}
textures/fi/rock_phong
{
qer_editorimage textures/fi/3.tga
q3map_nonplanar
q3map_shadeAngle 179
{
map textures/fi/rock.tga
rgbGen identity
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
rgbGen identity
}
}
Thanks