Jump to content
Sign in to follow this  
schultzit

Odd error with multimaterial shader

Recommended Posts

Hello!

 

I'm banging my head on the wall on a particular model that's got a strange error.

 

This is how the model looks in buldozer - all fine!:

 

uUygMB5.png

 

 

this is how it looks in game (ouch):

 

qwEWki7.jpg

 

 

it looks like the multimat .rvmat doesnt work in game for some reason I can't seriously figure out.

 

the rvmat:

ambient[]={0.57500011,0.57500011,0.57500011,1};
diffuse[]={0.57500011,0.57500011,0.57500011,1};
forcedDiffuse[]={0,0,0,0};
emmisive[]={0,0,0,1};
specular[]={0.31700015,0.31700015,0.31700015,1};
specularPower=35.5;
PixelShaderID="Multi";
VertexShaderID="Multi";
class TexGen0
{
	uvSource="tex";
	class uvTransform
	{
		aside[]={1,0,0};
		up[]={0,1,0};
		dir[]={0,0,1};
		pos[]={0,0,0};
	};
};
class TexGen1
{
	uvSource="tex";
	class uvTransform
	{
		aside[]={1,0,0};
		up[]={0,1,0};
		dir[]={0,0,1};
		pos[]={0,0,0};
	};
};
class TexGen2
{
	uvSource="tex";
	class uvTransform
	{
		aside[]={1,0,0};
		up[]={0,1,0};
		dir[]={0,0,1};
		pos[]={0,0,0};
	};
};
class TexGen3
{
	uvSource="tex";
	class uvTransform
	{
		aside[]={1,0,0};
		up[]={0,1,0};
		dir[]={0,0,1};
		pos[]={0,0,0};
	};
};
class TexGen4
{
	uvSource="tex1";
	class uvTransform
	{
		aside[]={1,0,0};
		up[]={0,1,0};
		dir[]={0,0,1};
		pos[]={0,0,0};
	};
};
class TexGen5
{
	uvSource="tex";
	class uvTransform
	{
		aside[]={1,0,0};
		up[]={0,1,0};
		dir[]={0,0,1};
		pos[]={0,0,0};
	};
};
class TexGen6
{
	uvSource="tex";
	class uvTransform
	{
		aside[]={1,0,0};
		up[]={0,1,0};
		dir[]={0,0,1};
		pos[]={0,0,0};
	};
};
class TexGen7
{
	uvSource="tex1";
	class uvTransform
	{
		aside[]={1,0,0};
		up[]={0,1,0};
		dir[]={0,0,1};
		pos[]={0,0,0};
	};
};
class Stage0
{
	texture="2017\map_data_2017\textures\concrete_dirty_slabs_co.paa";
	texGen="0";
};
class Stage1
{
	texture="2017\buildings2_2017\ind_estate\data\ind_estate_building_roof_co.paa";
	texGen="1";
};
class Stage2
{
	texture="2017\buildings2_2017\ind_estate\data\ind_estate_building_brick_co.paa";
	texGen="2";
};
class Stage3
{
	texture="a3\structures_f\data\metal\metal05_co.paa";
	texGen="3";
};
class Stage4
{
	texture="2017\buildings2_2017\ind_estate\data\ind_unit_ext_mask.paa";
	texGen="4";
};
class Stage5
{
	texture="#(argb,8,8,3)color(0.5,0,1,1,DTSMDI)";
	texGen="5";
};
class Stage6
{

	texture="2017\buildings2_2017\ind_estate\data\ind_estate_building_roof_smdi.paa";
	texGen="6";
};
class Stage7
{

	texture="2017\map_data_2017\textures\terraced_house_brick_dtsmdi.paa";
	texGen="7";
};
class Stage8
{
	texture="#(argb,8,8,3)color(0.5,0,1,1,DTSMDI)";
	texGen="3";
};
class Stage9
{

	texture="2017\buildings2_2017\ind_estate\data\ind_unit_ext_mc.paa";
	texGen="4";
};
class Stage10
{
	texture="2017\buildings2_2017\ind_estate\data\ind_est_as.paa";
	texGen="4";
};
class Stage11
{
	texture="a3\structures_f\data\concrete\concrete_old_nohq.paa";
	texGen="0";
};
class Stage12
{
	texture="2017\buildings2_2017\ind_estate\data\ind_estate_building_roof_nohq.paa";
	texGen="1";
};
class Stage13
{
	texture="2017\map_data_2017\textures\terraced_house_brick_nohq.paa";
	texGen="2";
};
class Stage14
{
	texture="#(argb,8,8,3)color(0.5,0.5,1,1,NOHQ)";
	texGen="3";
};

does anybody have any idea?

 

There's no missing files since PBOProject packs it with no errors...

 

Nothing in the RPT aswell.

 

Thanks in advance ;)

Share this post


Link to post
Share on other sites

Do you have two UV sets and nothing in the texture field of the model?

Share this post


Link to post
Share on other sites

can you please post the MC and AS maps? (for buildings you should use ADS not AS maps btw)

Share this post


Link to post
Share on other sites

Thanks for your support PuFu and Sixteen!

The two uv sets look fine, if they were fubared I would have seen the same problem in buldozer - but it works in buldozer!

PuFu- I'm at work now, but I'll upload the textures later.

I always used_as for my multimats, what's the difference?

Share this post


Link to post
Share on other sites

Ah here's thethe difference

LightMaps

_AS - ambient shadow texture contains stored information "how much ambient light is in given place'. White color means full ambient lighting. 0 means none.In fact only channel which is taken advantage of is G - it's thus important that information is correctly in him. Rest of channels doesn't matter and anything can be placed there (may be same as in G).

_ADS - similar map like previous with difference that channel B (blue) keeps information about diffusion shadow. That one will be used when normal shadows aren't (either they off or too far). Green will have to be brighter to match the results AS would give you (~150%? ~40% gamma).

Share this post


Link to post
Share on other sites

I haven't used any ADS maps in my multishaders (though I will start replacing the AS with them now that I see what ADS does) and haven't had the problem you're experiencing.  They're not the cause of the problem you're having.  Can you post a screen of your UV map -- I see that none of the texture definitions are tiled, they're all 1:1 --  aside[]={1,0,0}; up[]={0,1,0}; dir[]={0,0,1}; pos[]={0,0,0};

Share this post


Link to post
Share on other sites

UV SET 0 (I selected the multimat parts):

 

j2z2G4o.png

 

UV SET 1:

 

pbvbe5r.png

 

Share this post


Link to post
Share on other sites

Hi,
Try setting up your Stage7 to use TexGen 2 insted of 7 (TexGen 7 is using UV Map Set 1 which I'm surely it's not intended).

Also, use this template to make your rvmat more clearly for your eyes, you will be benefited :P (Well for me it's)
PS: Forum editor make it a terrible code view :angry:

diffuse[]={0.57500011,0.57500011,0.57500011,1};
forcedDiffuse[]={0,0,0,0};
emmisive[]={0,0,0,1};
specular[]={0.31700015,0.31700015,0.31700015,1};
specularPower=35.5;
PixelShaderID="Multi";
VertexShaderID="Multi";

class TexGen5 	{uvSource="tex";	class uvTransform{aside[]={1,0,0};	up[]={0,1,0};	dir[]={0,0,1};	pos[]={0,0,0};};};
class TexGen6 	{uvSource="tex";	class uvTransform{aside[]={1,0,0};	up[]={0,1,0};	dir[]={0,0,1};	pos[]={0,0,0};};};
class TexGen7 	{uvSource="tex";	class uvTransform{aside[]={1,0,0};	up[]={0,1,0};	dir[]={0,0,1};	pos[]={0,0,0};};};

// BLACK

class TexGen0 	{uvSource="tex";	class uvTransform{aside[]={1,0,0};	up[]={0,1,0};	dir[]={0,0,1};	pos[]={0,0,0};};};
class Stage0	{texture="2017\map_data_2017\textures\concrete_dirty_slabs_co.paa";							texGen="0";};
class Stage5	{texture="#(argb,8,8,3)color(0.5,0,1,1,DTSMDI)";											texGen="0";};
class Stage11	{texture="a3\structures_f\data\concrete\concrete_old_nohq.paa";								texGen="0";};

// RED

class TexGen1 	{uvSource="tex";	class uvTransform{aside[]={1,0,0};	up[]={0,1,0};	dir[]={0,0,1};	pos[]={0,0,0};};};
class Stage1	{texture="2017\buildings2_2017\ind_estate\data\ind_estate_building_roof_co.paa";			texGen="1";};
class Stage6	{texture="2017\buildings2_2017\ind_estate\data\ind_estate_building_roof_smdi.paa";			texGen="1";};
class Stage12	{texture="2017\buildings2_2017\ind_estate\data\ind_estate_building_roof_nohq.paa";			texGen="1";};

// GREEN

class TexGen2 	{uvSource="tex";	class uvTransform{aside[]={1,0,0};	up[]={0,1,0};	dir[]={0,0,1};	pos[]={0,0,0};};};
class Stage2	{texture="2017\buildings2_2017\ind_estate\data\ind_estate_building_brick_co.paa";			texGen="2";};
class Stage7	{texture="2017\map_data_2017\textures\terraced_house_brick_dtsmdi.paa";						texGen="2";};
class Stage13	{texture="texture="2017\map_data_2017\textures\terraced_house_brick_nohq.paa";				texGen="2";};

// BLUE

class TexGen3 	{uvSource="tex";	class uvTransform{aside[]={1,0,0};	up[]={0,1,0};	dir[]={0,0,1};	pos[]={0,0,0};};};
class Stage3	{texture="texture="a3\structures_f\data\metal\metal05_co.paa";								texGen="3";};
class Stage8	{texture="#(argb,8,8,3)color(0.5,0,1,1,DTSMDI)";											texGen="3";};
class Stage14	{texture="#(argb,8,8,3)color(0.5,0.5,1,1,NOHQ)";											texGen="3";};

// MASK, MC, AS/ADS

class TexGen4 	{uvSource="tex1";	class uvTransform{aside[]={1,0,0};	up[]={0,1,0};	dir[]={0,0,1};	pos[]={0,0,0};};};
class Stage4	{texture="2017\buildings2_2017\ind_estate\data\ind_unit_ext_mask.paa";						texGen="4";};
class Stage9	{texture="2017\buildings2_2017\ind_estate\data\ind_unit_ext_mc.paa";						texGen="4";};
class Stage10	{texture="2017\buildings2_2017\ind_estate\data\ind_est_as.paa";								texGen="4";};

Share this post


Link to post
Share on other sites

Hello! Yeah that format is way more readable, unfortunately that didnt solve my issue :(

 

Thanks anyways

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  

×