Gamestudio Links
Zorro Links
Newest Posts
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
Data from CSV not parsed correctly
by jcl. 04/20/24 08:32
Zorro FIX plugin - Experimental
by jcl. 04/20/24 08:30
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (7th_zorro, Aku_Aku, 1 invisible), 604 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: ShadeC-EVO Wasser?? [Re: DexLoomer] #459704
05/31/16 22:46
05/31/16 22:46
Joined: Jul 2008
Posts: 2,107
Germany
rayp Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,107
Germany
Hast Du denn auch in der main function folgendes beachtet?
Code:
shadow_stencil = -1; // "3rd party shadows"


Und in der Entity die Schatten werfen soll das Flag Shadow gesetzt?
Code:
set (my, SHADOW); // oder anstelle von "my" eben der Pointer



MfG


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: ShadeC-EVO Wasser?? [Re: rayp] #459752
06/02/16 21:40
06/02/16 21:40
Joined: Jan 2006
Posts: 168
Germany, Hannover
DexLoomer Offline OP
Member
DexLoomer  Offline OP
Member

Joined: Jan 2006
Posts: 168
Germany, Hannover
Hi rayp,
danke für den Tip. Aber ganz klappt es damit nicht. Ich hab zwar Schatten, diese sind aber durch das Sonnenlich. Ich werde am Wochenende das ganze noch einmal ausprobieren und damit experimentieren.
Mfg


A8-Com-v 8.47.1
Re: ShadeC-EVO Wasser?? [Re: DexLoomer] #459757
06/03/16 03:04
06/03/16 03:04
Joined: Jul 2008
Posts: 2,107
Germany
rayp Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,107
Germany
In die main:
Code:
sc_screen_default.settings.lights.sunShadows          =     0; //enable shadows for the sun	
	sc_screen_default.settings.lights.sunShadowResolution =   512; //reduce shadow resolution as we are manually setting the shadow range to 5000 and can therefor get away with a small shadowmap   
	sc_screen_default.settings.lights.sunPssmSplitWeight  =   0.7; // 0.7 high res near splits, low res far splits
	sc_screen_default.settings.lights.sunShadowRange      =  1000; //manually set the shadow range...we don't need realtime shadows in the far distant! If set to 0 (default) shadow range will be set to camera.clip_far
	sc_screen_default.settings.lights.sunShadowBias       = 0.001; //set the shadow bias 0.001

Greets

edit: Eigentlich sollten die Schatten aber auch so gehen. Du hast ein ShadeC - dynamisches Licht erstellt ja?
Code:
action shadeCE_light(){
	set (my, PASSABLE | INVISIBLE);
        sc_light_create (vector (my.x, my.y, my.z), my.skill4,
	                 vector (my.skill1, my.skill2, my.skill3),
	                 SC_LIGHT_SPOT | SC_LIGHT_SPECULAR | SC_LIGHT_SHADOW,
	                 vector (my.pan, my.tilt, my.roll), my.skill5);
}

Zu beachten SC_LIGHT_SHADOW, damit wirft das Licht Schatten. Anstelle von SC_LIGHT_SPOT ( Spotlight ) kannst Du auch SC_LIGHT_POINT ( Punktlicht ) benutzen.
Entfernen kannst Du die Lichter mittels
Code:
if (entity-pointer-here) sc_light_remove (entity-pointer-here);

Und in der Entity die Schatten werfen soll hast Du das Shadow-Flag gesetzt ja?
Code:
set (my, SHADOW);

Hast Du das alles beachtet werden Schatten da sein.


Die internen Lichter kannst Du knicken, wenn Du ShadeC benutzt.

Last edited by rayp; 06/03/16 03: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: ShadeC-EVO Wasser?? [Re: rayp] #459759
06/03/16 06:59
06/03/16 06:59
Joined: May 2008
Posts: 2,113
NRW/Germany
alibaba Offline
Expert
alibaba  Offline
Expert

Joined: May 2008
Posts: 2,113
NRW/Germany
In 0.91 gibts keine Schatten für dynamische Lichter


Professional Edition
A8.47.1
--------------------
http://www.yueklet.de
Re: ShadeC-EVO Wasser?? [Re: alibaba] #459762
06/03/16 10:24
06/03/16 10:24
Joined: Jul 2008
Posts: 2,107
Germany
rayp Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,107
Germany
So fern wir von shadeC evo reden, wird mein beispiel zu schatten führen, wers nicht glaubt, probieren, fakt
Mfg
Ein Beispiel einer Taschenlampe mit dynamischen Licht. Man beachte den schönen Schatten, ShadeC EVO 0.91 ( BETA if theres any difference )

Quote:
SC_LIGHT_SHADOW


edit:
Bei nicht - EVO bin ich mir nicht sicher, wie's da ist. Hatte nicht gesehen / gerafft das wir inzwischen nicht mehr von EVO reden.


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: ShadeC-EVO Wasser?? [Re: rayp] #459791
06/05/16 09:09
06/05/16 09:09
Joined: Jan 2006
Posts: 168
Germany, Hannover
DexLoomer Offline OP
Member
DexLoomer  Offline OP
Member

Joined: Jan 2006
Posts: 168
Germany, Hannover
Hi rayp,
danke für die Tips. Aber in "ShadeC EVO"
https://github.com/BoHHavoc/ShadeC-EVO
habe ich auch Schatten von dynamischen Lichtern hinbekommen, sowie "LichtProjektionsTexturen" wie der Lichtkegel einer Taschenlampe. Nur fünktionierte der Terrain und der Wassershader darin nicht.

In der älteren Version "shade-c_v0.91_BETA_S1"
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=434099&page=1 und
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=420547&page=1
habe ich das Wasser und Terrain hinbekommen, welches ich dringend benötige. Daher bin ich auf diese Version jetzt umgestiegen.
Leider bekomme ich dafür keine Beleuchtung der mit dem Shader versehenen Modelle und Objekte durch dynamische Lichter und die ensprechende Schatten hin! Auch "LichtProjektionsTexturen" gehen nicht. Lediglich Beleuchtung und Schatten durch die Sonne sind möglich, die ich für Indoorlevel nicht brauche.

Ich habe mal eine Beispieldatei erstellt:
http://www.filedropper.com/stuff_11

Mfg Dex


A8-Com-v 8.47.1
Re: ShadeC-EVO Wasser?? [Re: alibaba] #459792
06/05/16 10:41
06/05/16 10:41
Joined: May 2008
Posts: 2,113
NRW/Germany
alibaba Offline
Expert
alibaba  Offline
Expert

Joined: May 2008
Posts: 2,113
NRW/Germany
Originally Posted By: alibaba
In 0.91 gibts keine Schatten für dynamische Lichter


Professional Edition
A8.47.1
--------------------
http://www.yueklet.de
Re: ShadeC-EVO Wasser?? [Re: alibaba] #459797
06/06/16 10:00
06/06/16 10:00
Joined: Jul 2008
Posts: 2,107
Germany
rayp Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,107
Germany
Ich habe es nicht mehr in Erinnerung wies beim alten ShadeC ist, aber ich meine alibaba denkt sich schon was bei seinem Post.

edit: Eine tolle Sache wäre es, wenn ein Shaderfachmann EVO einen Terrainshader verpassen würde.

Last edited by rayp; 06/06/16 10:01.

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: ShadeC-EVO Wasser?? [Re: rayp] #459798
06/06/16 11:24
06/06/16 11:24
Joined: Feb 2011
Posts: 124
Germany Nrw Herford
HenWoll Offline
Member
HenWoll  Offline
Member

Joined: Feb 2011
Posts: 124
Germany Nrw Herford
@rayp
Zitat:Die internen Lichter kannst Du knicken, wenn Du ShadeC benutzt.

schon klar, dies musste ich durch entities und actionen ergänten um die shade-c lichter zu verwenden,

aber was ich damals nicht probiert habe, was mich schon so ziemlich interessiert,
bezieht sich dies auf alle licht arten von acknex ?

Re: ShadeC-EVO Wasser?? [Re: HenWoll] #459799
06/06/16 13:25
06/06/16 13:25
Joined: May 2008
Posts: 2,113
NRW/Germany
alibaba Offline
Expert
alibaba  Offline
Expert

Joined: May 2008
Posts: 2,113
NRW/Germany
Was du machen kannst (ist aber ganz schön dreckig):
-Nimm alten Terrain code von 0.91:
Code:
BMAP* sc_bmap_terrainColor = "terrain_color.dds";

MATERIAL* sc_ent_Terrain =
{
	skin1 = sc_bmap_terrainColor;
	effect = "
/******************************************************************************************************
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();
	}
}


";
}



-aktiviere das forward rendering:
Code:
sc_screen_default.settings.forward.enabled = 1; //enable if you need particles or custom materials which can't be rendered in the deferred pipeline



-weise dem terrain modell den shader zu und fertig

Aber wie gesagt, das ist sehr umständlich und dreckig. Das selbe kannst du mit dem wassershader machen. Alles sollte so funktionieren, wie beim alten ShadeC.


Professional Edition
A8.47.1
--------------------
http://www.yueklet.de
Page 2 of 2 1 2

Moderated by  Blink, Hummel, Superku 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1