The Daily Click ::. Forums ::. Digital Works ::. 3D Voxel Terrain
 

Post Reply  Post Oekaki 
 

Posted By Message

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1971

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
25th November, 2017 at 25/11/2017 02:28:01 -

So a while ago, I was working on a 3D voxel terrain engine (as seen in Commanche and Armored Fist), all done using pixel shaders.

Image
Image
Image

The terrain stuff all works fine, but I never figured out how to properly position sprites within the 3D environment, and so I abandoned it (at least for now).

Anyway, just in case anyone wants to give it a try, you can download it here: http://1drv.ms/u/s!Atq7cUIJ7uexiit2Mrcb_VoGLYbc

Like I said, this is unfinished, so some stuff won't work properly (mostly the stuff related to sprites) and there's no documentation or anything - you can do what you like with it, but you're basically on your own. Enjoy

Oh, and if anyone should happen to figure out how to position sprites properly, please let me know

 
n/a

Hayo

Stone Goose

Registered
  15/08/2002
Points
  6949

Game of the Week WinnerHas Donated, Thank You!VIP MemberGOTM 3RD PLACE! - APRIL 2009Weekly Picture Me This Round 27 Winner!Weekly Picture Me This Round 41 Winner!Weekly Picture Me This Round 45 Winner!
25th November, 2017 at 25/11/2017 13:32:35 -

This is really nice! I love voxel landscapes and hope someone can figure out the sprite positioning. I am sure too dumb for that!

 
www.hayovanreek.nl

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49667

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
27th November, 2017 at 27/11/2017 17:21:37 -

Link seems to be dead.

 
n/a

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1971

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
27th November, 2017 at 27/11/2017 17:55:56 -

No, it's not...

 
n/a

Hayo

Stone Goose

Registered
  15/08/2002
Points
  6949

Game of the Week WinnerHas Donated, Thank You!VIP MemberGOTM 3RD PLACE! - APRIL 2009Weekly Picture Me This Round 27 Winner!Weekly Picture Me This Round 41 Winner!Weekly Picture Me This Round 45 Winner!
27th November, 2017 at 27/11/2017 21:25:29 -

Works for me!

 
www.hayovanreek.nl

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49667

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
28th November, 2017 at 28/11/2017 16:13:43 -

It's working now.

Yesterday it said the file had been removed.

 
n/a

Fifth

Quadruped

Registered
  07/05/2003
Points
  5818

VIP MemberGOTW JULY 2010 WINNER!Kliktober Special Award TagGOTW HALLOWEEN 2011 WINNERPicture Me This Round 51 Winner!
1st December, 2017 at 01/12/2017 22:21:18 -

Ooh, man! This is all kinds of awesome!
Even without being able to place sprites, this would make for some great stage backgrounds!

I see you've got the Active Object being occluded by the ground in your images there. Are you rendering the Active Object into your terrain object in the same shader to get that to happen? Or have you got a separate shader for the Active Object that uses the same terrain data?
Terrain occlusion was one of the things that bugged me about using the old Mode 7 Object. There was no easy way to do it, and my crummy workarounds always fell short of "acceptable".

But man, what you've put together here is really impressive!

 
Go Moon!

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1971

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
2nd December, 2017 at 02/12/2017 01:47:49 -

The occlusion works using "depth buffering" in the shaders. It's an experimental feature that Clickteam added in a recent update, but never actually told anyone about!
Normally, shaders just output a color and alpha value for each pixel, but with depth buffering, they can be made to also output a depth value for each pixel, which determines how individual pixels (not just whole objects) are layered. Since the voxel terrain shader uses raycasting, it's very easy to calculate this depth value.

The active is just a normal active, but with a simple shader to enable depth buffering, and set the depth value (for the video, I just picked some arbitrary value).

The problem with all this, and I guess the reason Clickteam never went public with it, is that depth buffering overrides normal object ordering, and even layers - and every object in the game needs to have a shader to set its depth value.

Schrodinger (on the clickteam forums) and I, have been picking each other's brains a bit, so expect a big announcement from him sometime soon, related to all this...

You can get a bit of a taste of what's to come in his demo here:
http://community.clickteam.com/threads/102350-P3D-2-0-out-now!?p=730090&viewfull=1#post730090
(you have to complete the level to see it though, which isn't easy)

 
n/a

Hayo

Stone Goose

Registered
  15/08/2002
Points
  6949

Game of the Week WinnerHas Donated, Thank You!VIP MemberGOTM 3RD PLACE! - APRIL 2009Weekly Picture Me This Round 27 Winner!Weekly Picture Me This Round 41 Winner!Weekly Picture Me This Round 45 Winner!
2nd December, 2017 at 02/12/2017 21:25:37 -

The displace map walls in that made my brain melt!

 
www.hayovanreek.nl

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1971

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
3rd December, 2017 at 03/12/2017 14:06:24 -

Yeah, they're very impressive!
Schrodinger's displacement maps work in exactly the same way as the terrain examples above. They don't offer quite the same performance or level of detail, as there's a lot of extra overhead in making them fit with the rest of the 3D engine, but because they do fit with the rest of the engine, that gives you a lot more versatility.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click