Jump to content

Shader window vehicles ( too light texture)


Artyom888

Recommended Posts

Hi gentlemen, I have a problem with lighting the texture, it is lighter than everyone

mta-screen-2019-12-01-20-45-53.png

 

Please tell me what the problem is

 

I use these shaders

/* 
    Author: 50p 
    Version: v1.0 
    Description: 
     This shader allows you to mask a texture with a mask texture (black and white). 
*/ 
  
  
texture ScreenTexture; 
sampler implicitInputTexture = sampler_state 
{ 
    Texture = <ScreenTexture>; 
}; 
  
texture MaskTexture; 
sampler implicitMaskTexture = sampler_state 
{ 
    Texture = <MaskTexture>; 
}; 
  
  
float4 MaskTextureMain( float2 uv : TEXCOORD0 ) : COLOR0 
{ 
     
    float4 sampledTexture = tex2D( implicitInputTexture, uv ); 
    float4 maskSampled = tex2D( implicitMaskTexture, uv ); 
    sampledTexture.a = (maskSampled.r + maskSampled.g + maskSampled.b) / 3.0f; 
    return sampledTexture; 
} 
  
technique Technique1 
{ 
    pass Pass1 
    { 
        AlphaBlendEnable = true; 
        SrcBlend = SrcAlpha; 
        DestBlend = InvSrcAlpha; 
        PixelShader = compile ps_2_0 MaskTextureMain(); 
    } 
} 

 

Edited by Artyom888
Link to comment
12 hours ago, JustinMTA said:

Is the car body and the windows both using the shader code you provided?
If so this is could be a model related issue regarding the DFF file.
Let me know?

Yes, I use a shader on the back of the car exactly the same as you wrote me.                                            
The problem is that on the windows of the car I use the texture for uv (black) I would like to hide it and leave the stickers. 

(sorry for my English)

Link to comment
  • Administrators

I think an easy fix would be setting the brightness of shaders which are applied on windows to 0.45 or 0.5, the former value is equilevant to vehicle surface material's.

Another would be (in Max) setting the Ambient value of the window material to 0.45 or 0.5 (whatever value used by vehicle surface) but this requires editing the model.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...