Jump to content

The Better Marble Shader


Recommended Posts

i have a little question. I need to make into a dark map a little more bright light marble shader with a tcenviroment effect or something like that, so, walking, the marble has some reflex of circustamant light.

i try to use every kind of lighting diffuse, specular, tggen enviroment, GL_ONE, GL_ZERO GL_SRC_ALPHA GL_SRC_COLOR GL_DST_COLOR parameter, but my result are ever or too bright or too dark or with a fool enviroment (maybe becuase i use a wrong enviroment texture.

any suggest?

he's the shader code:

 

For window glass:

 

models/map_objects/cda/stainedglass
{
    surfaceparm trans
//    polygonOffset
    q3map_nolightmap
    q3map_novertexshadows
    surfaceparm nomarks //this will stop the game from rendering shadows and burnmarks on the decal//
    nopicmip
    {
        map models/map_objects/cda/stainedglass
        blendFunc GL_DST_COLOR GL_ZERO
        alphaGen const 0.7 //This is an optional line of code, that will make the texture more opague//
    }
 }
 

For flags, curtains, leather ornament

models/map_objects/cda/reaverflag
{
                  cull disable
    qer_editorimage models/map_objects/cda/reaverflag
    q3map_nolightmap
    q3map_alphashadow
                deformvertexes normal 0.15 0.1
                deformvertexes wave 256 sin 0 0.5 0.2 0.6
    {
        map textures/cda/reaverflag
        blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
        depthWrite
        rgbGen vertex
    }
}

 

For the marble:

models/map_objects/cda/marble2
{
    q3map_onlyvertexlighting
    {
        map models/map_objects/cda/marble2
        blendFunc GL_ONE GL_ZERO
        detail
    }
    {
        map models/map_objects/cda/marble2
        blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
        detail
        alphaGen lightingSpecular
    }
 {
         map $lightmap
        blendFunc GL_DST_COLOR GL_ONE_MINUS_DST_ALPHA
        rgbGen identity
     }
}

Link to comment

First off, i wanna tell that i am not an expert of the Shader system of JKA i know how to make a shader for a weapons, but i not know what is the proper code for marble, wood, bump stone, rock, walls, brick, glasses, grass and other material. i open this thread because i want to know what is the better code for each one of these materials.

@@AngelModder i want to make a clan map on an italian rpg about legacy of kain, with a cathedral builded around the pillars of nosgoth. a my friend has builded the MD3 models all cathedral are ported on radiant as MD3 on misc_model format at the moment. yes i know i need to convert with misc_model_static, but before of make i want to make shadering and also gameplay entity of map and relative physic clip of models.

all the cathedral is a giant collage of MD3 files, not solid, with a lartge amount of physic clip buind all over the entire structure. the map need 10 minutes for build the Meta and 45 MIn for build the light. this is the light map version, with a cloudy weather day.

i have 2000 and more light point inside the map, i want to fix some light issue, but before, i want to build all shader file of the map, because i not that shader are much important about how the light interacts with geometries.

and so i ask: how i need to make the better shade code for the following materials?

- wood

- marble

- stained glass

- stone

- bricks

- a rock tunnel

 

@@Lazarus no, i not have an alpha channel because i use JPG format.

AngelModder likes this
Link to comment

Hmm You can check the original assets for shaders. I always look at them to know how to do things. I dont know about any shade code. Maybe the fake bumpmapping would be nice for patches.

Thanks.- yesterday i downloaed by filefront the basic shadering tutorial. so now i know what mean GL_ONE, GL_ZERO, GL_DST_COLOR surfaceparm etc etc. :)

Link to comment

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