Page 1 of 1
Q3 - Smoother shading on edges?
Posted: Fri Dec 01, 2006 11:48 am
by ALMighty
Is there a way to get smoothershading on edges in Q3, like when you use smoothgroups in 3DStudioMax or Hammer? Here's a screenshot of what I'm talking about.
I would like the lighting to be more smooth on angles in world geometry. Can you maybe write a shader to smooth it out?
Posted: Fri Dec 01, 2006 1:03 pm
by $NulL
Add these to the main body of a shader:
q3map_nonplanar
q3map_shadeAngle 120
120 is the cut off angle for smoothing between faces. 120 should be enough for that model, but if your still getting harsh shading you can try raising it.
Posted: Fri Dec 01, 2006 2:21 pm
by Silicone_Milk
That's news to me.
Good to know!
:icon14: :icon14:
Posted: Fri Dec 01, 2006 3:00 pm
by obsidian
Is that a model? You should be able to just use smoothing groups in MAX or whatever modeling program you use and it'll work in Q3.
Posted: Fri Dec 01, 2006 10:22 pm
by ALMighty
It's an .ase model, generated from a .map file with q3map2. Seems shaders don't work with .ase models, all I get is a fullbright model.
Posted: Sat Dec 02, 2006 3:17 pm
by obsidian
Shaders will work with ASE models. See the archives sticky link here:
http://www.quake3world.com/ubb/Archives ... 26044.html?
But like I said above, you shouldn't need a shader if all you want to do is get smoothing to work between vertex lit models.
shadeAngle will only work with lightmapped geometry anyway, and for something small like this, you probably don't want it lightmapped.
Posted: Mon Dec 04, 2006 7:32 am
by ALMighty
obsidian wrote:Shaders will work with ASE models. See the archives sticky link here:
http://www.quake3world.com/ubb/Archives ... 26044.html?
But like I said above, you shouldn't need a shader if all you want to do is get smoothing to work between vertex lit models.
shadeAngle will only work with lightmapped geometry anyway, and for something small like this, you probably don't want it lightmapped.
Is there a way to make geometry or .ase models vertex lit instead of lightmapped?
Posted: Mon Dec 04, 2006 9:20 am
by Black_Dog
Models will be vertex lit by default. You lightmap them by compiling with -meta and adding the keyval "spawnflags n" (n=2, lightmapped; n=6, lightmapped and autoclipped) to your model entity.
Posted: Mon Dec 04, 2006 10:18 am
by ALMighty
Black_Dog wrote:Models will be vertex lit by default. You lightmap them by compiling with -meta and adding the keyval "spawnflags n" (n=2, lightmapped; n=6, lightmapped and autoclipped) to your model entity.
When I compiled without any shader and just textures, my .ase models were all fullbright. I then added in the shader that it should be compiled with -meta, and now it's lightmapped. Are you sure .ase models are vertex lit by default? Because they weren't lit at all for me. Maybe I did something wrong.
Posted: Mon Dec 04, 2006 4:12 pm
by obsidian
Yes, models are always vertex lit by default. Generally speaking, small models with relatively large number of polygons should not be lightmapped. Vertex lighting in these cases will actually look better and reduce memory usage.
Posted: Mon Dec 04, 2006 5:10 pm
by ALMighty
obsidian wrote:Yes, models are always vertex lit by default. Generally speaking, small models with relatively large number of polygons should not be lightmapped. Vertex lighting in these cases will actually look better and reduce memory usage.
Well, as I said mine were fullbright by default. Either you are wrong or I am doing something wrong. I have a feeling of the latter.
Posted: Mon Dec 04, 2006 6:01 pm
by ALMighty
Hmm, now when I deleted the shader I can't recreate what I first got with the fullbright models. Now they are lightmapped even though I deleted the shader file. Strange.
Posted: Mon Dec 04, 2006 6:23 pm
by seremtan
why don't you just use gmax with the md3 export pipeline? that way you can have all the smoothing you want
Posted: Tue Dec 05, 2006 12:18 am
by Shallow
Really, you should always import exported .ase models into a model program and clean them up before using them as a mapobject. Q3map2's .ase conversion is damned useful but it's an automatic process, so there is only so much it can do - .ase's straight out of it will have way more submeshes and verts than they need too. And of course no smoothing, as you've discovered. Human intervention will give a much better end result.
Posted: Tue Dec 05, 2006 3:42 pm
by obsidian
ALMighty wrote:Hmm, now when I deleted the shader I can't recreate what I first got with the fullbright models. Now they are lightmapped even though I deleted the shader file. Strange.
If the model was lightmapped, you will need to recompile to see the changes. Lightmaps are stored in the BSP.
Posted: Tue Dec 05, 2006 4:36 pm
by ALMighty
obsidian wrote:ALMighty wrote:Hmm, now when I deleted the shader I can't recreate what I first got with the fullbright models. Now they are lightmapped even though I deleted the shader file. Strange.
If the model was lightmapped, you will need to recompile to see the changes. Lightmaps are stored in the BSP.
Yeah, I did that. Duh.
The thing is, I want everything to look consistent so that's why I've resisted using md3's. I have tried having one of those already, and I didn't like how it looked, it looked like it didn't fit in somehow. I should try doing that again though, because it was some time ago and I think I didn't render the texture right that time.
Thanks everyone for the help.