Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
2 registered members (steyr, alibaba), 534 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Entity should be visible behind a wall / "Wall hack" #299072
11/21/09 00:48
11/21/09 00:48
Joined: Aug 2002
Posts: 2,183
Germany, BaW�
Rondidon Offline OP
Expert
Rondidon  Offline OP
Expert

Joined: Aug 2002
Posts: 2,183
Germany, BaW�
Hi guys,

I want to script a Lense Flare effect in Lite-C and am wondering if it`s possible to render a flare map in a way that it`s always visible even when hidden by a wall. The effect should be usable for lights, not for the sun.

------------------------

Hallo Leute,

ich möchte einen Lense Flare Effekt programmieren. Das Problem dabei ist lediglich, dass Sprites hinter Mauern normalerweise nicht gerendert werden bzwz. nicht angezeigt werden. Ist es möglich eine Art Wall hack zu programmieren? Wie schaffe ich es, dass solche Sprites auch durch Mauern hindurch angezeigt werden?

Re: Entity should be visible behind a wall / "Wall hack" [Re: Rondidon] #299075
11/21/09 02:50
11/21/09 02:50
Joined: May 2009
Posts: 1,816
at my pc (duh)
darkinferno Offline
Serious User
darkinferno  Offline
Serious User

Joined: May 2009
Posts: 1,816
at my pc (duh)
no idea what you want but you can try the set(my,ZNEAR); this will show the entity above all models

Re: Entity should be visible behind a wall / "Wall hack" [Re: darkinferno] #299076
11/21/09 03:04
11/21/09 03:04
Joined: Aug 2002
Posts: 2,183
Germany, BaW�
Rondidon Offline OP
Expert
Rondidon  Offline OP
Expert

Joined: Aug 2002
Posts: 2,183
Germany, BaW�
Yes, but it should be visible above both models and level geometry. Is this possible?

This is you, the wall, and the sprite:

o | x

The sprite should be visible even when hidden by a wall like in my illustration. I want to script a lense flare effect that slowly fades out when it gets behind a wall. This looks smoother than most of the other methods. And it has the pro that you can use 3D glasses with lense flares activated. Now is this possible laugh ?

Last edited by Rondidon; 11/21/09 03:22.
Re: Entity should be visible behind a wall / "Wall hack" [Re: Rondidon] #299083
11/21/09 09:04
11/21/09 09:04
Joined: Aug 2008
Posts: 482
B
bart_the_13th Offline
Senior Member
bart_the_13th  Offline
Senior Member
B

Joined: Aug 2008
Posts: 482
2 ways I know to do this(Since I used the same method for fake bloom):
1. Use view entity, but the position calculation is a lil complex
2. Use panel, quite easy by only using vec_to_screen.

Hope it helps

Re: Entity should be visible behind a wall / "Wall hack" [Re: bart_the_13th] #299085
11/21/09 09:16
11/21/09 09:16
Joined: May 2008
Posts: 2,113
NRW/Germany
alibaba Online
Expert
alibaba  Online
Expert

Joined: May 2008
Posts: 2,113
NRW/Germany
das mit den ZNEAR müste doch klappen?


Professional Edition
A8.47.1
--------------------
http://www.yueklet.de
Re: Entity should be visible behind a wall / "Wall hack" [Re: alibaba] #299090
11/21/09 10:43
11/21/09 10:43
Joined: Aug 2008
Posts: 482
B
bart_the_13th Offline
Senior Member
bart_the_13th  Offline
Senior Member
B

Joined: Aug 2008
Posts: 482
Sometime ZNEARed object get clipped by anything comes too close to camera, especially when it's too far from the camera...

Re: Entity should be visible behind a wall / "Wall hack" [Re: bart_the_13th] #299093
11/21/09 11:41
11/21/09 11:41
Joined: Feb 2009
Posts: 2,154
Damocles_ Offline
Expert
Damocles_  Offline
Expert

Joined: Feb 2009
Posts: 2,154
In an old XSpire demo, I used such a Flare Effect.

The flare itself was a just a transparent panel.
It was positioned on the 2D screen according to the
3D ancorpoint of the lightemitter in the game.
-> vec_to_screen ( VECTOR*, VIEW*); command

I used a trace from the camera to the ancorpoint every
second to see if I should turn the sprite on or off.

It was just like the UT99 glare effect then.
Where in UT99, the glare is also not a 3D object (keeps
the same size)

You can use the alpha value of the panel to fade it
smoothy in and out. And also fade it out depending on the
distance to the camera.


Re: Entity should be visible behind a wall / "Wall hack" [Re: Damocles_] #299113
11/21/09 15:33
11/21/09 15:33
Joined: Aug 2002
Posts: 2,183
Germany, BaW�
Rondidon Offline OP
Expert
Rondidon  Offline OP
Expert

Joined: Aug 2002
Posts: 2,183
Germany, BaW�
Thanks alot guys, I`ll try this out. laugh

Re: Entity should be visible behind a wall / "Wall hack" [Re: Rondidon] #299158
11/21/09 21:49
11/21/09 21:49
Joined: Aug 2002
Posts: 2,183
Germany, BaW�
Rondidon Offline OP
Expert
Rondidon  Offline OP
Expert

Joined: Aug 2002
Posts: 2,183
Germany, BaW�
Okay now here`s my code. It works, but still just for one entity. Is it possible to get it working for more than one entity using the same action? If so, how?

EDIT: Got it. It was quite easy. You can watch and use the code shown further down.

Another problem: The flare varies its size depending on the screen resolution. If I try to manage this problem by varying the size_x / size_y variable of the panel, it doesn`t show anymore. Is this a coding error of me? Is there any other solution out there away from using Entities?

Code:
action adr_flarewhite()
{		
	proc_mode = PROC_LATE;
	
	PANEL* flare;
	STRING* flare_white = { bmap = "lens_white.tga"; flags = TRANSLUCENT; layer = 1; alpha = 0; }
	flare = pan_create(flare_white,1);
	
	var flarepos[3];
	
	set(my,INVISIBLE|PASSABLE);

	while(1)
	{
		vec_set(flarepos,my.x);
		result = c_trace(camera.x,my.x,IGNORE_PASSABLE|IGNORE_SPRITES|IGNORE_CONTENT|USE_AABB);
		if((result == 0) && (vec_to_screen(flarepos,camera) != NULL) )
		{	
			set(flare,SHOW);	
			while(flare.alpha<40)
			{
				vec_set(flarepos,my.x);
				vec_to_screen(flarepos,camera);
				flare.pos_x = flarepos[0]-64;
				flare.pos_y = flarepos[1]-64;	
				flare.alpha += 10*time_step;
				wait(1);
			}
			vec_set(flarepos,my.x);
			vec_to_screen(flarepos,camera);
			flare.pos_x = flarepos[0]-64;
			flare.pos_y = flarepos[1]-64;	
		}
		else
		{
			while(flare.alpha>0)
			{
				vec_set(flarepos,my.x);
				vec_to_screen(flarepos,camera);
				flare.pos_x = flarepos[0]-64;
				flare.pos_y = flarepos[1]-64;		
				flare.alpha-=10*time_step;
				wait(1);
			}
			reset(flare,SHOW);
		}
		wait(1);
	}
}



Last edited by Rondidon; 11/21/09 22:43. Reason: The solution
Re: Entity should be visible behind a wall / "Wall hack" [Re: Rondidon] #299275
11/22/09 16:47
11/22/09 16:47
Joined: Aug 2002
Posts: 2,183
Germany, BaW�
Rondidon Offline OP
Expert
Rondidon  Offline OP
Expert

Joined: Aug 2002
Posts: 2,183
Germany, BaW�
Hello,

Here are two screenshots showing the result. Thanks alot guys.






Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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