Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / AGK Skybox issue

Author
Message
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 14th Aug 2015 11:39 Edited at: 14th Aug 2015 11:39
Hello, I'm having an issue with a skybox in AGK2.

I had the same issue in DBPro, which was solved either with the Set Object Filter, or the Set Object Texture command.

AGK2 doesn't have these commands, and now I'm stuck with a skybox like in the below image. Does anyone know how I can solve this??


Attachments

Login to view attachments
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 14th Aug 2015 14:03
I would guess (and it is only a guess) that you will need to wait for the big 3D update. At the moment 3D isn't fully functional.

You could possibly lessen the effect by clearing the screen (SetClearColor) to white or a light blue.

Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 14th Aug 2015 15:53
Already setting the ClearColor to the majority colour in the skybox, as well as disabling the ClearColor, with no luck.

It seems to be the anti-aliasing causing the issue, rather than colour leak as as my skybox sides slightly overlap in an attempt to stop this.

Oh well, I guess I'm waiting for TGC to add functionality again.

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 14th Aug 2015 18:37
If you set your game at night, it will also fix this problem

Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Polaraul
9
Years of Service
User Offline
Joined: 13th Dec 2014
Location:
Posted: 14th Aug 2015 19:07
@Mobiius
Quote: "Oh well, I guess I'm waiting for TGC to add functionality again."


That for me was the biggest issue with AppGameKit, always waiting for the language to catch up. What you have done so far though is looking really good.
Zwarteziel
13
Years of Service
User Offline
Joined: 22nd Jan 2011
Location: Netherlands
Posted: 14th Aug 2015 22:00 Edited at: 15th Aug 2015 10:04
Hi,

It should be possible to create a working skybox. In this thread, MikeMax alludes to the relatively new command 'SetObjectDepthWrite' to get it working. I haven't got any personal experience with it yet, though.

I am interested in the theory behind skyboxes btw. (if you don't mind me asking), since I want to create some outdoor areas for my game in the future. Do you basically create a cube and map the 5 faces the player can potentially see?
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 15th Aug 2015 14:19 Edited at: 15th Aug 2015 14:21
I created a plane, textured it and positioned it. The repeated it for the remaining 4 sides. (I'm only using front, back, left, right and top.)

And since I'm feeling nice, here's the AGK2 code I use to create a sky in AGK.

Call MakeSky( Scale# ) to create and texture the sky, then put UpdateSky( Scale# ) just before the Sync() command. (Code assumes you have sky textures in the media/skys folder, in .png format.



Just paste the code in your program, doesn't require any additional initialisation, other than setting Scale# to something before calling MakeSky. (Or you could replace it with a literal.)

Zwarteziel
13
Years of Service
User Offline
Joined: 22nd Jan 2011
Location: Netherlands
Posted: 15th Aug 2015 15:36
Quote: "And since I'm feeling nice, here's the AGK2 code I use to create a sky in AGK."


That is truly kind of you! Your example is very much appreciated!
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 15th Aug 2015 18:35
Don't mention it. It's not perfect as my screenshot shows, but it's a good start.

MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 21st Aug 2015 01:08
Quote: "It should be possible to create a working skybox. In this thread, MikeMax alludes to the relatively new command 'SetObjectDepthWrite' to get it working. I haven't got any personal experience with it yet, though. "


Indeed

With the SetObjectDepthWrite you are able to size your skybox at a specified size, even if your scene is larger than that (it allows you to know how it will render exactly all the time). Also, you should use only one "cross" texture image (see attachment in zip) with only one OBJ with correct UVs coordinates (textures turned INSIDE the cube) (also attached in zip .

Each side is well connected. search for skybox in google images and you will have a lot of examples for this kind of "cross" sky textures

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

Attachments

Login to view attachments
SoftMotion3D
AGK Developer
18
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 21st Aug 2015 16:07
Thats an easy fix... Adjust your objects uv data. I have posted code earlier that shows how you can make 3d objects from scratch and modify any values such as uv data. If you want i can dig this code up for you.

Or you can save out a 3d plane obj file with modified uv data.

www.sheldonscreations.com
Zwarteziel
13
Years of Service
User Offline
Joined: 22nd Jan 2011
Location: Netherlands
Posted: 22nd Aug 2015 09:19
@MikeMax: thanks for posting the files! Earlier this week, I incorporated Mobiius's example into my code and have been experimenting with the SetObjectDepthWrite-command. I'd been wondering how to use all those cubemapped skybox-images I found on the internet, though. This helps a lot!

@SoftMotion3D: finding that post would be much appreciated. I always get the impression you are one of the most knowledgeable users here when it comes to the subject of AGK's current 3D functionality, so any insights I can learn are welcome!

Login to post a reply

Server time is: 2024-04-20 11:39:20
Your offset time is: 2024-04-20 11:39:20