|
Re: ShadeCEVO simple grass (OVERLAY) ?
[Re: rayp]
#460480
07/02/16 19:32
07/02/16 19:32
|
Malice
Unregistered
|
Malice
Unregistered
|
Again under-informed --> I've seen something like this with alpha_refs the alpha near the color is lighter than the alpha map elsewhere. EDIT - AS a EXAMPLE - So there is a reference point, say full black is 0 alpha then any gray above 128 ranges from 1-100% alpha. Like I say, under-informed so just a guess, however it does look like non-shade_c transparency problems I've have with the alpha_ref point. such as here http://www.conitec.net/beta/d3d_alpharef.htmEDIT2 - Based on what happens in 3ds max. The white can be from none 0 alpha blending with a spec.. So you get little color and fade spec mapping , because the alpha at that point is none 0 or above say 50%
Last edited by Malice; 07/02/16 19:36.
|
|
|
Re: ShadeCEVO simple grass (OVERLAY) ?
[Re: ]
#460482
07/02/16 19:45
07/02/16 19:45
|
Joined: Jul 2008
Posts: 2,107 Germany
rayp
OP
X
|
OP
X
Joined: Jul 2008
Posts: 2,107
Germany
|
Ok... Ill try next to Play around with the texture. Meanwhile i got a first result with Alibabas post. I dont know yet how much Performance this eats. And the ShadeC Terrain renders without Errors too
action Grass_WED(){
set (my, PASSABLE);
//my.material = mtl_carWindow;
sc_ent_softSprite(me, vector(128,128,128), 1, 1, 0);
reset (my, DYNAMIC);
}
main function:
sc_screen_default.settings.forward.enabled = 1;
add the terrainmaterial
BMAP* sc_bmap_terrainColor = "terrain_color.dds";
MATERIAL* sc_ent_Terrain =
{
skin1 = sc_bmap_terrainColor;
effect = "terr.fx";
}
terr.fx
/******************************************************************************************************
Terrain-Shader by Wolfgang "BoH_Havoc" Reichardt
Entity Textures:
Skin1 = Global Colormap
Skin2 = Tile-Colormask (RGB) + Shadow (A)
Skin3 = Global Normalmap
Skin4 = Tile-Normalmap (RGB) + Specularmap (A) (Quad-Texture)
Material Textures:
Skin1 = Tile-Color (Quad-Texture)
Usage:
******************************************************************************************************/
/***************************************TWEAKABLES*****************************************************/
float shadowAlpha = 0.25; //shadowalpha of bumpmapping
float texShadowAlpha = 0.25; //shadowalpha of shadowtexture
/***************************************SHADER*CODE****************************************************/
texture entSkin1; //colormap
texture entSkin2; //global normalmap + Shadow
texture entSkin3; //colormask
texture entSkin4; //normalmaps
texture mtlSkin1; //colormaps
matrix matWorld;
matrix matWorldInv;
matrix matViewInv;
matrix matWorldViewProj;
float4 vecSunPos;
float4 vecSunColor;
float4 vecLightPos[8];
float4 vecViewPos;
float4 vecFog;
#define DOSUN
sampler colorSampler = sampler_state
{
Texture = <entSkin1>;
MinFilter = Linear;
MagFilter = Linear;
MipFilter = Linear;
};
sampler maskSampler = sampler_state
{
Texture = <entSkin2>;
MinFilter = Linear;
MagFilter = Linear;
MipFilter = Linear;
};
sampler globalNormSampler = sampler_state
{
Texture = <entSkin3>;
MinFilter = Linear;
MagFilter = Linear;
MipFilter = Linear;
};
sampler normSampler = sampler_state
{
Texture = <entSkin4>;
MinFilter = Linear;
MagFilter = Linear;
MipFilter = Linear;
};
sampler tileColorSampler = sampler_state
{
Texture = <mtlSkin1>;
MinFilter = Linear;
MagFilter = Linear;
MipFilter = Linear;
};
void terrain_VS(
in float4 InPos: POSITION,
in float3 InNormal: NORMAL,
in float2 InTex: TEXCOORD0,
in float3 InTangent : TEXCOORD0,
in float2 InShadow : TEXCOORD1,
out float4 OutPos: POSITION,
out float2 OutTex: TEXCOORD0,
out float4 OutLight: TEXCOORD1,
out float3 OutViewDir: TEXCOORD2,
out float3 OutWorldNormal : TEXCOORD3,
out float3 OutWorldTangent : TEXCOORD4,
out float3 OutWorldBinorm : TEXCOORD5,
out float3 OutWorldPos : TEXCOORD6,
out float OutFog : FOG)
{
// Transform the vertex from object space to clip space:
OutPos = mul(InPos, matWorldViewProj);
// Pass the texture coordinate to the pixel shader:
OutTex.xy = InTex;
float3 PosWorld = mul(InPos, matWorld);
//Light
#ifdef DOSUN
OutLight.xyz = vecSunPos - PosWorld;;
OutLight.w = 100000;//distance(PosWorld,vecLightPos[0])/vecLightPos[0].w;
#else
OutLight.xyz = vecLightPos[0] - PosWorld;
OutLight.w = 0;
if(vecLightPos[0].w < 100000) OutLight.w = 1-distance(PosWorld,vecLightPos[0])/vecLightPos[0].w;
#endif
//
//Specular Lighting
#ifdef DOSUN
OutViewDir = (vecSunPos) - mul(InPos, matWorld);
#else
OutViewDir = (vecLightPos[0]) - mul(InPos, matWorld);
#endif
//
//Misc Output
float3 Binormal = cross(InNormal,InTangent);
OutWorldNormal.xyz = mul(InNormal, matWorld).xyz;
OutWorldTangent.xyz = mul(InTangent, matWorld).xyz;
OutWorldBinorm.xyz = mul(Binormal, matWorldInv).xyz;
OutWorldPos = PosWorld;
//
//Fog
OutFog = 1 - (distance(PosWorld, vecViewPos) - vecFog.x) * (vecFog.z);
//
}
float4 terrain_PS(
float2 Tex : TEXCOORD0,
float4 InLight: TEXCOORD1,
float3 InViewDir: TEXCOORD2,
float3 InWorldNormal : TEXCOORD3,
float3 InWorldTangent : TEXCOORD4,
float3 InWorldBinorm : TEXCOORD5,
float3 InWorldPos : TEXCOORD6
):COLOR0
{
float4 Color = tex2D(colorSampler, Tex);
float4 colorMask = tex2D(maskSampler, Tex);
float2 Tile = Tex*40;
Tile = frac(Tile)*(0.5-2*0.004)+0.004;
float4 color = tex2D(colorSampler, Tex);
float4 color1 = tex2D(tileColorSampler, Tile)*colorMask.r;
float4 color2 = tex2D(tileColorSampler, Tile+float2(0.5, 0.0))*colorMask.g;
float4 color3 = tex2D(tileColorSampler, Tile+float2(0.0, 0.5))*colorMask.b;
float4 normal1 = tex2D(normSampler, Tile)*colorMask.r;
float4 normal2 = tex2D(normSampler, Tile+float2(0.5, 0.0))*colorMask.g;
float4 normal3 = tex2D(normSampler, Tile+float2(0.0, 0.5))*colorMask.b;
float3 Ln = normalize(InLight.xyz);
float3 Nn = normalize(InWorldNormal);
float3 Tn = normalize(InWorldTangent);
float3 Bn = normalize(InWorldBinorm);
float3 Nb = 0;
float3 Vn = 0;
float3 Hn = 0;
float4 lighting = 0;
float gloss = normal1.a + normal2.a + normal3.a;
float3 bumpNormal = (normal1.rgb+normal2.rgb+normal3.rgb);
//bumpNormal += tex2D(globalNormSampler, Tex).xyz;
bumpNormal = lerp(bumpNormal, tex2D(globalNormSampler, Tex).xyz, 0.5);
Nb = Nn + (bumpNormal.x * Tn + bumpNormal.y * Bn);
Nb = normalize(Nb);
Vn = normalize(InViewDir);
Hn = normalize(Vn + Ln);
lighting = lit(dot(Ln,Nb),dot(Hn,Nb),1);
Color.rgb = saturate(clamp(lighting.y, shadowAlpha, 1)*vecSunColor*2);
//Color.rgb = lighting.y+lighting.z;
Color.rgb *= lerp(color, (color1+color2+color3), 0.5);
//Color.rgb *= color;
//Color.rgb *= color*(color1+color2+color3);
//Color.rgb *= 2;
//Color.rgb = clamp(Color.rgb,0,1);
Color.rgb += lighting.z*gloss*Color.rgb;
Color.rgb = clamp(Color.rgb, 0, 1);
Color.rgb *= clamp(colorMask.a,texShadowAlpha,1);
Color.a = 1;
//Color.rgb = (color1+color2+color3);
/*
//VELVETY
Vn = normalize(matViewInv[3].xyz - InWorldPos);
half3 velvety1;
float vdn = 0.4-dot(Vn,Nn);
float3 vecColor = float4(vdn.xxx,1.0);
velvety1 = float4((vecColor).xyz,1);
velvety1 = clamp(velvety1,0,1);
Color.rgb += velvety1*gloss;
//
*/
return float4(Color.rgb,1);
}
technique terrain
{
pass p0
{
//cullmode = none;
//zwriteenable = true;
//alphablendenable = true;
VertexShader = compile vs_2_0 terrain_VS();
PixelShader = compile ps_2_a terrain_PS();
}
}
edit: @Malice Youre right! The alpha-map is no solid White, its faded. No matter what i do with the alphachannel, White-sh* stays ( only black and White now ). Only with Alibabas code the grass renders. edit2: Putting all this together took my weekend until now edit3: Finally grass on Terrain in shadeC evo, in deep-night Setting with fog ( but not the shadeC-terrain-material is used cause it wont react on lights and shadows, shot Shows mtl_car on Terrain.mdl ) Strangly, this time i cant go below camera_clip.far = 2500 btw, some strange visuals are Happening then.
Acknex umgibt uns...zwischen Dir, mir, dem Stein dort... "Hey Griswold ... where u gonna put a tree that big ?" 1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected rayp.flags |= UNTOUCHABLE;
|
|
|
Re: ShadeCEVO simple grass (OVERLAY) ?
[Re: rayp]
#460486
07/02/16 21:24
07/02/16 21:24
|
Joined: Jul 2008
Posts: 2,107 Germany
rayp
OP
X
|
OP
X
Joined: Jul 2008
Posts: 2,107
Germany
|
I simply added one house-model two times into the example ShadeC scene. The house comes from a Unity map, a complete town Level i bought btw. Now the graphic looks cool, but 15fps. Is Acknex really that slow ? No DoF no sun shadows, camera_clip_far = 2500. Pretty much useless all in all. edit: disabled all pp effects, same result. Reseting DYNAMIC flag of the houses solved the Problem as it seams. With all pp stuff ( HDR, SSAO, DOF etc ) But the Terrain is still a problem.
Last edited by rayp; 07/02/16 22:38.
Acknex umgibt uns...zwischen Dir, mir, dem Stein dort... "Hey Griswold ... where u gonna put a tree that big ?" 1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected rayp.flags |= UNTOUCHABLE;
|
|
|
Re: ShadeCEVO simple grass (OVERLAY) ?
[Re: rayp]
#460491
07/02/16 23:24
07/02/16 23:24
|
Malice
Unregistered
|
Malice
Unregistered
|
No. Is that a memory pointer?
Could you use SED and 'find in file' any error handling? If it's a code then it could be in the script as a printf command. Or maybe that's some type of pointer and the printf(error:) is meant to show the pointer of the trouble object.
|
|
|
Re: ShadeCEVO simple grass (OVERLAY) ?
[Re: ]
#460492
07/02/16 23:26
07/02/16 23:26
|
Joined: Jul 2008
Posts: 2,107 Germany
rayp
OP
X
|
OP
X
Joined: Jul 2008
Posts: 2,107
Germany
|
I just took the example Scene from shadec and pressed publish... edit: no code added. edit: only a house and grass model added more than frustrating right now
Last edited by rayp; 07/02/16 23:28.
Acknex umgibt uns...zwischen Dir, mir, dem Stein dort... "Hey Griswold ... where u gonna put a tree that big ?" 1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected rayp.flags |= UNTOUCHABLE;
|
|
|
Re: ShadeCEVO simple grass (OVERLAY) ?
[Re: rayp]
#460493
07/02/16 23:28
07/02/16 23:28
|
Malice
Unregistered
|
Malice
Unregistered
|
I'm getting shade-c evo now github??
Do the engine still fail to bind the d3dx..... shader stuff when making a build. I had to copy the dll (s) by hand in the past.
|
|
|
Re: ShadeCEVO simple grass (OVERLAY) ?
[Re: ]
#460494
07/02/16 23:28
07/02/16 23:28
|
Joined: Jul 2008
Posts: 2,107 Germany
rayp
OP
X
|
OP
X
Joined: Jul 2008
Posts: 2,107
Germany
|
so i did before edit: i mean copyed the DLL's by Hand, then i saw the Screen. Funny Thing is, caused by sky_color its a bluescreen. Yes. if you dont find it, i can upload a Version.
Last edited by rayp; 07/02/16 23:29.
Acknex umgibt uns...zwischen Dir, mir, dem Stein dort... "Hey Griswold ... where u gonna put a tree that big ?" 1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected rayp.flags |= UNTOUCHABLE;
|
|
|
Re: ShadeCEVO simple grass (OVERLAY) ?
[Re: rayp]
#460495
07/02/16 23:33
07/02/16 23:33
|
Malice
Unregistered
|
Malice
Unregistered
|
Got it... 01 example published with file errors.. Checking them now. Publish from sed file from in 01.cd loaded and run fine but I have the same printf error box as well.
Looking deeper now.
|
|
|
|