Jump to content

I need help with a specific shader.


Recommended Posts

Posted

Although at the moment I have not worked completely with the misc_model_breakable try to do some tests, everything related to the model and how it works is fine, the problem lies in the textures, specifically with the shader, the shader works as it should be, it works fine in the misc_model_breakable but not working in the misc_model, someone who knows about this please I ask you to help me, I tried to do it in a day, but I did not get it, I am not an expert in shaders, the truth is that I am quite new on this, but I'm sure someone here must know how to solve it or at least tell me that the engine can't fix it. Please I need help with this, I leave my current shader: 

models/e/db/car_ce_ea04
{
    qer_editorimage    models/e/db/car_ce_ea04
    q3map_tesssize    48
    qer_trans    0.5
    surfaceparm    trans
    surfaceparm nonopaque
    q3map_material    Glass
    q3map_nolightmap
    {
        map models/e/db/car_ce_ea04
        blendFunc GL_ZERO GL_ONE_MINUS_SRC_COLOR
    }
    {
        map models/e/db/car_ce_ea04
        blendFunc GL_ONE GL_ONE
    rgbGen lightingDiffuse
    }
}

This is the misc_model:

shaders

This is the misc_model_breakable:

shaders

As you can see, one glass becomes very opaque and the other does not, for example, this happens to me the other way around if you modified the rgbGen lightingDiffuse for an rgbGen vertex, the misc_model works but the misc_model_breakable does not (from certain angles the whole glass turns yellow , this only happens in a breakable but not in a static).

I hope someone can give me an idea or an improved copyable version to solve this problem, I await your answers and thanks in advance.

Posted
3 hours ago, scp_chaos1 said:

if you modified the rgbGen lightingDiffuse for an rgbGen vertex, the misc_model works but the misc_model_breakable does not

I think you'll need two different versions of the shader, one with vertex lighting for misc_model and one with lightingDiffuse for misc_model_breakable.

Posted

I must say that it is a good solution, but there must be a more optimal way, I say, I have many objects that are destined to be destroyed, and I think that if I have 300 I do not see very convenient to duplicate them, both because of the work of reopening them and to have a larger portion. Still this could certainly be the solution but as a last resort. That or as another option I would see the creation of a script that would do the same but for misc_model_static, since this error does not happen in these.

Posted

Well in my case not entirely, but hey, I have only done it with some slight modifications, it is incredible that all this time it was in front of me, here I leave both a capture and the shader:

Misc model:

shot0929

Misc_Model_Breakable:

shot0929

It was a little brighter, I suppose there must be a way to reduce this, but at the moment this is the result, at least it works for both:

The shader is this:

models/e/db/car_ce_ea04
{
    qer_editorimage    models/e/db/car_ce_ea04
    qer_trans    0.5
    surfaceparm    trans
    surfaceparm nonopaque
    q3map_material    Glass
    q3map_nolightmap
    {
        map models/e/db/car_ce_ea04
    blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
    rgbGen lightDiffuse
    }
}

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