lightmapped model phong shading


(pazur) #1

I get kind of “hard” shading on my ASE model although the shader has q3map_shadeAngle 180. I tried 89 120 … same problem. and i checked for not welded vertices in 3ds max. but they all seem to be welded

the other side of the model. here the shading looks better, but i guess this is only because there is less light.

screenshots are compiled with -fast -patchshadows -filter -shade -super 2
(q3map2 2.5.7) … i tried -samples 3 , but the effect was not very satisfactionary. not only on the model but on the rest of the map


textures/natter/lm_model_base
{
	qer_editorimage textures/common/skip.tga

    q3map_forceMeta
    q3map_nonplanar

    q3map_splotchfix
    q3map_lightmapsamplesize 4
}

models/natter/natterbo_lm
{
	qer_editorimage models/natter/natterbo.tga
	q3map_baseshader textures/natter/lm_model_base
	q3map_shadeAngle 180
	{
      map $lightmap
      rgbGen identity
    }
    {
		map models/natter/natterbo.tga
		blendFunc GL_DST_COLOR GL_ZERO
     	rgbGen identity
	}
}

models/natter/rest_lm
{
	qer_editorimage models/natter/rest.tga
	q3map_baseshader textures/natter/lm_model_base
	q3map_shadeAngle 89
	{
      map $lightmap
      rgbGen identity
    }
    {
		map models/natter/Rest.tga
		blendFunc GL_DST_COLOR GL_ZERO
     	rgbGen identity
	}
}

models/natter/flashen_lm
{
	qer_editorimage models/natter/flashen.tga
	q3map_baseshader textures/natter/lm_model_base
	q3map_shadeAngle 225
	{
      map $lightmap
      rgbGen identity
    }
	{
		map models/natter/flashen.tga
     	blendFunc GL_DST_COLOR GL_ZERO
     	rgbGen identity
	}
}

are there more shader “tricks” to get smoother phong shading? :???:

btw this is for natterbase_dual(kind of second edition of my map)
… and sorry for the 16 bit looking pics. the latest detonator is just terrible


(ydnar) #2

The -filter switch blows away any real benefit to -samples.

The -filter switch also fails on complex seams (like the edges between different surfaces of your model).

Try increasing the lightmap resolution on the model shader (via _lightmapscale on the misc_model or q3map_lightmapSampleSize N on the model shader) and not using -filter.

BTW, shadeangle 180 is overkill and will lead to visual glitches where it tries to shade every vertex at that point.

y


(pazur) #3

i did remove the -filter and shadeangle is 120 instead of 180. q3map_lightmapSampleSize is still 4 because i dont want to this to be too excessive in lightmapusage.
compile command line for light: -light -fast -patchshadows -shade -super 2

what is going wrong?


(ydnar) #4

Not seeing what the problem is. Those shots look good. Perhaps one with r_lightmap 1?

y


(pazur) #5

at the place where the green arrow is the shading gets better(smoother). i want the shading to be as non facetted as possible. ydnar i hope u get what i mean.


(Loffy) #6

The game world in the pictures that you posted 02 Sep 2003 06:04 look nice. I think it is a cool model and I see nothing wrong with the textures.
(Excellent model by the way!)
// Loffy


(pazur) #7

thanks loffy. maybe i’m too perfectionist. but it seems to me that a hard seam on a round object looks unrealistic


(Matt) #8

I think you should redo the UVW map for the sub. It looks stretched a lot. A higher resolution map, plus better UVW coordinates should do the trick as far as that goes.

Also, you may want to consider using real shadows on your model. Create a scene in Maya or Max with similar lighting as the area of your map. You can then render out a shadow map which you can then apply to your texture. Then take the lightmap stage out of your model shader and it’ll look the best it can possibly look.


(pazur) #9

yea the uvw is a bit messed up. but thats only the camouflage paint. i also thought of doing it manually with taking a shadowmap and merging it into the texture. how do u do this in max?


(ydnar) #10

Well, phong shading can’t make up for the fact that there are no lights below the model. Phear my ASCII art:

|
|
|
|
V

|
___/

I’d suggest losing the high ambient or _minlight and using more/better lights. The map will look better anyway, with greater dynamic range of light/shadow.

y


(pazur) #11

gonna checkt that out. no ambient and clusters of low lights


(pazur) #12

ydnar. you are absolutely right :drink: ambient light is evil :wink: i had this in since i started making the natter map cause mp_beach was using it. i have to redo some lights and tweak some func groups, but now even the seams on the model are looking good.