Lightmaps with models

Discussion for Level editing, modeling, programming, or any of the other technical aspects of Quake
Post Reply
lukesmith
Posts: 21
Joined: Sat Aug 20, 2011 8:14 pm

Lightmaps with models

Post by lukesmith »

I understand that gtkradiant will calculate shadows cast by models (md3, obj, etc) during the lighting phase. I was just wondering, will gtkradiant also create a lightmap for the model? using the uv coordinates of the model, so that static models can all be lit in the same way as the level geometry?
DaEngineer
Posts: 210
Joined: Fri May 28, 2010 2:30 pm

Re: Lightmaps with models

Post by DaEngineer »

You have to add the key "spawnflags" to the model via the entity menu (N-key while model is selected) and give it a value of "4".
[url=http://www.victorkarp.com]Portfolio[/url] - [url=https://victorkarp.com/tutorials/quake-3-mapping-tutorials/]My Quake 3 mapping tutorials[/url] - [url=http://www.lvlworld.com/author/DaEngineer]My Quake 3 maps[/url]
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Re: Lightmaps with models

Post by obsidian »

Just beware that most models will actually look better vertex lit. Lightmapped models only look good on models with large planar surfaces like terrain. First, lightmaps are projected axially; second, on most models with a relatively high level of tessellations and vertexes will actually have a better lighting fidelity than a comparatively lower resolution lightmap.
[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]
lukesmith
Posts: 21
Joined: Sat Aug 20, 2011 8:14 pm

Re: Lightmaps with models

Post by lukesmith »

I was thinking along the lines that if all static models are lightmapped I can gain even more speed by not having to calculate lighting for them and not having to calculate shadows they recieve from the level geometry. Ill try using a larger lightmap size for models and see how it looks.
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Re: Lightmaps with models

Post by obsidian »

Errr... vertex lighting is less system intensive than lightmaps. That's why Q3 has the option to turn off lightmaps and revert to vertex light only on lower end (circa 1999) systems.
[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]
lukesmith
Posts: 21
Joined: Sat Aug 20, 2011 8:14 pm

Re: Lightmaps with models

Post by lukesmith »

Im not doing this for quake3 but for a renderer that I have developed. So I thought it worth experimenting with lightmapping the staticmeshes otherwise any shadows that fall on the staticmesh would have to be calculated in realtime.
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Re: Lightmaps with models

Post by obsidian »

Ah, I see.

You may also need to play around with q3map_shadeAngle and q3map_lightmapMergable in the shader.
[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]
lukesmith
Posts: 21
Joined: Sat Aug 20, 2011 8:14 pm

Re: Lightmaps with models

Post by lukesmith »

Oh great thanks.
Post Reply