Jump to content
Sign in to follow this  
ADuke

RVMAT for MFD (always bright)

Recommended Posts

Hi,

So in my latest helicopter fiasco I am trying to create an rvmat for an MFD screen when it is turned on.

Using examples from existing helicopters (ch-47) I came up with this...

#define _ARMA_

//Class mh1l_screen_bright.rvmat{

ambient[] = {1,1,1,1};
diffuse[] = {1,1,1,1};
forcedDiffuse[] = {0,0,0,1};
emmisive[] = {1,1,1,1};
specular[] = {0,0,0,1};
specularPower = 1.0;
PixelShaderID = "Normal";
VertexShaderID = "Basic";
class Stage1
{
texture = "#(argb,8,8,3)color(0.5,0.5,1,1,NOHQ)";
uvSource = "tex";
class uvTransform
{
 aside[] = {1,0,0};
 up[] = {0,1,0};
 dir[] = {0,0,0};
 pos[] = {0,0,0};
};
};
class Stage2
{
texture = "#(argb,8,8,3)color(0.5,0.5,0.5,0.5,DT)";
uvSource = "tex";
class uvTransform
{
 aside[] = {1,0,0};
 up[] = {0,1,0};
 dir[] = {0,0,0};
 pos[] = {0,0,0};
};
};
class Stage3
{
texture = "#(argb,8,8,3)color(0,0,0,0,MC)";
uvSource = "tex";
class uvTransform
{
 aside[] = {1,0,0};
 up[] = {0,1,0};
 dir[] = {0,0,0};
 pos[] = {0,0,0};
};
};
class Stage4
{
texture = "#(rgb,8,8,3)color(1,1.0,1.0,1,AS)";
uvSource = "tex";
class uvTransform
{
 aside[] = {1,0,0};
 up[] = {0,1,0};
 dir[] = {0,0,0};
 pos[] = {0,0,0};
};
};
class Stage5
{
texture = "#(argb,8,8,3)color(0,0,1,1,SMDI)";
uvSource = "tex";
class uvTransform
{
 aside[] = {1,0,0};
 up[] = {0,1,0};
 dir[] = {0,0,0};
 pos[] = {0,0,0};
};
};
class Stage6
{
texture = "#(ai,32,128,1)fresnel(0.01,0.01)";
uvSource = "tex";
class uvTransform
{
 aside[] = {1,0,0};
 up[] = {0,1,0};
 dir[] = {0,0,0};
 pos[] = {0,0,0};
};
};
class Stage7
{
texture = "#(argb,8,8,3)color(0,0,0,1,CO)";
uvSource = "none";
};
class StageTI
{
texture = "ca\air_e\ah64\data\ah64d_glass_ti_ca.paa";
};
//};

The problem that I have (in-game) is that when the sun is not shining in the direction of the screen, it gets very dimly lit, so much so that you can almost not make out what is on the screen.

In real life, these screens are always the same brightness, no matter if the sun is shining or not.

Has anyone come up with an rvmat that will keep a texture at the same brightness (very bright) no matter the light conditions?

Thanks,

-AD

Share this post


Link to post
Share on other sites

The issue isn't the brightness is changing but rather the lighting conditions are much brighter than the screen when the sun is shining on the panel. Real aircraft have dash shades to stop this problem. So while technically the numbers appear to get less bright, they are actually emitting the same amount of light, you just can't see it so well because the aperture of the 'eye' is constricted because it's too bright.

Another issue is that you've declared that you're using a "normal" shader with a "basic" pixel shader but you've got the render stages of a supershader. If you have the your specular map set to 0,0,0,1, you have no specular present so a shader without a specular map would be more appropriate I think, but that's not a big deal.

Edited by Max Power

Share this post


Link to post
Share on other sites

ambient[]={0.100000,0.100000,0.100000,1.000000};
diffuse[]={0.000000,0.000000,0.000000,1.000000};
forcedDiffuse[]={0.100000,0.100000,0.100000,0.000000};
emmisive[]={0.125490,1.000000,0.145098,1.000000};
specular[]={0.000000,0.000000,0.000000,0.000000};
specularPower=0.000000;
nextPass="ca\data\data\flash-pass2.rvmat";
PixelShaderID="Normal";
VertexShaderID="Basic";

Try that. Its the green glow I use on the Typhoon HUDs.

The lighting engine is a bit iffy then it comes to low glowing lights etc. This is the line to play with.

emmisive[]={0.125490,1.000000,0.145098,1.000000};

Edited by RKSL-Rock
Added the "low glowing" for clarifcation

Share this post


Link to post
Share on other sites
The issue isn't the brightness is changing but rather the lighting conditions are much brighter than the screen when the sun is shining on the panel. Real aircraft have dash shades to stop this problem. So while technically the numbers appear to get less bright, they are actually emitting the same amount of light, you just can't see it so well because the aperture of the 'eye' is constricted because it's too bright.

Another issue is that you've declared that you're using a "normal" shader with a "basic" pixel shader but you've got the render stages of a supershader. If you have the your specular map set to 0,0,0,1, you have no specular present so a shader without a specular map would be more appropriate I think, but that's not a big deal.

OK, thanks for the reply.

Funny thing is that when I changed from the "super" to the "basic" pixel and vertex shaders, the lighting seemed to have improved.

But ya, you're right, those stages shouldn't be there.

Try that. Its the green glow I use on the Typhoon HUDs.

The lighting engine is a bit iffy then it comes to lights. This is the line to play with.

emmisive[]={0.125490,1.000000,0.145098,1.000000};

Thanks a lot, I will use that and see what happens.

-AD

Share this post


Link to post
Share on other sites

ambient[]={0.100000,0.100000,0.100000,1.000000};

diffuse[]={0.000000,0.000000,0.000000,1.000000};

forcedDiffuse[]={0.100000,0.100000,0.100000,0.000000};

emmisive[]={0.125490,1.000000,0.145098,1.000000};

specular[]={0.000000,0.000000,0.000000,0.000000};

specularPower=0.000000;

nextPass="ca\data\data\flash-pass2.rvmat";

PixelShaderID="Normal";

VertexShaderID="Basic";

That RVMAT worked perfectly, thanks again!!

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×