I dont think it would help to be honest, it is a complete mess and you would find it very hard to understand what is going/ what is being used where. I am releasing my shader pack in the next few days though, so will have access to it then if you really want to have a look at it but it will not make things more clear, it was one of the first shaders I coded and I literally had very little idea what was going onJarvisimo said:Okay, thanks.
Is there any chance you could PM me the code for your new standart shader for me to look over and study?
La Grandmaster said:I dont think it would help to be honest, it is a complete mess and you would find it very hard to understand what is going/ what is being used where. I am releasing my shader pack in the next few days though, so will have access to it then if you really want to have a look at it but it will not make things more clear, it was one of the first shaders I coded and I literally had very little idea what was going onJarvisimo said:Okay, thanks.
Is there any chance you could PM me the code for your new standart shader for me to look over and study?
Some native warband shaders do feature a nice clearly coded fresnel function though, just have a search through the shader file for "fresnel"
I agree to some extent, but "everybody" and "overused and overdone"? Apart from Docms shader pack (and mines which is unreleased and very poor in comparison) I couldnt name one other which adds new fresnel effects to M&BSwyter said:Everybody is adding fresnel terms to everything lately. Reminds me to the bumpy and plastic-y look that games got when starting to use normal maps back in 2004. They are all overused and overdone, without any stylistic need, put there to show off and say "hey guyz , look awsom gfx 4 u, nexgen ftw owned omg real lyf rolfcopter pwnz hax~ 2edgy4me we kn do it 2 ^_^".
La Grandmaster said:I agree to some extent, but "everybody" and "overused and overdone"? Apart from Docms shader pack (and mines which is unreleased and very poor in comparison) I couldnt name one other which adds new fresnel effects to M&BSwyter said:Everybody is adding fresnel terms to everything lately. Reminds me to the bumpy and plastic-y look that games got when starting to use normal maps back in 2004. They are all overused and overdone, without any stylistic need, put there to show off and say "hey guyz , look awsom gfx 4 u, nexgen ftw owned omg real lyf rolfcopter pwnz hax~ 2edgy4me we kn do it 2 ^_^".
Jarvisimo said:Yes, I don't actually want a fresnel effect for my mod, I just want to be able to do it for the understanding/practice.
I don't want a desaturate either.
Though I do want a pretty flag wavy shader. The Deluge ones look amazing.
Swyter said:Swyter said:Youtube is getting ****tier and ****tier as the time passes.
Here you have some quick videos, anyway.
Another one, Janus is limiting to two embedded videos per post.
Swyter said:I took a break from fixing the boring formations thingie and started to do some shader magic:
Code:https://trello.com/c/NCDdDIT2/60-wavy-scene-prop-banners
Not exactly poetry, but I think they look good enough:
http://youtu.be/tbPdxdK_txI
sin()
cos()
time_var
sin(time_var)
http://mbmodwiki.ollclan.eu/Swyter%27s_Simple_Waving
Hold it, hold it. What do you mean "modulate"? How would I go about doing this? I am totally clueless, remember. Grandmaster's tutorial was perfect for my pathetic level of intelligence.These kind of vertex shaders are really simple and cheap if you know what to modulate with to get a nice falloff from the pole to the bottom edge of the cloth. Requires quite a bit of tweaking until you get a somehow realistic look, though.
Jarvisimo said:Woah, nice job, those are really convincing... stop making me jealous, Swy!
Seriously though, those are exactly what I'm going for.
Hold it, hold it. What do you mean "modulate"? How would I go about doing this? I am totally clueless, remember. Grandmaster's tutorial was perfect for my pathetic level of intelligence.These kind of vertex shaders are really simple and cheap if you know what to modulate with to get a nice falloff from the pole to the bottom edge of the cloth. Requires quite a bit of tweaking until you get a somehow realistic look, though.
I am guessing here that I need to do some sort of for/next loop for the length of the texture, displacing it somehow?
EDIT: Just saw your edit above. You babe. I'll have a crack.
tc.y
vPosition.y
VS_OUTPUT vs_main(uniform const int PcfMode, uniform const bool UseSecondLight, float4 vPosition : POSITION, float3 vNormal : NORMAL, float2 tc : TEXCOORD0, float4 vColor : COLOR0, float4 vLightColor : COLOR1, uniform const bool swy_rohan_banners = false, uniform const bool swy_spr_banners = false)
{
INITIALIZE_OUTPUT(VS_OUTPUT, Out);
//swy-- constants, tailored constants everywhere! :)
if(swy_rohan_banners)
{
//swy-- if not metal thingy
if(tc.x < 0.944f)
{
float seed = time_var + (vPosition.x/vPosition.y/vPosition.z);
float v_modulator;
//swy-- special codepath for sideways banner, modulating the waving vertically/horizontally by UVs. sigh :(
if(tc.x < 0.547f && tc.y > 0.789f)
{
v_modulator = tc.x * 0.5f;
}
else
{
v_modulator = tc.y;
}
vPosition.y += ((sin(seed+cos(vPosition.x))*0.4f)* v_modulator*vPosition.x)/vPosition.z;
}
}
//swy-- per-pixel sampling for per-vertex shaders, now that's performant! :)
if(swy_spr_banners)
{
//swy-- if not metal thingy
if(tc.x <= (244.f/256.f))
{
float seed = time_var + (vPosition.x + vPosition.y + tc.x + tc.y) + matWorld._m03;
float thingie = sin(seed + cos(vPosition.x)) * frac(tc.y*3.f) /* * abs(vPosition.x) */;
thingie *= 0.2f;
vPosition.y += -(abs(thingie)*abs(thingie));
vPosition.x += thingie*0.3f;
}
}
Out.Pos = mul(matWorldViewProj, vPosition);
float4 vWorldPos = (float4)mul(matWorld,vPosition);
float3 vWorldN = normalize(mul((float3x3)matWorld, vNormal)); //normal in world space
Out.Tex0 = tc;
/* rest of the shader here, mostly standard stuff, all unrelated to the wavy thing */
Depends entirely on what models you want to wave. I am guessing you want it to occur on banners, so i would suggest you create a new shader for banners - to do this copy an existing shader which has the features your are after and then add in swyters wave code.Jarvisimo said:P.S What shader should I put it within? Or do I need to create a new "flag_shader" or something?
set_shader_param_int = 2400 # (set_shader_param_int, <parameter_name>, <value>), #Sets the int shader parameter <parameter_name> to <value>
set_shader_param_float = 2401 # (set_shader_param_float, <parameter_name>, <value>), #Sets the float shader parameter <parameter_name> to <value>
set_shader_param_float4 = 2402 # (set_shader_param_float4, <parameter_name>, <valuex>, <valuey>, <valuez>, <valuew>), #Sets the float4 shader parameter <parameter_name> to <valuex/y/z/w>
set_shader_param_float4x4 = 2403 # (set_shader_param_float4x4, <parameter_name>, [0][0], [0][1], [0][2], [1][0], [1][1], [1][2], [2][0], [2][1], [2][2], [3][0], [3][1], [3][2]), #Sets the float4x4 shader parameter <parameter_name> to the given values .w components are 0001 by default
La Grandmaster said:I believe animated normal maps are how TW do their animated faces in bannerlord (https://www.taleworlds.com/en/Games/Bannerlord/Blog/7), and these must be specific to each unit, this is similar to what I am trying to do in WB.
Swyter said:They clearly do it using classic per-vertex skinning. With standard bones, painted rigging and poses.
Nothing of this fanciness is going to be included in M&B II. I'm pretty sure of that.
Docm30 said:Swyter said:They clearly do it using classic per-vertex skinning. With standard bones, painted rigging and poses.
Nothing of this fanciness is going to be included in M&B II. I'm pretty sure of that.
It's more likely done with blend shapes.
Swyter said:You don't really want to manually tweak face vertices with all the range of expressions for more than two meshes
Docm30 said:Swyter said:You don't really want to manually tweak face vertices with all the range of expressions for more than two meshes
Why would you? Why would you even do two? As long as all the heads use the same topology, they can use the same blend shapes. The shape of the head doesn't matter.