Jump to content

Misc_Model_Static - the shadow and light


Recommended Posts

Posted

Ok so i have a roof like colloseum like to make the effect that it block sunlight:

shot0825.jpg

As You can see one of them is diffrent. This one is misc_model_static the rest - misc_models. And something is not right... And i find out after typing a cheat r_fullbright 1

shot0826.jpg

Yep ... It comepletly take no light from the map. Shadows too. I used the _rs and _cs option in all models but it doesnt effect on the model it effected on the map .

shot0827.jpg
shot0828.jpg

What option in gtk i must add to make it functioning like the misc_model? I want to use them more often because it rly accelerate the compiling.

Posted

They accelerate the compiling because they're not used when calculating the lightmaps.

 

When you add a  misc_model entity, the model triangles are embedded into the BSP file, and they are used as part of the lightmap calculations. Adding a misc_model_static adds a single entity to the BSP, telling the game engine "hey, there's a model here. draw model XXX". No triangles are added, so there is no lightmap on the model, nor does the model affect the lightmap.

 

EDIT: The best result you can achieve with the JKA engine is to ensure that the shader you use on your model has "rgbGen lightingDiffuseEntity". This will take into account the ambient lighting in the area it's placed, but still does not do anything with or to the lightmap.

Posted

They accelerate the compiling because they're not used when calculating the lightmaps.

 

When you add a  misc_model entity, the model triangles are embedded into the BSP file, and they are used as part of the lightmap calculations. Adding a misc_model_static adds a single entity to the BSP, telling the game engine "hey, there's a model here. draw model XXX". No triangles are added, so there is no lightmap on the model, nor does the model affect the lightmap.

 

EDIT: The best result you can achieve with the JKA engine is to ensure that the shader you use on your model has "rgbGen lightingDiffuseEntity". This will take into account the ambient lighting in the area it's placed, but still does not do anything with or to the lightmap.

Woooooooo so this sucks a bit :(

Maybe i will just change the texture to the color of the place where the lamps are and just use _remap to make them brighter when they are in the other place. It is sad it doesnt have any options with lightning ...

Posted

Make sure misc_model_static have these:

 

_rs

1

 

_cs

1

 

 

 

EDIT:

 

Just re-read and saw you tried this. I have no idea why this wouldn't work, sorry. :(

Posted

Hmm i know that the destroyed protocal in the tusken map is misc_model_static. I used it in my map too and it worked! (with lightjunior)
I will check shader of it for one reason - when i compiled it as the misc_model it was full black. So ... maybe as the Vulcan said there is a special shader for misc_model_static which can work

Posted

How the shader will look like when i want i glow too? And could someone explain why the textures is (in this situation) the main issue?

 

There are diffrent shaders for player models and MD3 models right? ( i remember that i wanted to make a spec shader for glm blaster and md3 and i use the same line in shaders for both. One loaded normally but the other one not).

Posted

mmm for tents, i write this shader...

 

models/map_objects/Sanct/banner
{
qer_editorimage models/map_objects/Sanct/banner
q3map_material Fabric
q3map_nolightmap
q3map_alphashadow
cull disable
deformvertexes wave 256 sin 0 0.5 0.2 0.6
{
map models/map_objects/Sanct/banner
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
depthWrite
rgbGen vertex
detail
}
}

 

for wood supports:

 

models/map_objects/necro/gcrank
{
qer_editorimage models/map_objects/necro/gcrank
q3map_material SolidWood
q3map_onlyvertexlighting
{
map $lightmap
rgbGen identity
}
{
map models/map_objects/necro/gcrank
blendFunc GL_DST_COLOR GL_ZERO
detail
rgbGen identity
}
}
Posted

mmm for tents, i write this shader...

 

models/map_objects/Sanct/banner
{
qer_editorimage models/map_objects/Sanct/banner
q3map_material Fabric
q3map_nolightmap
q3map_alphashadow
cull disable
deformvertexes wave 256 sin 0 0.5 0.2 0.6
{
map models/map_objects/Sanct/banner
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
depthWrite
rgbGen vertex
detail
}
}
 

for wood supports:

models/map_objects/necro/gcrank
{
qer_editorimage models/map_objects/necro/gcrank
q3map_material SolidWood
q3map_onlyvertexlighting
{
map $lightmap
rgbGen identity
}
{
map models/map_objects/necro/gcrank
blendFunc GL_DST_COLOR GL_ZERO
detail
rgbGen identity
}
}

It will work with model_misc_static?

Posted

You can try, but i am not much sure.for what i read about the shadering tutorial of JKA and Q3 engine, the $lightmap value should apply a lightmapping with some kind of simulation of lightingdiffuse on the model surface. if you use rgbgen identity without lightmap parm, the model is translucent... : \

I am again at beginning as shader writer. you can contact someone more expert of me, like @@Szico VII

Posted

You can try, but i am not much sure.for what i read about the shadering tutorial of JKA and Q3 engine, the $lightmap value should apply a lightmapping with some kind of simulation of lightingdiffuse on the model surface. if you use rgbgen identity without lightmap parm, the model is translucent... : \

I am again at beginning as shader writer. you can contact someone more expert of me, like @@Szico VII

 

 

I heard about using the model_misc_static but i didnt know it doesnt catch any light ._. i will check this shader tommorow maybe

  • 1 year later...
Posted

I guess, I'll bring this thread back to the light. But seriously I have a question regarding misc_model_static.

The issue is that I had to find a balance between using misc_model and misc_model_static in the map, where lots of objects are used at once. The thing is that some of the models turned black in specific cases, as described above in this thread. Changing the path to texture solved the problem, and everything seems just fine, except for the light and shadows now playing crazy games on the surfaces of such an object. When you move, you can see them switching sides, becoming more/less visible with each step.

I tried using _rs and _cs, but that didn't change anything. Looked through web in search of commands to apply on the surfaces, but found nothing useful... Perhaps I missed some.

Or perhaps I should do something with shaders, because the model I used for misc_mode_static is actually a plant. Anyone knows this issue?

Posted

I guess, I'll bring this thread back to the light. But seriously I have a question regarding misc_model_static.

 

The issue is that I had to find a balance between using misc_model and misc_model_static in the map, where lots of objects are used at once. The thing is that some of the models turned black in specific cases, as described above in this thread. Changing the path to texture solved the problem, and everything seems just fine, except for the light and shadows now playing crazy games on the surfaces of such an object. When you move, you can see them switching sides, becoming more/less visible with each step.

 

I tried using _rs and _cs, but that didn't change anything. Looked through web in search of commands to apply on the surfaces, but found nothing useful... Perhaps I missed some.

Or perhaps I should do something with shaders, because the model I used for misc_mode_static is actually a plant. Anyone knows this issue?

misc_model_static entities do not use lightmaps, so any _cs or _rs keys you use won't make any difference on them.

 

When you move, you can see them switching sides, becoming more/less visible with each step.

Can you make a video showing this? I'm having trouble imagining what you could mean.
Posted

@@Xycaleth

Well, I wasn't able to make a video, but I made several shots of one original object of JO/JA – imp_mine/control_panel.md3

The screens below show a md3 placed as misc_model_static, observed by the Player from several angels, as you move around. You can see, that the surface changes color (dark-blue to red, and vice versa). The object is not black (!), it's just the screens show the blue color differently on different monitors (I tried on two different machines), and red one is on the surface, because there is a red light entity in the same room just a bit aside from md3.

 

shot0808_zpsv0qjxia8.jpg

shot0804_zpsfzbwyp6i.jpg

shot0805_zpsjzcnwydc.jpg

shot0806_zpsurjvhfsi.jpg

 

This similar visual glitch takes place on other objects, specifically I tried it on plants (both from JA and new ones, made by myself).

Posted

Actually, it seems, the problem was about shaders... Only the objects with additional effects, applied by shaders, are affected by this problem. rgbGen lightingDiffuse resolves it though.

Bek likes this

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...