Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, alibaba), 1,184 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 4 1 2 3 4
Re: Placing panels behind the view... [Re: lyingmime] #125794
05/03/07 15:53
05/03/07 15:53
Joined: Aug 2000
Posts: 7,490
O
Orange Brat Offline OP

Senior Expert
Orange Brat  Offline OP

Senior Expert
O

Joined: Aug 2000
Posts: 7,490
Quote:

Just as a thought, you want to make sure that the shadows appear only on the object's faces that are facing the camera (since the object itself is invisible you might see through to the shadow on the other side of the object) because when you position the shadow in front of a sprite or panel you're going to want only the 'forward' shadow shape.





Yes, that is a potentially huge problem. Thoughtful design would be required, however the non-clipping nature of stencil shadows requires that anyway.


My User Contributions master list - my initial post links are down but scroll down page to find list to active links
Re: Placing panels behind the view... [Re: Orange Brat] #125795
05/03/07 16:46
05/03/07 16:46
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Two comments:

- Shadows on invisible models should be possible by using nontransparent models with an FFP effect that renders only into the z buffer, but nothing to the screen buffer. I haven't tried it, though.

- I don't think that it makes sense to use view entities for a 2D game. They are not meant for simulating level entities. All the collision detection and lighting functions work with level entities, so there's no real reason why someone would want to use view entities. You just need to restrict the movement of the level entities to 2 dimensions.

However, a useful feature could be to have sky layers at a certain z position, so that some level entities are in front and some behind the sky layers.

Re: Placing panels behind the view... [Re: jcl] #125796
05/04/07 05:48
05/04/07 05:48
Joined: Sep 2005
Posts: 96
L
lyingmime Offline
Junior Member
lyingmime  Offline
Junior Member
L

Joined: Sep 2005
Posts: 96
Setting a z-position for sky entities and allowing models to display behind them would be very useful indeed. However, to be truly useful for our purposes, sky entities would also have to be able to use planar images (in addition to cylinder, dome, and cube) that always face the camera and that can be easily animated without much hit to the framerate (using a bmap object pointer would be a start).

It would be useful if all sky entity types could be easily animated, as I imagine that many people would want to prerender a cycling animation of clouds to use as their sky texture, for example.

Re: Placing panels behind the view... [Re: lyingmime] #125797
05/04/07 13:39
05/04/07 13:39
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Ok, we'll implement a sky flag for camera-independent images. You can then also animate or run movies on that sky texture.

Re: Placing panels behind the view... [Re: jcl] #125798
05/04/07 20:52
05/04/07 20:52
Joined: Sep 2005
Posts: 96
L
lyingmime Offline
Junior Member
lyingmime  Offline
Junior Member
L

Joined: Sep 2005
Posts: 96
Awesome. Will that include distance from camera (z-position) to depth sort with level entities?

Sky flag for camera-independent images [Re: jcl] #125799
08/01/07 06:52
08/01/07 06:52
Joined: Sep 2005
Posts: 96
L
lyingmime Offline
Junior Member
lyingmime  Offline
Junior Member
L

Joined: Sep 2005
Posts: 96
The obvious way to get around the need for this feature is to create a sprite at screen resolution, that always faces the camera, and that fills the whole screen. When it comes to scaling, I do this:

sprite.scale_x = ftan(camera.arc/2,distance_from_camera*2/camera.size_x);
sprite.scale_y = (camera.size_x*3*sprite.scale_x)/(camera.size_y*4);

And I notice that it has a curiously high margin of error. Checking the documentation, I see that scale_x and _y can only range 0.01..100! I get popping as the image tries to scale to the size of the screen at different distances, my layers of sprites never quite align, and I never get the sweet clarity of an image displayed at its native resolution, 1:1.

Camera-independent images in the level are the preferred solution, but increasing scale precision might work too? I look forward to features like this that will make 2.5D games easier to make.

Re: Sky flag for camera-independent images [Re: lyingmime] #125800
08/01/07 16:31
08/01/07 16:31
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline
Expert
xXxGuitar511  Offline
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
I'm just using a simple shader that acts as if the rendering was paused, but dynamic objects can still move around...

works perfectly!


xXxGuitar511
- Programmer
Re: Sky flag for camera-independent images [Re: xXxGuitar511] #125801
08/01/07 20:06
08/01/07 20:06
Joined: Sep 2005
Posts: 96
L
lyingmime Offline
Junior Member
lyingmime  Offline
Junior Member
L

Joined: Sep 2005
Posts: 96
guitar, I'm not sure what you mean. Is your shader something like this?

VS_OUTPUT vs_main(float4 Pos: POSITION)
{
VS_OUTPUT Out;
Out.Pos = float4(Pos.xy,0,1);
Out.texCoord.x = 0.5*(1+Pos.x-viewport_inv_width);
Out.texcoord.y = 0.5*(1-Pos.y-viewport_inv_width);
return Out;
}

I'm not great with shaders, I'm afraid. Could you tell me if you can do each of the following?

Can level entities go in front of and behind your shader output? (Does this render plane have a z-depth in the level? If it does, how do you give it one?)
Can you stack multiple such render planes at different depths in the level with transparency?
Can you animate the texture, either from avi or from a single image like sprite animation?

I like that a solution that uses sprite or sky entities would come with the feature set that these types have. preload_mode and easy script control over position and animation...

(Come to think of it, does preload_mode apply to ent_createlayer?)

Re: Sky flag for camera-independent images [Re: lyingmime] #125802
08/02/07 05:33
08/02/07 05:33
Joined: Aug 2000
Posts: 7,490
O
Orange Brat Offline OP

Senior Expert
Orange Brat  Offline OP

Senior Expert
O

Joined: Aug 2000
Posts: 7,490
There's a thread in scripting started by me where he goes into a bit of detail about it.

If I interpret it correctly, he's simply creating a detailed level in WED (??), complete with shaders, or model based given the shaders. He sets his camera positions, and takes a snapshot of the level with everything turned on from the camera. This is his background, and his hidden scene geometry is in place and should match. I would suggest. XxX that you simplify the hidden geometry if non-visible geometry has an influence on the framerate. There's no reason to use the super detailed version for simple collision. Per Wintermute's techniques, the only parts of the collision hull that require extra detail are the portions that stencil shadows should cast on. Everything else can be simple cubes or whatever.

For go behind/go in front of object, he'll need to take snapshots of those isolated sections and place them via whatever method he chooses. Some kind of triggering method will need to be established if he uses panels and layers. If the player falls below a certain horizontal value then the player can walk in front of these objects and if they're above it then it can go behind it. I think Wintermute does this based on the origin which is generally located at the bottom center of the isolated sprite/panel element.

You can read all about how they do it in their latest manual:

http://www.mediafire.com/?em93txnmg3q


My User Contributions master list - my initial post links are down but scroll down page to find list to active links
Re: Sky flag for camera-independent images [Re: Orange Brat] #125803
08/03/07 05:49
08/03/07 05:49
Joined: Sep 2005
Posts: 96
L
lyingmime Offline
Junior Member
lyingmime  Offline
Junior Member
L

Joined: Sep 2005
Posts: 96
In cases where there are two level entities, one in front of the wall and the other behind it, guitar's method can work by using the geometry in his level to occlude the entities when they step behind objects. However, this is limited to cases where the image in the panels is a render of the level geometry at the same polygon count. (If he is not doing this, then you are right that he should use very simple stand-in geometry for collisions.)

My purpose for using panels is to use hand-drawn images or high poly count renders (souped up with radiosity and the like), and for this purpose, my stand-in level geometry cannot occlude correctly (at the sort of poly counts that can be rendered in real time).

There's a variation on that that might work, however. Have a view rendering entities in front of the wall to one panel and another view (positioned identically) rendering entities behind the wall to another panel. Then, arrange the layers for these panels versus the background and wall panels.

If an entity moves in front of the wall, it must switch views so that it is rendered to the panel in front of the wall. This should be possible using render_view to change the entity's material. Hopefully, the frame rate hit won't be too bad, since entities should only ever be visible in one view per frame.

I don't like that I will need n views per level, where n is the number of possible layers for the entity. I'm going to end up needing view_remove (which guitar requested not too long ago).

Of course, camera-independent sky entities or very precisely scaled sprites get around the problem entirely by virtue of being in the level and having transparency channels.

Last edited by lyingmime; 08/03/07 06:12.
Page 2 of 4 1 2 3 4

Moderated by  aztec, 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