Quake3World.com Forums
     Level Editing & Modeling
        What is the best way to apply shader to mapobject model?


Post new topicReply to topic
Login | Profile | | FAQ | Search | IRC




Print view Previous topic | Next topic 
Topic Starter Topic: What is the best way to apply shader to mapobject model?

The hell good boy
The hell good boy
Joined: 22 Jun 2011
Posts: 1922
PostPosted: 08-18-2019 11:04 PM           Profile   Send private message  E-mail  Edit post Reply with quote


Hi. I was looking to stock q3 mapobject models shaders and saw quite inconsistency where they use rgbgen vertex, somewhere they use rgbgen identity (but no lightmap), and somewhere they use rgbgen lightingdiffuse. And yes, I was looking only to mapobject models (models used in stock maps).

So I am asking you, what's the best way to deal with lighting of mapobject models? Apparently all methods work, but I guess that each model has different usage in each map, so one way of lighting may differ from another.

Generally speaking, what way of lighting of mapobject model shader would you recommend me for let's say a jumppad? What for model of radio eqipment? Both models are very different. Both will emit light, but jumppad will have two textures: the base, which will emit light, and holo effect, which will act like a light particle, so no lightmap and generally no lightmap will be required and it will be actually lighted by white image in full strength (100%). Radio equipment will be on the other hand consisting of only one texture (two, but combined together on a single mesh, consisting of two parts: the body and the antenna; the shader will have glowing light effect). I am going to use these models for the upcoming map Schöna (yes, I know, it takes really too long to finish the map, but complications have arised and too much things to do aside).

However, I want to use that guide for next models, namely also the model of a car, Chevrolet Camaro lowpoly model I was constructing some time ago and that went quite wrong with texture projection. I have to rebuild it by hand. But here's the thing: I want to make the shader to both have tinted glass effect (non-transparent, but glossy), and lights glowing. The shader itself however won't emit any light, because the lights I want it to emit are let's say quite complicated. Front lights are bright white (xenon lights), however rear lights are dim red. So the shader itself won't emit any light and the emited light is entirely up to map maker to correctly assign the color and direction of the lights. The lights also need to emit light around the object itself, so the model should look like it's lighted properly.

So generally speaking, I am looking for a list of usable ways and their recommended usage on some types of mapobject models, maybe including some typical examples that would say what the model type actually is. Something like this:
  • lightingDiffuse => small objects, moveable (e.g. radio equipment, hairbrush, etc.)
  • vertex => smaller objects, immoveable (e.g. light fixtures, control lights, etc.)
  • identity => large objects, moveable or not (e.g. car models, jumppads, etc.)
Only something to catch on, how I imagine the list. The actual list may look different, but the general idea is what drives me right now.

Please, do you know some general way of lighting models? Because I had an issue with lighting the camaro model, it appeared as full bright, completely ignoring map lighting...



_________________
[ Websites | Facebook | Twitter | YouTube | Instagram ]
When you feel the worst, turn to the sun and all the shadows will fall behind you.” - John Lennon


Top
                 

Insane Quaker
Insane Quaker
Joined: 15 Feb 2010
Posts: 298
PostPosted: 08-19-2019 11:49 AM           Profile Send private message  E-mail  Edit post Reply with quote


Vertex: This should be your default light on static mapmodels.

exactVertex: like Vertex but more exact/brighter, just like the world looks. Use this if your mapmodel needs to fit perfectly into the surrounding environment.

lightingDiffuse: on dynamic mapmodels which are part of a (moving) entity, inserted with the model2 key. Like func_door, func_bobbing...


Pro tip: You can change the rgbGen values without recompiling the map. So it's easy to find the best value.



_________________
Q3A Maps - by sst13
Quake Live Workshop


Top
                 

The hell good boy
The hell good boy
Joined: 22 Jun 2011
Posts: 1922
PostPosted: 08-19-2019 11:18 PM           Profile   Send private message  E-mail  Edit post Reply with quote


Okay, thanks :) So it really is that easy? And models do not use any lightmap?



_________________
[ Websites | Facebook | Twitter | YouTube | Instagram ]
When you feel the worst, turn to the sun and all the shadows will fall behind you.” - John Lennon


Top
                 

Insane Quaker
Insane Quaker
Joined: 15 Feb 2010
Posts: 298
PostPosted: 08-20-2019 01:27 PM           Profile Send private message  E-mail  Edit post Reply with quote


You can force lightmaps on mapmodels by using "spawnflags 4". But this is only useful if the model has large triangles. Like terrain, big rocks or any other mapmodels with lower vertices desity.

For example, I used lightmapped models for the 2 pillars near the ammo boxes.
Image
(There are some details on the back side of the pillars and I had to rotate them to a very specific angle, not able to hit the grid anymore by using brushes.)



_________________
Q3A Maps - by sst13
Quake Live Workshop


Top
                 

The hell good boy
The hell good boy
Joined: 22 Jun 2011
Posts: 1922
PostPosted: 08-20-2019 10:33 PM           Profile   Send private message  E-mail  Edit post Reply with quote


So the lightmapped model is okay if I want to use it for like jumppad? Because jumppad has a large area, the only small tris are the border around.

Wait a minute. Those pillars are models? :O



_________________
[ Websites | Facebook | Twitter | YouTube | Instagram ]
When you feel the worst, turn to the sun and all the shadows will fall behind you.” - John Lennon


Top
                 

Insane Quaker
Insane Quaker
Joined: 15 Feb 2010
Posts: 298
PostPosted: 08-21-2019 01:11 PM           Profile Send private message  E-mail  Edit post Reply with quote


You can use vertex or lightmap. It may look different. Just choose the better result.
If it looks almost the same, go for vertex light, because it's a little bit more FPS friendly.

Yes, it sounds funny to make these simple pillars as models. But i had to rotate them by exactly 30° and the details (not visible in the screenshot) would not fit in the grid at this angle.



_________________
Q3A Maps - by sst13
Quake Live Workshop


Top
                 

I'm the dude!
I'm the dude!
Joined: 04 Feb 2002
Posts: 12498
PostPosted: 08-21-2019 09:10 PM           Profile Send private message  E-mail  Edit post Reply with quote


Lightmaps are just an image generated by the compiler filtered on top of the base texture. Small, low resolution textures. I think (IIRC) it defaults to 1 luxel (light pixel) per 8 grid units, compared to the default texture density of 2 texels (texture pixels) per 1 grid unit. Due to this reason, lightmaps look alright on large flat surfaces, generally worse on small non-axial surfaces.

Vertex lighting is just colour values stored per vertex. Imagine each vertex point storing not just XYZ coordinate values, but also RGB colour values as well. If you have a lot of vertexes in a high density, you have a lot of data to work with. For this reason, vertex lighting will look better on surfaces with a high vertex density in a relatively small area than lightmaps, but worse on large surfaces.

It all comes down to density. What can you get a higher density on in the same space: luxels or vertexes.



_________________
GtkRadiant | Q3Map2 | Shader Manual


Top
                 

The hell good boy
The hell good boy
Joined: 22 Jun 2011
Posts: 1922
PostPosted: 08-21-2019 11:55 PM           Profile   Send private message  E-mail  Edit post Reply with quote


Okay, definitely will try :)



_________________
[ Websites | Facebook | Twitter | YouTube | Instagram ]
When you feel the worst, turn to the sun and all the shadows will fall behind you.” - John Lennon


Top
                 
Quake3World.com | Forum Index | Level Editing & Modeling


Post new topic Reply to topic


cron
Quake3World.com
© ZeniMax. Zenimax, QUAKE III ARENA, Id Software and associated trademarks are trademarks of the ZeniMax group of companies. All rights reserved.
This is an unofficial fan website without any affiliation with or endorsement by ZeniMax.
All views and opinions expressed are those of the author.