Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (535)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Resources for a Voxel-Based Game  (Read 2002 times)
0 Members and 1 Guest are viewing this topic.
Offline HeroesGraveDev

JGO Kernel


Medals: 238
Projects: 11
Exp: 2 years


┬─┬ノ(ಠ_ಠノ)(╯°□°)╯︵ ┻━┻


« Posted 2012-07-10 10:43:01 »

I am currently working on a voxel based game, and I need some tips or links to resources on the following:

  • Raycasting/Raytracing and which one to use
  • Culling: Frustum and maybe occlusion
  • How to apply rotations to VBOs

Here are some of the questions I need help with:

RayCasting/Tracing:

Which is best for a voxel engine?
What is the difference?
Where do you use it and how? (Frustum culling?)

Culling:

How do you get the bounds of the frustum?
How do you work out whether a voxel is inside the frustum? (Raycasting?)
Are octrees helpful?

VBOs and rotation:

I am really stumped on this. It is for entities, which are also made up of voxels.
How do I apply a rotation to a point to put in a VBO?

If people could give me some links for these it would be great.
I don't mind c++, even though I never learnt it it is still easy enough to understand. I just need the logic behind everything.

By the way, I use LWJGL.

Edit: Removed points that just require messing with the code and drawing complex diagrams etc

Offline princec

JGO Kernel


Medals: 343
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #1 - Posted 2012-07-10 11:01:47 »

I'm afraid you're basically asking everyone else to do all the hard work for you. Back to the drawing board for you I think.

Cas Smiley

Offline HeroesGraveDev

JGO Kernel


Medals: 238
Projects: 11
Exp: 2 years


┬─┬ノ(ಠ_ಠノ)(╯°□°)╯︵ ┻━┻


« Reply #2 - Posted 2012-07-10 11:09:45 »

*facepalm*

That's not what I meant. I have spent hours on Google looking for this stuff and I wanted to know if anyone knew of any resources.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline princec

JGO Kernel


Medals: 343
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #3 - Posted 2012-07-10 11:48:20 »

Aha! The edited version is much better framed.

Frustum culling is trivial and Google gives you any number of excellent resources. As does a patronising search for occlusion culling.

wrt. VBOs and rotations: you do not apply rotations to VBOs. VBOs contain vertex data; you do the rotations in a vertex shader these days.


Cas Smiley

Offline princec

JGO Kernel


Medals: 343
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #4 - Posted 2012-07-10 11:50:31 »

... I think you need to be even more specific about which bit of each part you don't understand.

Cas Smiley

Offline HeroesGraveDev

JGO Kernel


Medals: 238
Projects: 11
Exp: 2 years


┬─┬ノ(ಠ_ಠノ)(╯°□°)╯︵ ┻━┻


« Reply #5 - Posted 2012-07-10 12:28:39 »

Wow!

I never would of guessed that google-ing two words would give more tutorials than google-ing those words plus "tutorial" or "resources".

As I looked through them my brain clicked, but I realised the method I thought of would most likely be to slow, but anyway, someone tell me if this will work:

My world has already got some form of octree working. So what I do is take each of the seven visible points of the voxel/octree (if the octree is not empty) and test to see if each one is inside the frustum by adding/subtracting half the FOV fron the camera's pitch/yaw depending on the axis. If all of them are, then it is inside. If some are, it's intersecting. If none are, it's outside.

If inside, test for occlusion.
If intersecting, which should I do?:
- Test each voxel within the octree with the same method.
- Render them all anyway
If outside, don't render.

I will test it tomorrow or later...

Offline Roquen
« Reply #6 - Posted 2012-07-10 14:44:01 »

The nature of octree allows for rapid rejects/inclusions, ignore occlusions for the moment.  One way to to start with near, top, bottom, right and left planes (and far if you want to do that) and traverse the root.  The nature of planes allow you to (pretty much) test a single point per plane by pre-categorizing. Once a node is outside any, it and all it's children are invisible so stop.  Once a node is inside a plane your done checking with that one, so drop it.  Once inside all then all children are inside.  Occulsion is the tougher nut to crack.
Offline loom_weaver

JGO Coder


Medals: 17



« Reply #7 - Posted 2012-07-10 14:54:44 »

Octrees are immensely helpful.  I implemented one for hit-testing.  Before I was iterating over 14000 objects and in total it took around 30 ms.  Afterwards it took less than 1 ms.

You may not get as much of a performance gain but in essence you're reducing a linear search down to a binary one.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

pw (37 views)
2014-07-24 01:59:36

Riven (38 views)
2014-07-23 21:16:32

Riven (26 views)
2014-07-23 21:07:15

Riven (28 views)
2014-07-23 20:56:16

ctomni231 (59 views)
2014-07-18 06:55:21

Zero Volt (50 views)
2014-07-17 23:47:54

danieldean (42 views)
2014-07-17 23:41:23

MustardPeter (44 views)
2014-07-16 23:30:00

Cero (60 views)
2014-07-16 00:42:17

Riven (57 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!