Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (491)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (556)
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  
  Merging triangle faces!  (Read 2318 times)
0 Members and 1 Guest are viewing this topic.
Offline PaidGEEK

Senior Member


Medals: 5
Projects: 3


twitter.com/PaidGEEK


« Posted 2013-01-06 21:56:13 »

Hello!  Smiley
I need some help!
So basically, having an integer array of cube ids with the size of 16^3 and static method, which returns triangle vertices based on location given by array iterator. Feeding vbo with that data I get this mess:


Nothing fancy but here's a problem I'm struggling with..
That chunk of cubes could also be rendered like this, providing that ids are the same:


Getting rid of cubes that are completely surrounded would be easy, but I still have a lot of verticies left that don't have to be stored in memory. I need someone's help on algorithm that would "merge" verticies that share the same properties and kept triangle topology. (after trying it just got far too complex)
 

Improvisational programmer.
Offline theagentd
« Reply #1 - Posted 2013-01-06 22:01:30 »

Just getting rid of the faces that are hidden isn't enough? Is having a tessellated cube that bad?

Myomyomyo.
Online HeroesGraveDev

JGO Kernel


Medals: 246
Projects: 11
Exp: 2 years


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


« Reply #2 - Posted 2013-01-06 22:05:57 »



The only optimisation done here is to remove all the hidden faces. I still get >60 FPS

I don't see why you need to optimise it that much. And that will just slow down the CPU when just one block is missing from the surface.

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

Senior Member


Medals: 5
Projects: 3


twitter.com/PaidGEEK


« Reply #3 - Posted 2013-01-06 22:24:26 »

I don't see why you need to optimise it that much. And that will just slow down the CPU when just one block is missing from the surface.
Well it seems like a good way to increase performance, I'll stick to only face and frustrum culling for now.

Improvisational programmer.
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #4 - Posted 2013-01-06 23:26:34 »

As someone who's spent a lot of time on a minecraft renderer, you probably just want to stick with removing internal edges and don't bother with merging faces.

It's tempting when you've got a 'simple' world, but as you add more and more gameplay it becomes progressively harder to manage. It's just too damn handy to do some thing per-vertex (eg. minecraft does it's fake AO lighting via vertex colours), as well as making it easier to do texture atlas/layer tricks to get richer surface detail. And of course it means that you have to do more work when you change a single block in your world.

The biggest rendering drag I found was that even after frustrum culling a minecraft-style world has lots of underground caves that are still considered visible. That can mean you're drawing twice or three times as many polys as you need. Sad

You *should* be able to do something about that with occlusion queries, but I never got around to trying it. Minecraft doesn't IIRC, but that's probably because it's awkward 16x16x128 world structure makes it a bad fit.

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline Best Username Ever

Junior Member





« Reply #5 - Posted 2013-01-07 00:02:57 »

What structure would you use as an alternative? Would it be a different AxBxC chunk or something different?
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #6 - Posted 2013-01-07 01:53:58 »

What structure would you use as an alternative? Would it be a different AxBxC chunk or something different?

I would probably have gone with 16x16x16 or 32x32x32 chunks and had some kind of sparse array in the height dimension, that would address the common complaint of the fixed build height.

Having said that it would make general streaming and caching more complicated. And the reason MC has chunks of 16x16x128 is a sound one - you can't load faster than the player can fall, so it has to have the whole vertical slice loaded in case. So it's only in hindsight that I think the chunk size is a bit awkward, and it's not a *huge* problem really.

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
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.

Nickropheliac (15 views)
2014-08-31 22:59:12

TehJavaDev (23 views)
2014-08-28 18:26:30

CopyableCougar4 (29 views)
2014-08-22 19:31:30

atombrot (41 views)
2014-08-19 09:29:53

Tekkerue (39 views)
2014-08-16 06:45:27

Tekkerue (35 views)
2014-08-16 06:22:17

Tekkerue (25 views)
2014-08-16 06:20:21

Tekkerue (36 views)
2014-08-16 06:12:11

Rayexar (72 views)
2014-08-11 02:49:23

BurntPizza (49 views)
2014-08-09 21:09:32
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!