Somebody said:Did you also copy and rename the individual items inside the SceneObj folder? The module_scenes are just parameters to instantiate before placing the actual objects from the .sco files
Godarcher said:Hey there,
Our mod is having some problems with some screwed up vertexes
So i’m not a map maker myself but i was wondering how i could fix this issue
float4 wave_flag(float4 vPosition, float2 vTextureCoord)
{
vPosition.y += cos(time_var + 15 * vTextureCoord.x) * min(vTextureCoord.x, 0.1) * 1.5; //* (vTextureCoord.x < 0.1 ? vTextureCoord.x : 0.1); //min(vTextureCoord.x, 0.1);
return vPosition;
}
struct VS_RUSMOD_OUTPUT_FLAG
{
float4 Pos : POSITION;
float Fog : FOG;
float4 Color : COLOR0;
float2 Tex0 : TEXCOORD0;
float4 SunLight : TEXCOORD1;
float4 ShadowTexCoord : TEXCOORD2;
float2 ShadowTexelPos : TEXCOORD3;
};
VS_RUSMOD_OUTPUT_FLAG vs_rusmod_flag(float4 vPosition : POSITION, float3 vNormal : NORMAL, float2 tc : TEXCOORD0, float4 vColor : COLOR0, float4 vLightColor : COLOR1)
{
INITIALIZE_OUTPUT(VS_RUSMOD_OUTPUT_FLAG, Out);
vPosition = wave_flag(vPosition, tc);
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;
float4 diffuse_light = vAmbientColor;
diffuse_light += vLightColor;
diffuse_light += saturate(dot(vWorldN, -vSkyLightDir)) * vSkyLightColor;
#ifndef USE_LIGHTING_PASS
diffuse_light += calculate_point_lights_diffuse(vWorldPos, vWorldN, false, false);
#endif
Out.Color = vMaterialColor * vColor * diffuse_light;
float wNdotSun = saturate(dot(vWorldN, -vSunDir));
Out.SunLight = (wNdotSun) * vSunColor * vMaterialColor * vColor;
float3 P = mul(matWorldView, vPosition);
float d = length(P);
Out.Fog = get_fog_amount_new(d, vWorldPos.z);
return Out;
}
PS_OUTPUT ps_rusmod_flag(VS_RUSMOD_OUTPUT_FLAG In)
{
PS_OUTPUT Output;
float4 tex_col = tex2D(MeshTextureSampler, In.Tex0);
INPUT_TEX_GAMMA(tex_col.rgb);
float sun_amount = 1.0f;
Output.RGBColor = tex_col * ((In.Color + In.SunLight * sun_amount));
OUTPUT_GAMMA(Output.RGBColor.rgb);
return Output;
}
technique rusmod_flag
{
pass P0
{
VertexShader = compile vs_2_0 vs_rusmod_flag();
PixelShader = compile ps_2_0 ps_rusmod_flag();
}
}
Janycz said:Hello! I created shader for flags.
Result:Code:float4 wave_flag(float4 vPosition, float2 vTextureCoord) { vPosition.y += cos(time_var + 15 * vTextureCoord.x) * min(vTextureCoord.x, 0.1) * 1.5; //* (vTextureCoord.x < 0.1 ? vTextureCoord.x : 0.1); //min(vTextureCoord.x, 0.1); return vPosition; } struct VS_RUSMOD_OUTPUT_FLAG { float4 Pos : POSITION; float Fog : FOG; float4 Color : COLOR0; float2 Tex0 : TEXCOORD0; float4 SunLight : TEXCOORD1; float4 ShadowTexCoord : TEXCOORD2; float2 ShadowTexelPos : TEXCOORD3; }; VS_RUSMOD_OUTPUT_FLAG vs_rusmod_flag(float4 vPosition : POSITION, float3 vNormal : NORMAL, float2 tc : TEXCOORD0, float4 vColor : COLOR0, float4 vLightColor : COLOR1) { INITIALIZE_OUTPUT(VS_RUSMOD_OUTPUT_FLAG, Out); vPosition = wave_flag(vPosition, tc); 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; float4 diffuse_light = vAmbientColor; diffuse_light += vLightColor; diffuse_light += saturate(dot(vWorldN, -vSkyLightDir)) * vSkyLightColor; #ifndef USE_LIGHTING_PASS diffuse_light += calculate_point_lights_diffuse(vWorldPos, vWorldN, false, false); #endif Out.Color = vMaterialColor * vColor * diffuse_light; float wNdotSun = saturate(dot(vWorldN, -vSunDir)); Out.SunLight = (wNdotSun) * vSunColor * vMaterialColor * vColor; float3 P = mul(matWorldView, vPosition); float d = length(P); Out.Fog = get_fog_amount_new(d, vWorldPos.z); return Out; } PS_OUTPUT ps_rusmod_flag(VS_RUSMOD_OUTPUT_FLAG In) { PS_OUTPUT Output; float4 tex_col = tex2D(MeshTextureSampler, In.Tex0); INPUT_TEX_GAMMA(tex_col.rgb); float sun_amount = 1.0f; Output.RGBColor = tex_col * ((In.Color + In.SunLight * sun_amount)); OUTPUT_GAMMA(Output.RGBColor.rgb); return Output; } technique rusmod_flag { pass P0 { VertexShader = compile vs_2_0 vs_rusmod_flag(); PixelShader = compile ps_2_0 ps_rusmod_flag(); } }
Why is this flag not smooth? And how can I fix it?
Thanks, NPC99.NPC99 said:It looks like your flag has too few polys. It can only bend where there are vertices. To make it look smooth you need to subdivide the mesh in Blender to create more faces/polys. The picture suggests you only have about five columns of polys, which is far too few.
Godarcher said:Does anybody know of a method to be able to zoom out further on the world map overview?
Edit: map_max_distance does just that for < 251
Where are defender troops assigned to towns? (So its possible to give towns more defenders)
edit: for people searching they are assigned reinforcements, increase the faction_reinforcement points troop amounts to increase this
Godarcher said:Are map icons able to work with seperated meshes?
i got a new map icon however it is textured in 6 layers, combining the mesh makes it kind of ugly and i really one preserve the subtle texture changes.
i tried using seperated meshes, city, city.1, city.2 but it just loads one of them onto the world map, while this method works fine with a normal helmet
mtarini said:You can but you have to suffer a bit and also prepare the textures themselves yourself.
The tool you are looking is "Transform texture coordinates"
For example, to assemble 4 sheets into one sheet like this:
A B
C D
then all the models should be scaled by 50% (both U and V).
meshes originally using A should not be translated.
meshes originally using B should be translated by 0.5 in U (horizontal)
meshes originally using C should be translated by 0.5 in V (vertical).
meshes originally using D should be translated by 0.5 both in U and in V.
Now, all these meshes must be using the material linked to the new assembled texture.
NPC99 said:Godarcher said:Are map icons able to work with seperated meshes?
i got a new map icon however it is textured in 6 layers, combining the mesh makes it kind of ugly and i really one preserve the subtle texture changes.
i tried using seperated meshes, city, city.1, city.2 but it just loads one of them onto the world map, while this method works fine with a normal helmet
I suggest you combine your textures so they can work with a single mesh. The following shows how to do it with four textures in OpenBRF:
mtarini said:You can but you have to suffer a bit and also prepare the textures themselves yourself.
The tool you are looking is "Transform texture coordinates"
For example, to assemble 4 sheets into one sheet like this:
A B
C D
then all the models should be scaled by 50% (both U and V).
meshes originally using A should not be translated.
meshes originally using B should be translated by 0.5 in U (horizontal)
meshes originally using C should be translated by 0.5 in V (vertical).
meshes originally using D should be translated by 0.5 both in U and in V.
Now, all these meshes must be using the material linked to the new assembled texture.
Or you could re-uv map a composite texture in Blender.
Godarcher said:NPC99 said:Godarcher said:Are map icons able to work with seperated meshes?
i got a new map icon however it is textured in 6 layers, combining the mesh makes it kind of ugly and i really one preserve the subtle texture changes.
i tried using seperated meshes, city, city.1, city.2 but it just loads one of them onto the world map, while this method works fine with a normal helmet
I suggest you combine your textures so they can work with a single mesh. The following shows how to do it with four textures in OpenBRF:
mtarini said:You can but you have to suffer a bit and also prepare the textures themselves yourself.
The tool you are looking is "Transform texture coordinates"
For example, to assemble 4 sheets into one sheet like this:
A B
C D
then all the models should be scaled by 50% (both U and V).
meshes originally using A should not be translated.
meshes originally using B should be translated by 0.5 in U (horizontal)
meshes originally using C should be translated by 0.5 in V (vertical).
meshes originally using D should be translated by 0.5 both in U and in V.
Now, all these meshes must be using the material linked to the new assembled texture.
Or you could re-uv map a composite texture in Blender.
I'm not a modellor by default so i'm having quite a hard time doing this.
If i do the transformation how should i then do my textures in the
AB
CD
position in one single file?
position, cause i tried that and it didn't quite work out