Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 975 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
shadow disappears when arc<0 #406272
08/15/12 21:30
08/15/12 21:30
Joined: Mar 2007
Posts: 197
Y
yorisimo Offline OP
Member
yorisimo  Offline OP
Member
Y

Joined: Mar 2007
Posts: 197
I am using shadow_stencil = 1 in A8.4 Pro. Shadows appear fine when arc>0. However, if I set arc<0 the shadows disappear. I am using the default "camera" view. I have tried resetting the NOSHADOW flag but it doesn't seem to make a difference.

Is there any way to get the shadows to appear with negative (mirrored) arc values?


Joris Lambrecht
My Contributions: Relative Rotation, Window Sizing
Re: shadow disappears when arc<0 [Re: yorisimo] #406297
08/16/12 11:14
08/16/12 11:14
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline
Senior Expert
HeelX  Offline
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
Why do you need a negative arc?

Re: shadow disappears when arc<0 [Re: HeelX] #406305
08/16/12 14:07
08/16/12 14:07
Joined: Mar 2007
Posts: 197
Y
yorisimo Offline OP
Member
yorisimo  Offline OP
Member
Y

Joined: Mar 2007
Posts: 197
We have a simulator in which the player's right arm is used to perform certain actions. For a left-handed player, we just use a negative arc to flip the scene. This way we don't need separate model or world setup for the left-handed players. It works great, except that the shadows don't appear.

Re: shadow disappears when arc<0 [Re: yorisimo] #406306
08/16/12 14:25
08/16/12 14:25
Joined: Apr 2008
Posts: 650
Sajeth Offline
User
Sajeth  Offline
User

Joined: Apr 2008
Posts: 650
Or you could just use a simple shader to mirror the view?


Teleschrott-Fan.
Re: shadow disappears when arc<0 [Re: Sajeth] #406307
08/16/12 14:38
08/16/12 14:38
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline
Senior Expert
HeelX  Offline
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
Using the arc for such tricks might work in some cases, but is a very dirty trick. Follow sajeth's suggestion and simply mirror the view with a small and fast PP shader.

Re: shadow disappears when arc<0 [Re: HeelX] #406308
08/16/12 17:07
08/16/12 17:07
Joined: Mar 2007
Posts: 197
Y
yorisimo Offline OP
Member
yorisimo  Offline OP
Member
Y

Joined: Mar 2007
Posts: 197
I don't understand why using arc<0 is a dirty trick. It is supported in the manual for the purposes of making a mirrored scene. I understand that in some cases, shadows should be turned off in a mirror to allow higher framerates, but this should be an option not a requirement (furthermore I don't see this limitation actually noted anywhere).

In any case, I tried the shader method and it works. However, I'm new to shaders so I'm not sure my method is the most ideal. Can you check out my .fx file below?

pp_fliphorizontal.fx
Code:
Texture TargetMap;
sampler2D g_samSrcColor = sampler_state { texture = <TargetMap>; MipFilter = Linear;	};

float4 vecSkill1;//

float4 postprocessing_fliphoriz(float2 Tex : TEXCOORD0) : COLOR0 
{  
	return tex2D(g_samSrcColor, float2(1-Tex.x, Tex.y));
}

technique PostProcess 
{
	pass p1 
	{
		AlphaBlendEnable = false;	
		VertexShader = null;
		PixelShader = compile ps_2_0 postprocessing_fliphoriz();
	}
}



defined in my main.c file:
Code:
MATERIAL* mtl_fliphorizontal =
{
	effect = "pp_fliphorizontal.fx";
}



in my main function before loading my level:
Code:
pp_set(camera, mtl_fliphorizontal);




Joris Lambrecht
My Contributions: Relative Rotation, Window Sizing
Re: shadow disappears when arc<0 [Re: yorisimo] #406311
08/16/12 17:53
08/16/12 17:53
Joined: Apr 2008
Posts: 650
Sajeth Offline
User
Sajeth  Offline
User

Joined: Apr 2008
Posts: 650
Yes, as far as I can see, this is the "shortest" and cleanest way to achieve this effect.


Teleschrott-Fan.
Re: shadow disappears when arc<0 [Re: Sajeth] #406316
08/16/12 20:59
08/16/12 20:59
Joined: Mar 2007
Posts: 197
Y
yorisimo Offline OP
Member
yorisimo  Offline OP
Member
Y

Joined: Mar 2007
Posts: 197
Thanks. Unfortunately, the shader method doesn't work well for me because I use the NVIDIA 3D Vision system to get stereoscopic viewing (The NVIDIA software automatically creates a left eye image and right eye image from the 3D information the Acknex engine sends to the graphics card . If I could force flip the left and right eye images it would work fine, but as far as I know, the NVIDIA drivers don't have any ability to do that. My only workaround is to wear the glasses upside down which isn't very acceptable.


Joris Lambrecht
My Contributions: Relative Rotation, Window Sizing
Re: shadow disappears when arc<0 [Re: yorisimo] #406319
08/16/12 21:56
08/16/12 21:56
Joined: Apr 2008
Posts: 650
Sajeth Offline
User
Sajeth  Offline
User

Joined: Apr 2008
Posts: 650
And if you set camera.aspect to -1 at the same time? I have a hard time imagining how this looks in the 3d glasses.


Teleschrott-Fan.
Re: shadow disappears when arc<0 [Re: Sajeth] #406320
08/16/12 22:49
08/16/12 22:49
Joined: Mar 2007
Posts: 197
Y
yorisimo Offline OP
Member
yorisimo  Offline OP
Member
Y

Joined: Mar 2007
Posts: 197
Putting the glasses on upside down just switches which eye sees which image at which time. These are shutter glasses so you're still looking at the computer monitor, so the image would be upside down with a negative aspect. And, as far as I tried, setting the aspect to negative values (vertical flip) also causes the shadows to disappear.


Joris Lambrecht
My Contributions: Relative Rotation, Window Sizing

Moderated by  HeelX, Spirit 

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