Gamestudio Links
Zorro Links
Newest Posts
Z9 getting Error 058
by k_ivan. 04/20/26 15:57
Stooq now requires an API key
by jcl. 04/13/26 09:42
Strange "Alien" Skull created with >Knubber<
by NeoDumont. 04/10/26 18:58
400 free seamless texture pack downl. here !
by NeoDumont. 04/08/26 19:55
ZorroGPT
by TipmyPip. 04/08/26 17:08
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (TipmyPip, Quad), 3,531 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
juergenwue, VladMak, Geir, ondrej, mredit
19208 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 3 of 3 1 2 3
Re: Voxel in Game Studio [Re: Damocles_] #388029
11/27/11 12:18
11/27/11 12:18
Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Rei_Ayanami Offline
Expert
Rei_Ayanami  Offline
Expert

Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Two thoughts:

1. Wouldn't model instancing help?

2. Wouldn't it be faster to combine "chunks" you aren't in to one model (build a mesh out of one model) to reduce the draw calls?

Re: Voxel in Game Studio [Re: Damocles_] #388030
11/27/11 12:26
11/27/11 12:26
Joined: May 2009
Posts: 5,377
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,377
Caucasus
OK, plus LODs, mipmaps and this will be fast enough I guess.
The only thing is, how to check if certain block is visible or not?
I guess making while loop for each of it, with CLIPPED flag, will be slow...
What would be the best way, may be you have some ideas? Thank you BTW.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Voxel in Game Studio [Re: 3run] #388032
11/27/11 12:36
11/27/11 12:36
Joined: Feb 2009
Posts: 2,154
Damocles_ Offline
Expert
Damocles_  Offline
Expert

Joined: Feb 2009
Posts: 2,154
my Java code for removing voxels:


Code:
private void removeInvisible()
	{

////here just make a temporary copy of the voxelarray for marking invisible voxels
		int[][][] vtest = new int[voxH][voxX][voxY];
		
		for (int z = 0; z < voxH; z++)
		{
			for (int x = 0; x < voxX; x++)
			{
				for (int y = 0; y < voxY; y++)
				{
					vtest[z][x][y] = voxels[z][x][y];
				}
			}
		}

		// mark voxels wich can not be seen
		for (int z = 1; z < voxH - 1; z++)
		{
			for (int x = 1; x < voxX - 1; x++)
			{
				for (int y = 1; y < voxY - 1; y++)
				{
					vtest[z][x][y] = voxels[z][x][y];
					if (vtest[z][x][y] > 0
							&& (vtest[z][x + 1][y] > 0 && vtest[z][x - 1][y] > 0 && vtest[z][x][y + 1] > 0 && vtest[z][x][y - 1] > 0 && vtest[z + 1][x][y] > 0 && vtest[z - 1][x][y] > 0))

					{
						voxels[z][x][y] = 0;  //this voxel is invisible, as all neighbors are solid
					}

				}
			}
		}
	}



Re: Voxel in Game Studio [Re: Damocles_] #388033
11/27/11 12:39
11/27/11 12:39
Joined: May 2009
Posts: 5,377
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,377
Caucasus
Thank you for sharing this Damocles_ laugh
Now I'll try to understand it grin


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Voxel in Game Studio [Re: 3run] #388034
11/27/11 13:12
11/27/11 13:12
Joined: Feb 2009
Posts: 2,154
Damocles_ Offline
Expert
Damocles_  Offline
Expert

Joined: Feb 2009
Posts: 2,154
if (vtest[z][x][y] > 0
&& (vtest[z][x + 1][y] > 0 && vtest[z][x - 1][y] > 0 && vtest[z][x][y + 1] > 0 && vtest[z][x][y - 1] > 0 && vtest[z + 1][x][y] > 0 && vtest[z - 1][x][y] > 0))


this just means:
if the voxel is not 0 (air) and all voxels around it are not air,
then the voxel can not be visible. (simply because there
is not way to see it, as its sourrounded by solid blocks)

the rest is just for looping though the x,y,z array

Re: Voxel in Game Studio [Re: Damocles_] #388040
11/27/11 14:10
11/27/11 14:10
Joined: May 2009
Posts: 5,377
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,377
Caucasus
That makes sense! Thank you again. But will that be ok, if I'll make while loop for each model?


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Page 3 of 3 1 2 3

Moderated by  HeelX, Spirit 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1