Q3 - Smoother shading on edges?

Discussion for Level editing, modeling, programming, or any of the other technical aspects of Quake
Post Reply
ALMighty
Posts: 542
Joined: Sat Mar 02, 2002 8:00 am

Q3 - Smoother shading on edges?

Post 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.

Image

I would like the lighting to be more smooth on angles in world geometry. Can you maybe write a shader to smooth it out?
$NulL
Posts: 100
Joined: Wed Mar 27, 2002 8:00 am

Post 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.
Silicone_Milk
Posts: 2237
Joined: Sat Mar 12, 2005 10:49 pm

Post by Silicone_Milk »

That's news to me.
Good to know!
:icon14: :icon14:
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Post 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.
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
ALMighty
Posts: 542
Joined: Sat Mar 02, 2002 8:00 am

Post 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.
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Post 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.
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
ALMighty
Posts: 542
Joined: Sat Mar 02, 2002 8:00 am

Post 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?
Black_Dog
Posts: 61
Joined: Sat Aug 13, 2005 4:50 am

Post 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.
ALMighty
Posts: 542
Joined: Sat Mar 02, 2002 8:00 am

Post 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.
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Post 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.
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
ALMighty
Posts: 542
Joined: Sat Mar 02, 2002 8:00 am

Post 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.
ALMighty
Posts: 542
Joined: Sat Mar 02, 2002 8:00 am

Post 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.
User avatar
seremtan
Posts: 36011
Joined: Wed Nov 19, 2003 8:00 am

Post by seremtan »

why don't you just use gmax with the md3 export pipeline? that way you can have all the smoothing you want
Shallow
Posts: 167
Joined: Wed Feb 09, 2005 1:58 pm

Post 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.
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Post 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.
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
ALMighty
Posts: 542
Joined: Sat Mar 02, 2002 8:00 am

Post 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. :p

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.
Post Reply