Page 1 of 1

Lightmaps with models

Posted: Tue Sep 20, 2011 4:07 pm
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?

Re: Lightmaps with models

Posted: Tue Sep 20, 2011 5:03 pm
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".

Re: Lightmaps with models

Posted: Tue Sep 20, 2011 6:32 pm
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.

Re: Lightmaps with models

Posted: Tue Sep 20, 2011 7:38 pm
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.

Re: Lightmaps with models

Posted: Tue Sep 20, 2011 8:04 pm
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.

Re: Lightmaps with models

Posted: Tue Sep 20, 2011 8:19 pm
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.

Re: Lightmaps with models

Posted: Tue Sep 20, 2011 8:21 pm
by obsidian
Ah, I see.

You may also need to play around with q3map_shadeAngle and q3map_lightmapMergable in the shader.

Re: Lightmaps with models

Posted: Tue Sep 20, 2011 8:53 pm
by lukesmith
Oh great thanks.