Jump to content

How to avoid the BlackMD3 issue shaders


Recommended Posts

Posted

This is a little discover i make these days making the shaders of my cathedral. the building is a collage of a large ampunt of misc_model parts into MD3 format.

After i studyied the Q3 shaers manuals, i discover this:

if you make a shader using the $lightmap rgbgen identity parm

and you apply the lightning specular parms on your md3 models, you can have a issue into the compiled map when the misc_models are black. that's is already knew by many people. so after the map is read many men convert misc_model into misc_model_static, the misc_model_static entity avoid the black issue.

i discover how make a nice shader on MD3 model using the misc_model entity, (not marks on solid, or map building time are increased because they are stored as structural! make a physic clippers around md3 instead!)

however, this is the way for the problem: 

- if you make a glm model. use lightingdiffuse and lightingspecular commands for make his shader, tha'ts is fine for weapons and characters. :)

- if you make a brush, use as shader this on the texture:

 

textures/cda/lastricato6b
{
    qer_editorimage    textures/cda/lastricato6b
    q3map_material    tiles
    q3map_onlyvertexlighting
    surfaceparm    nonopaque
    {
        map $lightmap
        rgbGen    identity
    }
   {
        map textures/cda/lastricato6b
        blendFunc GL_ONE GL_ZERO
        detail
        rgbGen identity
    }
   {
       map textures/cda/lastricato6b
        blendFunc GL_DST_COLOR  GL_ZERO
        detail
        rgbGen identity
    }
}

 

you can combine GL_ONE, GL_ZERO and GL_DST_COLOR into the enter blendfunc and GL_ONE, GL_ZERO, GL_SRC_COLOR into the second blendfunc paramter for make the texture more bright, dark, or opaque. ;)

 

on an MD3 i have applied the same textures, also with a different path into the md3 folders.

you can get an exceptional shaders of MD3 files using this variant:

 

models/map_objects/cda/lastricato6b
{
    qer_editorimage    models/map_objects/cda/lastricato6b
    q3map_material    tiles
    q3map_onlyvertexlighting
    surfaceparm    nonopaque
    {
        map $whiteimage
        rgbGen    vertex
    }
   {
        map models/map_objects/cda/lastricato6b
        blendFunc GL_ONE GL_ONE
        detail
        rgbGen vertex
    }
   {
       map models/map_objects/cda/lastricato6b
        blendFunc GL_ONE  GL_SRC_COLOR
        detail
        rgbGen vertex
    }
}

 

simply use rgbgen vertex instead of identity and whiteimage instead of lightmap, and you can use also misc_model entity into the map. into the game, the misc_model entities of the BSP are not black and darker but they are full of ambiental light.

rgbgen identity is for brush, vertex for MD3

lightmap is for brush, whiteimage for MD3

 

 

Lazarus likes this
Posted

The black model issue is purely due to the shader, nothing else I can figure beyond that.  Doesn't happen to all models also so that's what I point to as the culprit.  Easy fix for that is I would say if you're doing any kinda personal map, setup models SPECIFIC for the map itself and tweak the shaders of those specific models. 

 

That simply means that you take base models, you resetup the texture paths to the new folder, and do new specific shaders to the model.  This is purely so people don't run into alterations to base files, which is a pet peave of mine and I'm sure it annoys some people almost as badly as people forgetting to put textures in there pk3 files and people test out a map but are missing the files less they download the extra specific files.

 

misc_model_static works fine in general BUT the problem you may run into with that also is the lightmap doesn't build around it in the same way as a misc_model because misc_model itself is basically baked into the map like the brush work.  misc_model_static is basically an ent placeholder and the model is put into the map after the fact so the lighting wont effect it in the same way.  But if you do say custom shiny shaders and so forth on a model, can kinda texture so people overlook the lighting difference and blend it in, sorta.  But you can basically use same shaders on textures that you do models.  So a shader with a simple glow in the shader path will work the same on a standard model.

 

Can probably go lazier and just put your models in with your standard texture path and have it all ready from 1 folder instead of a specific model folder if you want to kinda improve map loading times, slightly.  Little tricks like that can streamline the process more.  But I wouldn't recommend more hands on stuff like that till you really know your way around the basics.  Simply because people who edit your files (it will happen no matter what you say or do) might get confused as to why you did certain things and so forth.

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