PDA

View Full Version : Got Portals within Portals working



paul_g_griffiths
01-23-2017, 09:01 PM
Just thought I would show off a picture.
Building portals mainly for a 3d GUI system, portals required for the clipping.
All the scenes rendered in a single render.

https://s24.postimg.org/otuog1akl/Untitled.jpg

paul_g_griffiths
01-25-2017, 11:01 AM
Have an interesting effect with infinite regressed portals, may make an interesting space flying race game...
Been at it for days, been hard work but can fly through portals with no problems.

https://s27.postimg.org/b57c5d9sz/Untitled.jpg

paul_g_griffiths
01-26-2017, 11:12 AM
Thought I would show another image. Looks much better with lighting and a bit of shadow.

https://s24.postimg.org/nae0lhn5h/pic.jpg

paul_g_griffiths
01-29-2017, 12:59 AM
I've now implemented clipping for lighting and shadows for the portals, now lights and shadows can only enter and leave the front of the portals and not to the sides, which if I'm correct is a world first?

https://s24.postimg.org/uhbiz8v2d/pic2.jpg

paul_g_griffiths
02-13-2017, 07:12 AM
Here's the latest screenshots of my portals implementation.

Producing many portals is hard, having portals within portals is even harder, a portal can be at any place and go to any scene and then back again, each portal has multiple instances, so does each scene and each model.
For every portal you need 2 copies of every scene forward and then back as it's a view into the complete universe both ways. If you have 10 scenes and 10 portals within portals, that's 20 scene instances for each portal, 10 going forward and 10 going back. So that's 200 scene instances in total.

If you have 200 scene instances you may think I'm doing something wrong, no, you can do it with just a single instance but calculating all the portals each frame dramatically reduces the framerate. So you have many instances and only need to update the portals maths when you go through a portal. This speeds up the framerate dramatically.

There's a lot of pixel discarding going on in the shaders, and lots of culling both to the camera and portals to keep up the framerate.

I've fixed the lighting and shadows, working well now, seamless!

Not bad for 2 months work. :)

Engine is a deferred renderer, has multiple lighting, multiple shadows, normal and parallax mapping.

With my NVidia GTX 1050 graphics card it's real fast! As you can see it's probably the most complicated and advanced portals yet, and I believe a worlds first for light and shadows entering and leaving the portals.

If your wondering what the smiley faces are about? It's the beginning of what will be 3D buttons for a 3D window GUI system for both applications and games.

https://s15.postimg.org/6mqlvg7xn/pic12.jpg

https://s15.postimg.org/lwqh2n3fv/pic13.jpg

https://s27.postimg.org/8tph1n4fn/pic11.jpg