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 Chat / 3D Object Occlusion Testing

Author
Message
puzzler2018
1
Years of Service
User Offline
Joined: 8th Oct 2017
Location:
Posted: 6th Jan 2019 12:29 Edited at: 6th Jan 2019 12:33
Im pretty sure im close, could someone test it out for me




Press Cursors and W and S to move camera object around

R to Rotate with the results

Space to see the object without cull

Change the constants size, near, far values for the effect
puzzler2018
1
Years of Service
User Offline
Joined: 8th Oct 2017
Location:
Posted: 6th Jan 2019 12:46
I have added a camera positioning on to the Object - press C to turn on and off

Also a gap constant - to spread out the environment a bit



puzzler2018
1
Years of Service
User Offline
Joined: 8th Oct 2017
Location:
Posted: 6th Jan 2019 13:02
I have now added a boundary code so when your outside the whole object then it will increase its occulusions

and if inside the object it decreases the occlusions



Have a great day...

Come back soon
puzzler2018
1
Years of Service
User Offline
Joined: 8th Oct 2017
Location:
Posted: 6th Jan 2019 14:10
This one works to occlude surrounding meshes



puzzler2018
1
Years of Service
User Offline
Joined: 8th Oct 2017
Location:
Posted: 6th Jan 2019 18:38 Edited at: 6th Jan 2019 18:39
A nice interesting video

This is all it takes



Notice the original plane it starts on - just a CreateObjectPlane(200,200) I assume

Enjoy
blink0k
AGK Developer
5
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 6th Jan 2019 19:09
They don't mind throwing the polys around do they?
Santman
7
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 7th Jan 2019 02:10
Paul,

When did AppGameKit get occlusion culling? We know it has fulstrum culling, to not draw objects which aren't on screen, but occlusion culling (assuming we are using the correct name) stops rendering of objects behind other objects......I promise you this has never worked that I've found.

For example, you should be able to create a flat, solid cube bigger than the vriwport, drop it right in front of the camera, and nothing behind it is rendered......but pretty sure that's not the case as I've done that exact scenario many times and it didn't stop rendering.

I don't mean to be rude, but are you sure it's meant to be included?
Paul Johnston
TGC Developer
16
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 7th Jan 2019 15:28
Ah I got the terms mixed up, I meant AppGameKit has frustum culling. It doesn't hide objects that are behind other objects
puzzler2018
1
Years of Service
User Offline
Joined: 8th Oct 2017
Location:
Posted: 7th Jan 2019 15:48
Thanks Paul... Is it something likely in the future of agk at all.

Thanks for getting back to us
puzzler2018
1
Years of Service
User Offline
Joined: 8th Oct 2017
Location:
Posted: 8th Jan 2019 20:07
In the mean time, will have to try and develop our own. This is my version of depth



Depth 0 been an object closest to the camera, all other object have to identify the coords back to 2D and if any other objects are inside each others bounding square then make those invisible

Here is just a start in the making.

< and >

Will get this sorted by Friday evening - too tired to think at the moment
puzzler2018
1
Years of Service
User Offline
Joined: 8th Oct 2017
Location:
Posted: 8th Jan 2019 20:31
Like this

X direction to start with



Press < or >

More to come soon
puzzler2018
1
Years of Service
User Offline
Joined: 8th Oct 2017
Location:
Posted: 8th Jan 2019 21:09
If anyone interested - here you go



Cursors to move

Enjoy

Catch up soon
puzzler2018
1
Years of Service
User Offline
Joined: 8th Oct 2017
Location:
Posted: 9th Jan 2019 12:35
Tonight I will make it loop through all the other objects in the depth buffer array too and check other objects against each.

This will probably make the FPS grind to a halt, but if we also check if it any are off screen X<0 or X>screenwidth or Y<0 or Y>screenheight - then don't check those or if any objects that are already invisible then don't re-check either.

This method will work better with bigger meshes in the camera view, I feel.

But will try it on individual objects first that last example was creating 100 boxes and seemed quite well - we never know, the FPS may be alright on much more objects.

Looking forward to get this tested.
Rick Nasher
1
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 10th Jan 2019 23:53
Cool stuff puzzler2018. I've seen that video before, pretty astounding reality like level building.

Very curious to see if this would up the FPS. It should theoretically right?
Especially using the above mentioned methods.


When done in C++ and build in as a command by AppGameKit for Tier1, perhaps as something like SetObjectOcclusion(integer) to enable it globally and/or per object selectively with SetObjectOcclusion(object, integer), then it could potentially really speed-up things on a large scale and make it possible to create even more complex kick-*ass scenes or even lift AppGameKit to new heights.

Really hope Paul gives it a shot.

Login to post a reply

Server time is: 2019-01-16 13:30:22
Your offset time is: 2019-01-16 13:30:22