Jump to content
Sign in to follow this  
rocket

Preventing Shading on Alpha'd Texture

Recommended Posts

Hi guys,

I have an alpha'd texture I am using on a face to model the blurred propellers of my C130.  I found that the face had a shadow cast on it from other aircraft components, so I edited the RVMAT as follows:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

ambient[] = {1, 1, 1, 1};

diffuse[] = {1, 1, 1, 1};

forcedDiffuse[] = {0, 0,0,0};

emmisive[] = {0, 0, 0, 1};

specular[] = {0, 0, 0, 1};

PixelShaderID = "Normal";

VertexShaderID = "Basic";

renderFlags[] = {NoZWrite};

The result looks great, except that against water it does not show up (see below).  Does anyone have any suggestions how to prevent a shadow being cast on a material without using the render flag NoZWrite?

c130_prop_error.jpg

Share this post


Link to post
Share on other sites

renderFlags[]={"NoZWrite","AddBlend"};  ... i think... off the top of my head... maybe wrong though...

Sorry... you might try using PixelShader="AlphaShadow"; or PixelShader="AlphaNoShadow"; (as desired) either with the above renderFlags or without...

Share this post


Link to post
Share on other sites

Hey icemotoboy, what did you get to work ?

I'm having a hell of a job trying to get my blurs to work correctly over water .... sad_o.gif

Share this post


Link to post
Share on other sites

Hey Gnat, still having trouble here. I have come up with a best balance solution. I can still see the blur, but its much fainter over water than anywhere else. This picture doesn't show it too well, much better when its in motion:

usec_c130_080911_1.jpg

I used the following code in the RVMAT:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

ambient[] = {0.0, 0.0, 0.0, 5.0};

diffuse[] = {0.0, 0.0, 0.0, 1.0};

forcedDiffuse[] = {0.05, 0.05, 0.05, 0.0};

emmisive[] = {0.5, 0.5, 0.5, 1.0};

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

specularPower = 0.0;

renderFlags[] = {"NoZWrite", "NoAlphaWrite", "AddBlend"};

PixelShaderID = "Normal";

VertexShaderID = "Basic";

Have tried as many combination as I can think of. Have been having quite a few sorting issues at the moment!

Share this post


Link to post
Share on other sites

your 1 and only blur proxy model lod should feature 'lodnoshadow=1' and 'autocenter=0' properties.

should point to primary diffuse colour alpha texture ( '_ca' ) and a primary prop blur material that looks something like...

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">ambient[]={1,1,1,1};

diffuse[]={1,1,1,1};

forcedDiffuse[]={0,0,0,1};

emmisive[]={0,0,0,1};

specular[]={0,0,0,1};

specularPower=1;

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

PixelShaderID="Normal";

VertexShaderID="Basic";

Note the 'nextPass' material property. Either have it point at the above 'sklo-pass2.rvmat' or at the 'glass_2pass.rvmat' (these are standard BIS rvmats and both can be found in the ca.pbo) or point it at your own version of the file with an appropriate name like 'rotor_blur_2ndpass.rvmat'.

Either way the second rvmat material should look something like...

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">ambient[]={1,1,1,1};

diffuse[]={1,1,1,1};

forcedDiffuse[]={0,0,0,0};

emmisive[]={0,0,0,1};

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

specularPower=0;

PixelShaderID="AlphaShadow";

VertexShaderID="Basic";

renderFlags[]={"NoColorWrite"};

The above is pretty much the 'standard' way the BIS aircraft rotor blurs are done. There are a couple of subtle variations to this with some aircraft but by and large they use a first pass material and then a second pass material.

I'm sure you both already know this... but icemotoboy's material didn't feature the 2nd pass so I'm just reiterating the point if you'd forgotten.

Share this post


Link to post
Share on other sites
I'm sure you both already know this

lol .... I seem to have far less time to research all this stuff than you seem to have ever had wink_o.gif

No, much of this stuff is a new areas of play for me.

I didnt have the problem with the blur until I changed the LOD properties such that I could get self-shadow working below 20m above ground (you may recall a bug with my beta 1 release of the V22). As usual, fix 1 problem, create another.

@icemotoboy

Yes, that was the best result I also got, but my blur was far to light and I would have to redo it if I was to continue using this method.

Thanks for the reply.

@Synide

"blur proxy model" ..... hmmmmmm

There is likely a big part of the issue. I'm not using a blur proxy. The blurs are in the same model p3d.

Yes I know BIS do it this way and there is every chance it will solve the issue(s) (because its a different p3d with different LOD properities), but I was putting off and putting off trying this method because of the extra work.

Maybe I should bite the bullet and go down the proxy blur path.

Thanks guys ... thinking time for me wink_o.gif

Share this post


Link to post
Share on other sites

yeah... there's only one (possibly more) BIS aircraft model that's uses the blur as part of the main model i think... the rest use the proxy blur...

Share this post


Link to post
Share on other sites

Small update.

Finished changing to the "proxy rotor" method on the V22 models.

Worked well and was actually very simple to do, with no side-effects as yet.

Even with the V22 tricks (tilting rotor etc) it still works !

The benifits (including self shadow on model below 25m altitude) well outweigh the little work to do it biggrin_o.gif

Share this post


Link to post
Share on other sites

Hmmm, this sounds like a problem i'm having with my car's windows.  My windows has the shadows casted on them and it makes them look horrible, .esp in the inside.  Any suggestions on how to not have the shadows casted on the windsheild? talk to me like i'm a retard when it comes to .rvmat files. this is my window .rvmat.

Quote[/b] ]ambient[] = {1,1,1,1};

diffuse[] = {1,1,1,1};

forcedDiffuse[] = {0,0,0,0};

emmisive[] = {0,0,0,1};

specular[] = {1,1,1,0};

specularPower = 5;

renderFlags[] = {"NoAlphaWrite"};

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

PixelShaderID = "Glass";

VertexShaderID = "Glass";

class Stage1

{

texture = "#(ai,64,64,1)fresnelGlass()";

uvSource = "none";

};

class Stage2

{

texture = "ca\wheeled\data\env_co.paa";

uvSource = "none";

};

//};

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  

×