B Info Shader Shader Stuff- HLSL instruction limits

Users who are viewing this thread

Docm30 said:
Virtually every game released these days uses non bone-based blend shapes for facial animation. I know this because I know the middleware they almost all use, and it requires it that way.

Alright. Maybe they bake it down somehow.

I know that if I were in charge of that I would prefer having fifteen bones in the face with their corresponding movement, that way I could reuse the skinning system, avoid complexity, and send a bunch of matrices/quaternions per frame depending on the distance instead of having full-fledged Pixar-style control for face expressions.

If they use specialized blackbox middleware good for them and bad for the bloat. *shivers*
 
Been messing about with the postfx.fx file but Im pretty clueless and have a few questions.

- Im presume the postfx.fx file needs to be compiled, do I just alter the compiler given by tw to do this? I have a rough idea of how to do this I think.
EDIT: Just realised it doesnt need compiled (well at least I dont think so)

- If I add a new shader/effect (no idea what to call it) in the post fx file is it just used automatically, where would I specify it to be used?

There is literally no info on the postfx file on these forums so any help would be appreciated  :smile:
 
La Grandmaster said:
Been messing about with the postfx.fx file but Im pretty clueless and have a few questions.

- Im presume the postfx.fx file needs to be compiled, do I just alter the compiler given by tw to do this? I have a rough idea of how to do this I think.
EDIT: Just realised it doesnt need compiled (well at least I dont think so)

- If I add a new shader/effect (no idea what to call it) in the post fx file is it just used automatically, where would I specify it to be used?

There is literally no info on the postfx file on these forums so any help would be appreciated  :smile:

No, it doesn't need to be a precompiled shader blob (the DirectX 9 compiler detects it and compiles it on the spot, you might even experience a small delay when loading the game). You just drop the modified
Code:
postfx.fx
file inside your module folder and the game will pick it up overriding the original one.

Take a look under the module data folder in a recent version of the module system zip file to see how the techniques are defined and "linked" into the engine just like GUI meshes or any other game asset.

There are some operations that control which one is in effect. To the uninitiated, they are pretty much like Instagram filters.
 
I have come up with a bit of a problem when it comes to the instruction limit.

The main map ground shader technique is as follows
Code:
DEFINE_TECHNIQUES(diffuse_map_bump, vs_main_map_bump, ps_main_map_bump)

however this compiles this technique as ps_2_a - which has a instruction limit of 64, I want to compile it as PS_2_X,

I then simply changed it to the following

Code:
technique diffuse_map_bump
{
	pass P0
	{
		VertexShader = compile vs_2_0 vs_main_map_bump();
		PixelShader = compile PS_2_X ps_main_map_bump();
	}
}

however neither of these shaders have 0 parameters - as they both have the uniform const int PcfMode, what would I put in the brackets so that these shaders compile correctly?

I can put in PCF_NONE in the brackets and it compiles but obviously this is wrong and not ideal.

Any help would be much appreciated  :smile:

 
La Grandmaster said:
I have come up with a bit of a problem when it comes to the instruction limit.

The main map ground shader technique is as follows
Code:
DEFINE_TECHNIQUES(diffuse_map_bump, vs_main_map_bump, ps_main_map_bump)

however this compiles this technique as ps_2_a - which has a instruction limit of 64, I want to compile it as PS_2_X,

I then simply changed it to the following

Code:
technique diffuse_map_bump
{
	pass P0
	{
		VertexShader = compile vs_2_0 vs_main_map_bump();
		PixelShader = compile PS_2_X ps_main_map_bump();
	}
}

however neither of these shaders have 0 parameters - as they both have the uniform const int PcfMode, what would I put in the brackets so that these shaders compile correctly?

I can put in PCF_NONE in the brackets and it compiles but obviously this is wrong and not ideal.

Any help would be much appreciated  :smile:

Code:
DEFINE_TECHNIQUES
is a macro expanded by the preprocessor, just like in C/C++. Find where is defined inside the file and take a look:

Code:
#define DEFINE_TECHNIQUES(tech_name, vs_name, ps_name)	\
				technique tech_name	\
				{ pass P0 { VertexShader = compile vs_2_0 vs_name(PCF_NONE); \
							PixelShader = compile ps_2_0 ps_name(PCF_NONE);} } \
				technique tech_name##_SHDW	\
				{ pass P0 { VertexShader = compile vs_2_0 vs_name(PCF_DEFAULT); \
							PixelShader = compile ps_2_0 ps_name(PCF_DEFAULT);} } \
				technique tech_name##_SHDWNVIDIA	\
				{ pass P0 { VertexShader = compile vs_2_0 vs_name(PCF_NVIDIA); \
							PixelShader = compile ps_2_a ps_name(PCF_NVIDIA);} } 

#endif

A macro is just a shorthand, a way to avoid repeating the same wall of text, making it cleaner. You can either change all the pixel shaders to be
Code:
PS_2_X
as you've bumped the shader requirements for your mod anyway, some older graphic cards won't load the compiled fx file at all if they find incompatible/modern shader revisions inside and the game won't load in DirectX 9 mode (just in DirectX 7/FFP mode).

Or, if you want to keep them in that version, just create a copy of that macro next to it and change it at your will to use it later, call it something useful like
Code:
DEFINE_TECHNIQUES_PS_2_X
.

That's it.

Edit: Clarified a bit more.
 
Does anyone know how the time variable (time_var) works in the shader files. Does it update every 0.1 seconds, also I remember reading somewhere that it only oscillates between 0 to 1, (e.g 0.0,0.1,0.2,0.3.....0.9,1.0) - is this true?
 
La Grandmaster said:
Does anyone know how the time variable (time_var) works in the shader fileandate every 0.1 seconds, also I remember reading somewhere that it only oscillates between 0 to 1, (e.g 0.0,0.1,0.2,0.3.....0.9,1.0) - is this true?

What it basically does is to count the seconds since the game started. So, no. If you want a sawtooth wave just use the floor intrinsic to get the integer part and substract it to get just the decimals. I'm on the go at the moment, but you get the gist.

There's also a specific HLSL intrinsic for that, so look it up. The possibilities are endless. People have done all kinds of fancy things with that bad boy, from shaky bushes to waving banners.

Edit: Just rememberered it. The intrinsic is fract.
 
Many thanks as always swyter  :smile:, been trying to match an equation in the module system to one in the hlsl shader files but the time variable seems to be a bit of a problem. It runs constantly (even when the game is paused), and I cant find a way of replicating this via the module system. I tried creating my own time variable with the module system and passing this to the shader files however it only gets passed at 5 to 8 frames per second which is not enough for fluid movements. Ill try think of a work around.
 
Hi guys! I didn't know where to post this, but since I'm going to request some help about shader injection this may be the right place.

Recently, Reshade (http://reshade.me/), an advanced shader injection tool capable of depth buffer access was released to the public. Many shaderpacks have been released like; SweetFx, GEMFx and MasterEffect. The last one has an interesting compilation of effects like; color correction, sin city, bloom, lens flares, and more.

Nearly all effects are working perfectly for Warband, but there are some others that require depth buffer access and there's where I'm having problems right now.

I would like to add Depth of Field and Ambient occlusion to Warband, the problem is that the only way for Reshade to successfully have correct depth buffer access is by going into Edit mode and then pressing "H". One can easily know if reshade is getting correct depth access thanks to some debugging shaders which look like this:

When in normal mode I get infinite depth which is represented in white:
depth2.jpg

When in edit mode and pressing "H" I get correct depth which represents closer objects darker:
depth.jpg

So I already tried things like adding transparent UI textures which doesn't help. There is something that gets hidden or disabled when pressing H in edit mode and allows depth buffer access.

Could anyone help me with this?, I think reshade could add new flavour and more eye candy to Warband mods.

Here are some examples of Reshade DoF and AO when depth access is achived.

DoF - Before:
dof2.jpg
DoF - After:
dof.jpg
AO - Before:
ao2.jpg
AO - After:
image.jpg
Hope I explained my self enough to get you guys interested in this topic, Thanks in advance!
 
proximusj said:
Hope I explained my self enough to get you guys interested in this topic, Thanks in advance!

Probably related with the fact that when post-processing is enabled the frame is rendered to a texture and then displayed on screen by sampling it into a screen-projected quad.
The quad is flat, so the actual rendered depth is near absolute zero. That might be a possible explanation; pseudo-deferred rendering. Even if many games of today use it.

Also, the game uses early Z rejection, that means that the actual rendering is also multi-pass.
Meaning that is not as straightforward you would normally render teapots for your grandma:

In the first pass the game renders only depth, with the fragment/pixel shaders disabled (no color), then it renders everything again without first clearing the depth buffer, keeping it from the previous past; leaving us with:

{FIRST PASS: RENDER JUST DEPTH BUFFER} => {SECOND PASS: RENDER COLOR KEEPING PREVIOUS DEPTH BUFFER TO TEXTURE} => (BLACK MAGIC) => {RENDER TO SCREEN WITH SCREEN-ALIGNED QUAD SAMPLING COLOR BUFFER}

"Why?" you may ask "Why waste precious time trying to do the same job twice?".

The interesting thing is that pixel shaders are normally the hot spot in graphics today, the complex, time-consuming part of the pipeline.

So, when you already know what is the maximum depth (from the camera perspective) of the visible parts,
you can reject geometry that falls outside of those borders, hence avoiding unnecessary redraws.

Meaning that there's just a single pixel/fragment shader running for every pixel.
Imagine having to draw the pixels of an huge battlefield blocked by the walls of a house.

Using this technique you find that the maximum depth is the one from the wall, and everything farther than that gets discarded,
so we just have to paint the wall and call it day, as we don't care about what hides beyond. Way faster, and less wasteful.


References:
https://software.intel.com/en-us/articles/early-z-rejection-sample
https://fgiesen.wordpress.com/2011/07/08/a-trip-through-the-graphics-pipeline-2011-part-7/
http://www.gamedev.net/topic/622047-early-z/

(By the way, modern GPUs theoretically do this kind of smart-ish optimizations for you behind the scenes, and you should not be bothered of doing it yourself)
 
Hello there,

Upon trying to fix up some things for a mod, I noticed that the 'light' scene props that emit a light effect from them does not work. Just does nothing at all.
Also then noticed that because the mod uses the Napoleonic Wars mb fx files it obviously doesn't work in NW. So either the NW devs screwed something up or left it out on purpose, but anyway this prop is quite vital to fix but after examining the mb.fx files I have no idea where to start. So much has been changed from the original source.

Could someone please shed some light (pun intended) on what code it uses.
 
Uuh.Hello.  :smile:

As you know,TLD is Open source.So,people can use content from this with credits.

I've used a banner waving shader from TLD for my mod.And,Im having some problems on adding.

The codes are here:

Code:
// WAVING STANDARD
/////////////////////



VS_OUTPUT vs_mtarini_standart(uniform const int PcfMode, uniform const bool UseSecondLight, float4 vPosition : POSITION, float3 vNormal : NORMAL, float2 tc : TEXCOORD0, float4 vColor : COLOR0, float4 vLightColor : COLOR1)
{
   VS_OUTPUT Out = (VS_OUTPUT)0;
   
   // WAWING...
   float4 vPositionNew = vPosition;
   float3 vNormalNew;

   float time = 5.0*(
        // 1.3*(matWorld._m00+matWorld._m11+matWorld._m22) +
        0.45*(matWorld._m03+matWorld._m13+matWorld._m23) +
		time_var
   );
   //time = sin(time*5.0);

   float atten=1.0, wavel=1.0+tc.y*0.8, angle;

   atten = min(tc.y*tc.x*2.0f,1.0f);
   angle = time+tc.x*9.0*wavel;
  
   vPositionNew.x += sin(angle)*(atten*0.065);

   vNormalNew.z = cos(angle)*atten*1.0;
   vNormalNew.y = 0; //vNormalNew.z * tc.y*0.1;
   vNormalNew.x = -sqrt(1.0-vNormalNew.z*vNormalNew.z);
//   vNormalNew=normalize(vNormalNew); 


   // revert all in not waving parts
   vPositionNew = (tc.x>0.75)?vPosition:vPositionNew;
   vPositionNew = (tc.x==0)?vPosition:vPositionNew;
   vPosition = (matWorldView._m00>0.99)?vPosition:vPositionNew;// to prevent inventory disasters
   vNormal = (tc.x>0.75)?vNormal:vNormalNew;
 
 

   Out.Pos = mul(matWorldViewProj, vPosition);
   
   float4 vWorldPos = (float4)mul(matWorld,vPosition);
   float3 vWorldN = normalize(mul((float3x3)matWorld, vNormal)); //normal in world space
   
   float3 P = mul(matWorldView, vPosition); //position in view space
   
   Out.Tex0 = tc;

   float4 diffuse_light = vAmbientColor;
//   diffuse_light.rgb *= gradient_factor * (gradient_offset + vWorldN.z);
   
   if (UseSecondLight)
   {
		diffuse_light += vLightColor;
	}
   
	//directional lights, compute diffuse color
	float dp = dot(vWorldN, -vSkyLightDir);
	diffuse_light += max(0, dp) * vSkyLightColor;

	//point lights
	for(int j = 0; j < iLightPointCount; j++)
	{
		int i = iLightIndices[j];
		float3 point_to_light = vLightPosDir[i]-vWorldPos;
		float LD = length(point_to_light);
		float3 L = normalize(point_to_light);
		float wNdotL = dot(vWorldN, L);
		
		float fAtten = 1.0f/(LD * LD);// + 0.9f / (LD * LD);
		//compute diffuse color
		diffuse_light += max(0, wNdotL) * vLightDiffuse[i] * fAtten;
	}
   //apply material color
//	Out.Color = min(1, vMaterialColor * vColor * diffuse_light);
	Out.Color = (vMaterialColor * vColor * diffuse_light);

	//shadow mapping variables
	float wNdotSun = max(0.0f,dot(vWorldN, -vSunDir));
	Out.SunLight = (wNdotSun) * vSunColor * vMaterialColor * vColor;
	if (PcfMode != PCF_NONE)
	{
		float4 ShadowPos = mul(matSunViewProj, vWorldPos);
		Out.ShadowTexCoord = ShadowPos;
		Out.ShadowTexCoord.z /= ShadowPos.w;
		Out.ShadowTexCoord.w = 1.0f;
		Out.TexelPos = Out.ShadowTexCoord * fShadowMapSize;
		//shadow mapping variables end
	}
	
   //apply fog
   float d = length(P);
   
   Out.Fog = get_fog_amount(d);
   return Out;
}

technique mtarini_standart_shader
{
   pass P0
   {
      VertexShader = compile vs_2_0 vs_mtarini_standart(PCF_NONE,true);
      PixelShader = compile ps_2_0 ps_main(PCF_NONE);
   }
}

technique mtarini_standart_shader_SHDW
{
   pass P0
   {
      VertexShader = compile vs_2_0 vs_mtarini_standart(PCF_DEFAULT,true);
      PixelShader = compile ps_2_0 ps_main(PCF_DEFAULT);
   }
}

technique mtarini_standart_shader_SHDWNVIDIA
{
   pass P0
   {
      VertexShader = compile vs_2_0 vs_mtarini_standart(PCF_NVIDIA,true);
      PixelShader = compile ps_2_0 ps_main(PCF_NVIDIA);
   }
}

And,four or five months ago,Developer Serdar said to me "you should add new shaders after from struct VS_OUTPUT_FLORA section"

So,I added as well as he said.

But,It gives compiler errors:

Code:
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(5724,7): error X3018: invalid
subscript 'TexelPos'

compilation failed; no code produced
Microsoft (R) Direct3D Shader Compiler 9.27.952.3012
Copyright (C) Microsoft Corporation 2002-2009. All rights reserved.

C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(324,20): warning X3206: 'tex2D
': implicit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(325,66): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(326,66): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(327,66): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(377,30): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(378,31): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(540,9): warning X3206: implici
t truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(567,9): warning X3206: implici
t truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(635,9): warning X3206: implici
t truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(963,8): warning X3206: implici
t truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(1002,22): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(1010,9): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(1088,55): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(1094,9): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(1255,23): warning X3206: 'tex2
D': implicit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(1390,9): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(1476,19): warning X3206: 'calc
ulate_point_lights_diffuse': implicit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(1492,22): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(1497,9): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(1537,19): warning X3206: 'calc
ulate_point_lights_diffuse': implicit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(1553,22): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(1733,9): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(1744,22): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(2087,8): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(2145,8): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(2183,8): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(2358,10): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(2390,9): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(2394,9): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(2414,19): warning X3206: 'calc
ulate_point_lights_diffuse': implicit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(2431,22): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(2436,9): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(2472,18): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(2494,9): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(2498,9): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(2518,19): warning X3206: 'calc
ulate_point_lights_diffuse': implicit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(2535,22): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(2540,9): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(2584,60): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(2591,47): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(2642,60): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(2649,47): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(2711,11): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(2819,9): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3006,11): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3050,24): warning X3206: 'calc
ulate_point_lights_diffuse': implicit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3050,22): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3068,25): warning X3206: 'calc
ulate_point_lights_specular': implicit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3076,24): warning X3206: 'calc
ulate_point_lights_diffuse': implicit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3076,22): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3083,21): warning X3206: 'calc
ulate_point_lights_specular': implicit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3083,19): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3096,22): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3101,9): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3159,18): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3198,24): warning X3206: 'calc
ulate_point_lights_diffuse': implicit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3198,22): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3216,25): warning X3206: 'calc
ulate_point_lights_specular': implicit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3224,24): warning X3206: 'calc
ulate_point_lights_diffuse': implicit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3224,22): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3231,21): warning X3206: 'calc
ulate_point_lights_specular': implicit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3231,19): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3244,22): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3249,9): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3266,10): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3299,100): warning X3206: impl
icit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3318,90): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3370,32): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3381,35): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3388,31): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3422,9): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3727,8): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3742,9): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3754,19): warning X3206: 'calc
ulate_point_lights_diffuse': implicit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3770,22): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3784,8): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3855,8): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3872,9): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3884,19): warning X3206: 'calc
ulate_point_lights_diffuse': implicit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3893,10): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3894,27): warning X3206: 'mul'
: implicit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3894,14): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3895,28): warning X3206: 'mul'
: implicit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3895,15): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3905,22): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3928,9): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3940,19): warning X3206: 'calc
ulate_point_lights_diffuse': implicit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3949,10): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3950,27): warning X3206: 'mul'
: implicit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3950,14): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3951,28): warning X3206: 'mul'
: implicit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3951,15): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3961,22): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(3979,8): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(4018,36): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(4105,9): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(4117,19): warning X3206: 'calc
ulate_point_lights_diffuse': implicit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(4133,22): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(4256,22): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(4270,23): warning X3206: 'calc
ulate_point_lights_diffuse': implicit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(4270,21): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(4295,9): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(4316,13): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(4319,14): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(4357,18): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(4390,13): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(4511,9): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(4524,15): warning X3206: 'calc
ulate_point_lights_diffuse': implicit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(4540,22): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(4629,22): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(4634,9): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(4671,22): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(4676,9): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(4688,8): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(4698,8): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(4734,9): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(4750,8): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(4760,8): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(4785,9): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(4798,22): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(4820,8): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(4829,8): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(4864,9): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(4884,8): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(4894,8): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(5000,22): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(5004,14): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(5008,9): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(5089,19): warning X3206: 'calc
ulate_point_lights_diffuse': implicit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(5109,22): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(5113,14): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(5117,9): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(5186,9): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(5213,22): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(5218,14): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(5298,9): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(5327,22): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(5332,14): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(5362,26): warning X3206: 'tex2
D': implicit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(5416,9): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(5556,9): warning X3206: implic
it truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(5682,11): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(5702,42): warning X3206: impli
cit truncation of vector type
C:\Users\Fatih\Downloads\mb_warband_shaders\mb.fx(5724,7): error X3018: invalid
subscript 'TexelPos'

compilation failed; no code produced
Script processing has ended.
Press any key to exit. . .

Without adding this effect,compiler works like water.

Please help me.  :???:
 
And,four or five months ago,Developer Serdar said to me "you should add new shaders after from struct VS_OUTPUT_FLORA section"
You can pretty much chuck new shaders in anywhere, as long as its not in the middle of another shader. But thats not your issue (or its not the one the compiler is referring to anyway). The compiler states that you have an invalid subscript "TexelPos ", you are using the output structure VS_OUTPUT - if you find where this output structure is declared you will notice there is no TexelPos - there is however a ShadowTexelPos - so change your TexelPos to ShadowTexelPos. Not sure if you will run into other errors after this, its hard to tell without inserting the code myself.
 
How can i give the waving shader to water shader ? I've got the Waving shader from Swyter's basic waving codes.But,I couldnt find the sea material in brf files.So,i couldnt find the water shader.i dont know which sea material uses which shader.

If you doesnt understand,I am talking about the material of water used in scenes by the game.I wanna add wave effect to this.

So,I can see the water like that:

 
HyperCharge said:
How can i give the waving shader to water shader ? I've got the Waving shader from Swyter's basic waving codes.But,I couldnt find the sea material in brf files.So,i couldnt find the water shader.i dont know which sea material uses which shader.
A bit late, but better than never...
vs_main_water is the vertex shader you're looking for.
The related material is called "river" btw.
 
Back
Top Bottom