Phong shading unworkingness


(cloudscapes) #1

Somewhat noob question here. :expressionless: Trying to get smooth shading on a collection of brushes vertex edited into a terrain:

http://nearworlds.digitalrice.com/stuff/phong.jpg
(may need to copy/paste the url if you get a not found error. this host doesnt support hot-linking)

This is the best I can get it. Made no difference grouping the brushes or no. -shade switch used in compile of course. And here’s my shader. Hopefully someone will spot my mistake. Thanks to |NV|S for the tut getting me thus far. :slight_smile:


textures/re_outdoor/palegrass_ld_cloud
{ 
      qer_editorimage textures/re_outdoor/palegrass_ld_cloud.tga
      q3map_nonplanar
      q3map_shadeangle 120  
      { 
             map textures/re_outdoor/palegrass_ld_cloud.tga 
             rgbGen identity 
      }
      { 
             map $lightmap 
             tcGen lightmap 
             blendFunc GL_DST_COLOR GL_ZERO 
             rgbGen identity 
      } 
}


(ydnar) #2

Image no workingness…


(cloudscapes) #3

Ya, just edited my message to mention that you may have to copy and paste the url instead of clicking on it. if it still doesnt work Ill make a quick page for it.


(cloudscapes) #4

What the hell, made one anyway. :slight_smile:

http://nearworlds.digitalrice.com/stuff/phong.html


(ydnar) #5

Make sure the shader is listed in shaderlist.txt


(cloudscapes) #6

That’s done I’m afraid. :\ However I did comment out the default Q3A shaders (base_wall, etc) because I never used them and they just cluttered up my shader menu. I kept common obviously. I doubt this would of caused a problem but you never know. Also, the sun is a shader sun and is positioned more or less from the same direction as I’m looking, about 40 degrees in the sky. When you look at it the borked brushes in the screenshot are probably the ones facing most away from the sun.


(wudan) #7

It looks phong shaded to me …

Your angle of the sun may be too steep, but on the triangle on the left, looks like a smooth transition. To get smoother, make more triangles (bad bad bad).

ydnar probably has some extra stuff you can try.

Try messing with samplesizes and scales. Phong will still smooth over the lightmap. When light gets into the smoothness zone, it actually can be pretty tricky to make it do things that it isn’t currently doing …

I don’t think that made sense :frowning:


(ydnar) #8

Are you using -meta in your BSP compile?


(cloudscapes) #9

wudan: I’ve seen much better shading than that. In fact I had looked at invis’ tutorial on the subject (currently offline) with really nicely shaded slopes and stuff! It was as steep in some palces as mine I think.

ydnar : always do :slight_smile:

I’ll try the samplesizes when I get home. if that still doesnt help I’ll try tinkering with the shape of the terrain.


(ydnar) #10

Well, from the shot, it ain’t meta and it ain’t phong shading. It’s got nothing to do with the sun angle cuz those hard lines are not what that’d do.

Either the shader is borked, there’s a duplicate somewhere (check your PK3s!) or it’s not being picked up by Q3Map2.

Sorry… :slight_smile:

y


(cloudscapes) #11

sigh argh. :banghead: well I know there isnt any dublicate, it’s completelly new. I guess I can only try re-making the terrain now.

thanks


(cloudscapes) #12

Ok I just fixed it, and it was really dumb on my part! My BIG bad. :stuck_out_tongue: Sure I had re_outdoors in my shaderlist, but that wasn’t the filename of my .shader! Which was re_gates, the actual map name rather than the texture/shader set name.

my bad my bad sorry for the spam :stuck_out_tongue: :stuck_out_tongue: :stuck_out_tongue: :stuck_out_tongue:


(RabidCow) #13

Have you tried the global switch for phong (using the command line and q3map2)? The reason I ask is that I experimented quite a bit with it a couple of months ago and I found that using q3map_shadangle 120, for instance, in a shader, did not even come close to the results that I achieved with -shade -shadeangle 120. Now, before you point to the shader not being used, I commented out my normal terrain shader parameters and added the phong stuff, in the same shader that was normally working. It did work, just not even close to as well. Using the global switch is totally KICKASS! Sure there are a few little problems…some stuff that has a sharp corner can look rounded, from some positions on the map, but on a mainly terrain map, that really is not that much of a problem. I have to admit that I found q3map_nonplanar to reduce the quality of the shader enabled results. I also found that ambient light greatly improved the results. If you add ambient early in the creation of a map, you can build everything else with that in mind. It can’t always be used, but in outdoor maps it can really help fine tune the results.

Now Ydnar can correct me :slight_smile: Haha, there’s always something you miss, so I expect it :). Good luck! :slight_smile:

BTW, the q3map2 ā€œhackā€, that provides the static shadows on terrain, is also KICKASS! I mean, the results on ut_twinlakesv2, using an external lightmap of 512x512 are better than the same map using phong shaded non-terrain brushes. That is just the static shadows…disregarding the other slight deficiencies caused by the lack of blending of the textures. The shadows of the trees and hills is more realistic with the ā€œhackā€ than what the quake 3 engine does with normal brushes! Congrats Ydnar! I am totally impressed :slight_smile:


(|NV|S) #14

Cloudscapes, sorry about my Site being down. The tutorial I put up was just a general example. I tried the global shade for streets2 and decided that it wasnt worth it.

As far as the global switch working better than the shader, well I didnt notice a difference in the way the terrain looked. Since my map just has small terrain patches this system worked fine for me. But if your entire map is terrain than you may have to modify it for yourself.

Here is an example of a peice of the terrain (unfinished of course)

http://www.s8s.info/screenshots/streets47test1.jpg


(system) #15

I ant to try phong-shading too. Where can i get Infos about it??
A sample would be enought. :slight_smile: