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 / [BUG] 2.0.21 SetSkyBoxVisible HTML5

Author
Message
Preben
AGK Studio Developer
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 26th Sep 2016 14:36
Skybox do not work in HTML5 , only SetClearColor is displayed.

Code sample: agk included terrain demo.



best regards Preben Eriksen,
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 27th Sep 2016 00:13
I posted this a good few months ago. Shame it's not been fixed.
Preben
AGK Studio Developer
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 14th Oct 2016 12:29
Hi Paul,

Is it possible to get the shader code for this so we can try to fix it ? , or perhaps the uniform used so we can make a replacement , thanks
best regards Preben Eriksen,
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 14th Oct 2016 15:32 Edited at: 14th Oct 2016 15:33
I can't replicate this with Firefox on Windows using the Terrain demo. Does it only happen on a particular platform or browser?

The sky box itself is a careful mix of an inverted sphere, a gradient texture, a shader, and some unusual setup parameters, but in theory you could replicate it using standard AppGameKit commands. The shader is as follows.
Vertex Shader

Pixel Shader


The sphere object is setup as follows

The texture is generated at runtime and is just a 256x256 image which is bright in the middle and fades towards the edges, the exact code is in C++ but it might help

The object is rotated to place the sun at a certain position, and positioned on the camera position every frame.

The most likely cause for it to fail would be the SetObjectDepthReadMode( objID, 2 ) command, since if the depth buffer value doesn't match exactly with the object depth then it won't draw.

Login to post a reply

Server time is: 2024-11-25 01:44:08
Your offset time is: 2024-11-25 01:44:08