Jump to content

Self-illuminating shader


launemax

Recommended Posts

Hy guys,

can anyone please help me in creating a shader, that self-illuminates an object?

I have the following problem:

I want to see a ped with his full texture and not shadowed on one site. In my case its a screen pointing against the sun and so the ped, i want to see, is half darken. Is there a way to disable light influences for an object by a shader?

Thanks for your help in advance,

Launemax :)

Link to comment
Hy guys,

can anyone please help me in creating a shader, that self-illuminates an object?

I have the following problem:

I want to see a ped with his full texture and not shadowed on one site. In my case its a screen pointing against the sun and so the ped, i want to see, is half darken. Is there a way to disable light influences for an object by a shader?

Thanks for your help in advance,

Launemax :)

This resource has been made to eliminate any directional light influence on objects:

https://community.multitheftauto.com/index.php?p= ... s&id=10186

You might try to apply the effect on peds to see if it does the job.

Otherwise if you like to see only bright ped texture - with no vertex colors at all - you might try this effect:

float rgbBright = 1.0; 
texture gTexture0           < string textureState="0,Texture"; >; 
  
sampler Sampler0 = sampler_state 
{ 
    Texture = (gTexture0); 
}; 
  
//------------------------------------------- 
// Pixel Shader 
//------------------------------------------- 
  
float4 PSFunction(float4 TexCoord : TEXCOORD0, float4 Position : POSITION, float4 Diffuse : COLOR0) : COLOR0 
{ 
    float4 Tex = tex2D(Sampler0, TexCoord.xy); 
    Tex.rgb *= rgbBright; 
    Tex.a *= Diffuse.a; 
    return saturate(Tex); 
} 
  
technique Techinque0 
{ 
    pass p0 
    { 
       AlphaBlendEnable = TRUE; 
       PixelShader = compile ps_2_0 PSFunction(); 
    } 
} 

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