Jump to content
Sign in to follow this  
eggbeast

unit texture turns darker - any ideas how to fix?

Recommended Posts

ok we have one type of unit: our PBR crewmen who flicker dark and light when you rotate your head from side to side

screenie:

http://i162.photobucket.com/albums/t247/eggbeast/pbrcrew-1_zps73be4aad.jpg

it was made by yac some years ago and we can't work out how to fix it

some elements from the config:

class Uns_bw1: SoldierWB
etc
	model = "\Uns_pbrcrew\uns_bw1.p3d";
	class Wounds 
	{
		tex[] = {};
		mat[] = {"Uns_pbrcrew\data\bw1_hhl.rvmat","Uns_pbrcrew\data\bw1_hhl_w1.rvmat","Uns_pbrcrew\data\bw1_hhl_w2.rvmat","Uns_pbrcrew\data\bw1_body.rvmat","Uns_pbrcrew\data\bw1_w1.rvmat","Uns_pbrcrew\data\bw1_w2.rvmat"};      
	};                        

they use textures like this:

detail:

detale_co.paa

which looks like this - it has correct paa format and a completely white/blank alpha channel

http://i162.photobucket.com/albums/t247/eggbeast/detale_co_zpseb169db3.jpg

main body - again paa with blank alpha channel:

uns_bw1_co.paa

http://i162.photobucket.com/albums/t247/eggbeast/uns_bw1_co_zpsa68994d9.jpg

this seems to be the texture thats going black - notice in the screenie that the detail (belt) and hat dont change colour

ok so the rvmats look like this:

bw1_body.rvmat

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;
PixelShaderID="NormalMapMacroASSpecularMap";
VertexShaderID="NormalMapAS";
class Stage1
{
texture="uns_pbrcrew\data\uns_bw1_nohq.paa";
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,0,0,0)";
uvSource="tex";
class uvTransform
{
	aside[]={1,0,0};
	up[]={0,1,0};
	dir[]={0,0,0};
	pos[]={0,0,0};
};
};
class Stage4
{
texture="#(argb,8,8,3)color(1,1,1,1)";
uvSource="tex";
class uvTransform
{
	aside[]={1,0,0};
	up[]={0,1,0};
	dir[]={0,0,0};
	pos[]={0,0,0};
};
};
class Stage5
{
texture="uns_pbrcrew\data\soldier_body_as.paa";
uvSource="none";
};

flakjacket.rvmat

ambient[]={0.99999899,0.99999899,0.99999899,1};
diffuse[]={1,1,1,1};
forcedDiffuse[]={0,0,0,0};
emmisive[]={0,0,0,1};
specular[]={0.21960799,0.21960799,0.21960799,0.77999997};
specularPower=35;
PixelShaderID="NormalMapSpecularDIMap";
VertexShaderID="NormalMap";
class Stage1
{
texture="uns_pbrcrew\data\uns_bw1_nohq.paa";
uvSource="tex";
class uvTransform
{
	aside[]={1,0,0};
	up[]={0,1,0};
	dir[]={0,0,0};
	pos[]={0,0,0};
};
};
class Stage2
{
texture="uns_pbrcrew\data\uns_bw1_smdi.paa";
uvSource="tex";
class uvTransform
{
	aside[]={1,0,0};
	up[]={0,1,0};
	dir[]={0,0,0};
	pos[]={0,0,0};
};
};

kabura.rvmat

holster - works fine

ambient[]={0.99999899,0.99999899,0.99999899,1};
diffuse[]={1,1,1,1};
forcedDiffuse[]={0,0,0,0};
emmisive[]={0,0,0,1};
specular[]={0.21960799,0.21960799,0.21960799,0.77999997};
specularPower=35;
PixelShaderID="NormalMapSpecularDIMap";
VertexShaderID="NormalMap";
class Stage1
{
texture="uns_pbrcrew\data\detale_nohq.paa";
uvSource="tex";
class uvTransform
{
	aside[]={1,0,0};
	up[]={0,1,0};
	dir[]={0,0,0};
	pos[]={0,0,0};
};
};
class Stage2
{
texture="uns_pbrcrew\data\detale_smdi.paa";
uvSource="tex";
class uvTransform
{
	aside[]={1,0,0};
	up[]={0,1,0};
	dir[]={0,0,0};
	pos[]={0,0,0};
};
};

m1.rvmat

boonie hat - this works fine

ambient[]={0.99999899,0.99999899,0.99999899,1};
diffuse[]={1,1,1,1};
forcedDiffuse[]={0,0,0,0};
emmisive[]={0,0,0,1};
specular[]={0.286275,0.286275,0.286275,0.60000002};
specularPower=34.599998;
PixelShaderID="NormalMapSpecularDIMap";
VertexShaderID="NormalMap";
class Stage1
{
texture="uns_pbrcrew\data\m1_nohq.paa";
uvSource="tex";
class uvTransform
{
	aside[]={1,0,0};
	up[]={0,1,0};
	dir[]={0,0,0};
	pos[]={0,0,0};
};
};
class Stage2
{
texture="uns_pbrcrew\data\m1_smdi.paa";
uvSource="tex";
class uvTransform
{
	aside[]={1,0,0};
	up[]={0,1,0};
	dir[]={0,0,0};
	pos[]={0,0,0};
};
};

detale.rvmat

detail - this works fine

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};
specularPower=1;
PixelShaderID="Normal";
VertexShaderID="Basic";
class Stage1
{
texture="uns_pbrcrew\data\detale_nohq.paa";
uvSource="none";
};
class Stage2
{
texture="uns_pbrcrew\data\detale_smdi.paa";
uvSource="none";
};

is it a setting in the rvmats? or a missing alpha or a shadow setting in the model?

as themodel lights up fine when you look at it from one angle, i'm sure we can fix this with a change to maybe one line in config/rvmat... or maybe adding an alpha to a smdi or something - i have no idea...

has anyone seen this before?

much appreciated!

---------- Post added at 08:53 AM ---------- Previous post was at 08:36 AM ----------

here is a working unit body rvmat to compare - notice stage 3 is present and different and theres no stage 5

#define _ARMA_

//Class uns_usmc : data\us_soldier_body.rvmat{
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;
PixelShaderID = "NormalMapMacroASSpecularMap";
VertexShaderID = "NormalMapAS";
class Stage1
{
texture = "uns_army\data\soldier_nohq.paa";
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,0,0,0)";
uvSource = "tex";
class uvTransform
{
	aside[] = {1,0,0};
	up[] = {0,1,0};
	dir[] = {0,0,0};
	pos[] = {0,0,0};
};
};
class Stage3
{
texture = "uns_army\data\soldier_as.paa";
uvSource = "tex";
class uvTransform
{
	aside[] = {1,0,0};
	up[] = {0,1,0};
	dir[] = {0,0,0};
	pos[] = {0,0,0};
};
};
class Stage4
{
texture = "#(argb,8,8,3)color(1,1,1,1)";
uvSource = "tex";
class uvTransform
{
	aside[] = {1,0,0};
	up[] = {0,1,0};
	dir[] = {0,0,0};
	pos[] = {0,0,0};
};
};

---------- Post added at 08:59 AM ---------- Previous post was at 08:53 AM ----------

interestingly when you wound him, the rvmat no longer does the dark shadow on the affected texture

http://i162.photobucket.com/albums/t247/eggbeast/pbrwnd1_zps22e0352e.jpg

http://i162.photobucket.com/albums/t247/eggbeast/pbrwnd3-1_zpseb46c9a9.jpg

here is the wounded rvmat

ambient[]={1,1,1,1};
diffuse[]={1,1,1,1};
forcedDiffuse[]={0,0,0,1};
emmisive[]={0,0,0,1};
specular[]={1,1,1,1};
specularPower=25;
PixelShaderID="NormalMapMacroASSpecularDIMap";
VertexShaderID="NormalMapAS";
class Stage1
{
texture="uns_pbrcrew\data\uns_bw1_nohq.paa";
uvSource="tex";
class uvTransform
{
	aside[]={1,0,0};
	up[]={0,1,0};
	dir[]={0,0,0};
	pos[]={0,0,0};
};
};
class Stage2
{
texture="uns_pbrcrew\data\us_wound1_mc.paa";
uvSource="tex";
class uvTransform
{
	aside[]={1,0,0};
	up[]={0,1,0};
	dir[]={0,0,0};
	pos[]={0,0,0};
};
};
class Stage3
{
texture="uns_pbrcrew\data\soldier_body_as.paa";
uvSource="tex";
class uvTransform
{
	aside[]={1,0,0};
	up[]={0,1,0};
	dir[]={0,0,0};
	pos[]={0,0,0};
};
};
class Stage4
{
texture="uns_pbrcrew\data\us_wound_smdi.paa";
uvSource="tex";
class uvTransform
{
	aside[]={1,0,0};
	up[]={0,1,0};
	dir[]={0,0,0};
	pos[]={0,0,0};
};
};

---------- Post added at 09:40 AM ---------- Previous post was at 08:59 AM ----------

ok changing the rvmats values and entries (adding a stage 3 for example) makes no difference - am i right in thinking that because we have binarized models from yac that the rvmat values are somehow fixed inside the p3d and do not look at the rvmat?

Edited by eggbeast

Share this post


Link to post
Share on other sites

fixed it! von knudenberg is my hero

I don't think that was the problem as they work just fine now without touching rvmats. I've seen some weird problems before when rvmat is binarized along all the other stuff. When it is copied, but not binarized, they work ok.

Of course I can't be sure, I don't have so much experience with rvmats, but stage 3 is usually for macro texture (MC) and there isn't any macro textures for the b1_body. The two wound textures have macro texture wound_MC.paa.

they look peachy now - all ready for a river patrol in the mekong...

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  

×