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
1 registered members (AndrewAMD), 599 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 3 1 2 3
Re: Sky entities & clip_far [Re: Carlos3DGS] #391174
01/09/12 03:09
01/09/12 03:09
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Ive never had much luck with sky-boxes, but I havent really tried either.

But as I understand it, a sky object will ALWAYS be rendered 'behind'
all other models, even if those models are OUTSIDE the box.

So ignore the _clip values for now. Set them to 'normal'.
And just make your sky-box SMALLER. Say 1000x1000x1000 quants.

See how that goes...


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Sky entities & clip_far [Re: EvilSOB] #391178
01/09/12 03:47
01/09/12 03:47
Joined: Oct 2008
Posts: 513
Carlos3DGS Offline OP
User
Carlos3DGS  Offline OP
User

Joined: Oct 2008
Posts: 513
1000 is actually smaller than my planet, but I tried it with another value and it sort of worked...

No clipping problem, but the edges are now visible.
Looking at the above picture got me thinking... And I remebered something about sky entities I read in the manual:
Quote:
ENTITY* name = { ... flags2 = SKY..; }
Defines a sky texture, sprite, or model with the given name. Sky textures are mapped onto all sky surfaces in the level. Sky models are centered around the camera, so they can cover sky textures, but also level elements, depending on their distance to the camera. An unlimited number of sky entities can be combined. As with view entities, the drawing order is determined by the layer parameter. They are not affected by level light and fog.

This object definately DOES NOT look centered around the camera, it looks like it is centered around the level origin like my planet(0,0,0).
So I zoomed out to make sure:

Zooming out this far I observed two things:
1 - The space sphere (sky) gets smaller and smaller.
2 - When zoomed out far enough the clipping issue appears again

BOTH of these things are evidence that the space "sky" is NOT centered with the camera, but instead stays at the level origin.

So now we have two things that indicate it is not acting as "SKY" (position & clipping).

I am completely lost... What is going on? What am I missing about how to declare sky entities and how they work? It is obvious something is terribly wrong, but I have no idea what it is!

EDIT:
A wierd thought came to me... Mabe a sky entity has to be "attached" to a certain view somehow? So all along the problem might just have been that it was not attached to the camera!
But... How do I attach it to the camera? (if that is even the problem, it might have nothing to do with that and I can't seem to find anything on that subject in the manual)

Last edited by Carlos3DGS; 01/09/12 04:14. Reason: Random Brainstorming

"The more you know, the more you realize how little you know..."

I <3 HORUS
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=401929&page=1
Re: Sky entities & clip_far [Re: Carlos3DGS] #391180
01/09/12 04:00
01/09/12 04:00
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Can you post "SpaceDome.mdl" so I can have a play?

[EDIT]As for attaching to certain VIEWs, thats up to the entities CLIENT_ID value.
By default it attaches to 'camera'...



Last edited by EvilSOB; 01/09/12 04:03.

"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Sky entities & clip_far [Re: EvilSOB] #391181
01/09/12 04:12
01/09/12 04:12
Joined: Oct 2008
Posts: 513
Carlos3DGS Offline OP
User
Carlos3DGS  Offline OP
User

Joined: Oct 2008
Posts: 513
Originally Posted By: EvilSOB
Can you post "SpaceDome.mdl" so I can have a play?

Sure! Here it is:
www.megaupload.com/?d=OVNONXZL
Hope you are more successful than me. Also, if you like it you are welcome to keep/use the model for whatever you like. But keep in mind it was designed as a placeholder for testing, I am not happy with the resolution or the wasted texture space.
I have higher res versions of the galaxies/nebula/stars (all made by me) that would be more usefull to compose a proper texture. If you want those just send me a PM and I'll be happy to send them to you (no copyright problem since they are all drawn by me)


EDIT:
Originally Posted By: EvilSOB
As for attaching to certain VIEWs, thats up to the entities CLIENT_ID value.
By default it attaches to 'camera'...

If it is camera by default.... I am out of ideas. But it is definately not cenetered at the camera position. Something might be wrong in how I declare the sky object then?

Last edited by Carlos3DGS; 01/09/12 04:42.

"The more you know, the more you realize how little you know..."

I <3 HORUS
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=401929&page=1
Re: Sky entities & clip_far [Re: Carlos3DGS] #391182
01/09/12 04:40
01/09/12 04:40
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
As far as I can tell, this problem is a 'limitation' of using an MDL as a sky entity.

Using sprites / skycube-textures doesnt suffer like this.

So I suggest you either make up a 6-sided skycube texture, like
"skycube+6.dds" (in the gamestudio/samples folder), or live with the
sky-sphere you have now.

If you stick with the MDL, you must remember, it gets CREATED at the camera location,
but if the camera moves, the sky doesnt... So YOU gotta move it...

eg:
Code:
void SpaceDome_mover_startup()
{
   while(!SpaceDome)   {   wait(1);   }
   while(1)
   {
      vec_set(SpaceDome.x, camera.x);
      wait(1);
   }
}

This is how Ive done it in the past...

Or, you can hide the "vec_set(SpaceDome.x, camera.x);" in some
other constantly running loop with short waits...


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Sky entities & clip_far [Re: EvilSOB] #391185
01/09/12 05:01
01/09/12 05:01
Joined: Oct 2008
Posts: 513
Carlos3DGS Offline OP
User
Carlos3DGS  Offline OP
User

Joined: Oct 2008
Posts: 513
That solved one problem, but created a brand new one. It is hard to explain (even with a screenshot), so I uploaded a video to youtube:
http://www.youtube.com/watch?v=adT7pPtkmyc

For some reason it is not drawn "behind" all objects. It is always drawn behind my water (a semi-translucent sphere), but it is not always drawn behind the land (a solid deformed sphere).

Any ideas?

Last edited by Carlos3DGS; 01/09/12 05:32.

"The more you know, the more you realize how little you know..."

I <3 HORUS
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=401929&page=1
Re: Sky entities & clip_far [Re: Carlos3DGS] #391189
01/09/12 07:12
01/09/12 07:12
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
A few possibilities...

1> Is it possible that the point where the planet is being clipped is PENETRATING
your sky-sphere? Water still getting drawn may be because semi-transparent.

2> Do you have a shader on the planet? I BELIEVE that shaders do/can shutdown
beyond a certain distance from the camera for LOD purposes.
I dont understand exactly how it works, ut try playing with the "d3d_lodfactor
".

3> Does it have anything to do with clip_far? Make it bigger for a quick test.
ie: "if(key_space) { camera.clip_far=1000000; } else { camera.clip_far=20000; }"


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Sky entities & clip_far [Re: EvilSOB] #391197
01/09/12 09:01
01/09/12 09:01
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline
Expert
sivan  Offline
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
or simply put a post in the "ask the developers" or the "bug report" section. my sky models are also clipped but due to the manual they should be never... once I wanted to post it, but I had always more important problems, so it was pushed behind in the order... if you won't post, I will laugh

I've used sky models because 6 sided sky box images also suffered and are still suffering from some bugs. what I reported there, all were fixed. but when camera looks towards sky box edges, you might experience transparent pixels or lines. Jcl confirmed that it is because the engine creates simply 6 sprites, but in future it will be modified... until that sky color should be adjusted to hide it.


Free world editor for 3D Gamestudio: MapBuilder Editor
Re: Sky entities & clip_far [Re: EvilSOB] #391214
01/09/12 13:07
01/09/12 13:07
Joined: Oct 2008
Posts: 513
Carlos3DGS Offline OP
User
Carlos3DGS  Offline OP
User

Joined: Oct 2008
Posts: 513
Originally Posted By: EvilSOB
1> Is it possible that the point where the planet is being clipped is PENETRATING your sky-sphere? Water still getting drawn may be because semi-transparent.

Yes, it looks like that is exactly what is happening

Originally Posted By: EvilSOB
2> Do you have a shader on the planet? I BELIEVE that shaders do/can shutdown beyond a certain distance from the camera for LOD purposes.
I dont understand exactly how it works, ut try playing with the "d3d_lodfactor".

It is not using any shaders (yet). In the future I was going to adapt the terrain shader we made so it could work on spheres, but that will come after I get the "sky" working.

Originally Posted By: EvilSOB
3> Does it have anything to do with clip_far? Make it bigger for a quick test.
ie: "if(key_space) { camera.clip_far=1000000; } else { camera.clip_far=20000; }".

Tested with "if(key_space) { camera.clip_far=1000000; } else { camera.clip_far=50000; }" in the main loop and it had no effect on where the planet was getting clipped when pressing/releasing spacebar.


I am pretty sure the issue is related to section 1.

Edit:
Originally Posted By: sivan
or simply put a post in the "ask the developers" or the "bug report" section. my sky models are also clipped but due to the manual they should be never...

At the moment my aim is to get this working, if I have to use workarounds then so be it. You don't know when a bug report will get fixed for the engine and I don't want to rely on waiting and hoping my specific problem gets solved for me.
For the time being I wish this thread to continue and get a working space/sky.
When I figure out what I am doing wrong, or manage to find a workaround to an engine bug, or realize there is an an engine bug/limitation that cannot be worked around and dismiss this feature... then I will consider this thread "dead" and post a bug report / feature request.

Either way (if I find a workaround or not) this will probably be reported, but for the time being I do not want to rely on wishfull thinking that some very busy people prioritize my problem on their "things to do" list and find time in their busy schedule to adress my concerns. Even if they do I have no guarantees as to what priority this can get, when it will be adressed, or how long it will take. So I prefer to work on it myself (with any help I can get)

Last edited by Carlos3DGS; 01/09/12 13:37.

"The more you know, the more you realize how little you know..."

I <3 HORUS
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=401929&page=1
Re: Sky entities & clip_far [Re: Carlos3DGS] #391216
01/09/12 13:30
01/09/12 13:30
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Then try a test line something like this...
Code:
if(key_space) { vec_fill(SpaceDome.scale_x, 10); } else { vec_fill(SpaceDome.scale_x, 1); }"


If your 'SpaceDome.scale_x' is already greater than one, multiply both scale factors accordingly...


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Page 2 of 3 1 2 3

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