LWJGL BlockWorld

Yea, all the bitmap letters are just 8x8 pixels. They are all uppercase too. So the font is pixilated looking, just like on a spectrum 48k!

The reason for doing this s actually just so I could get some player position data etc to aid programming. But some popular pixilated style games use this anyway. I guess it could be refined to account for letter sizes and make it look nicer.

Update:

5ivKUtMhJtI

Converted to VBO, Static Draw. Running at 1300 FPS now.
Added Vertex shading to create various tints of colour, and shading on the side of blocks.

VBO can be updated to add/remove blocks, however am re-writing the whole chunk.
Will look into subData, or stream write.

Map can be loaded from datafile(block position and id), or png file(only hightmapdata)

Lots still to do! bigger map, and special objects like chest and furnace!
Have 1/2 implimented grass and tilled soil, and water.

That is looking great :slight_smile:

You people are making me jealous, I haven’t been able to work on my voxel engine in like a week! Everyday you two add new features into your engines and I just wish I was coding too! Keep up the great work guys, I’m sure us three can inspire each other to keep going!

I’m struggling to tell you the truth to add more to mine, been working all day…

Also struggling with trying to get my camera right, that is positioning properly!

Soon it may be four… :persecutioncomplex:

I saw your engine too! You should keep working on it, it definitely looked unique! And as for your camera problems, steg90, whats wrong? I would be glad to help you out!

You mean the Hex Prism one?
I gave up on that. The math of coordinate skewing was constantly bugging me. (And it was more of a learning project)

But, if I can put the performance of that into a voxel engine (with some new optimisations too)…

@Vermeer and steg90: You should request to move your topics to WIP now that you’ve sorted out the performance problems.

Hi,

I’m not sure if anything wrong with camera? I will zip the code up and you could have a mess about and let me know - no collision in yet, you can just move about with wads, space bar to go up and down key to go down.

You can download from here, please see what you think :slight_smile:


https://sites.google.com/site/voxbygame/home/downloads

PS - @HeroesGraveDev - what is WIP? Cheers

Thanks

Ah I see. I think a 3D version of Guardian might be fun. Maybe, if you actually do go ahead with making your voxel engine, you could add a gamemode for Guardian. Would be very cool to see what you could come up with!

Could I ask what exactly is wrong with your camera?

That would be cool, I have looked at your hexagonal voxels. Very nice idea.

Thank you , yes may do that. I am aslo finding it very helpful to be in a forum with others doing the same thing.

@steg is it ok for me to look at your project too…Im very interested…

Hey guys,

All are welcome to look at my project :slight_smile:

Camera - maybe nothing wrong, just I guess need to position it one unit above the floor (first block layer)? Don’t want to be able to look ‘through’ the floor looking down, and it seems to far zoomed in, but this should be just my start z when I create the camera. I want to start the camera say in the middle of the chunks - there are 12 in the version I’ve uploaded, so say around chunk 3,3.

Having to use the camera x, y, z position to convert to voxel space for collision, this still needs doing…

Thanks

Guardian IIID?

See what I did there? :persecutioncomplex:

That would be a possibility. But it would have different gameplay. I’ll see what happens. I’m currently fixing my ‘infinite’ world code.

Is there any chance you could show me your texture code? I can’t seem to figure it out :frowning:

Hi opi

im not sure which part you can get working - but this may or maynot help:

its only one face, but you get the idea… if you want the other faces I can post them…

		
		float tint =((float)(getLightData(xOset, yOset, zOset))/120f);
		float side = 0.15f;
		float side2 = 0.3f;
		
		//front face
		//quad 1 bottom
		
		vHandle.put(-0.5f + xOset).put(-0.5f + yOset).put(+0.5f + zOset); // vertex bottom left
		vHandle.put(tint-side2).put(tint-side2).put(tint-side2);
		vHandle.put(h).put(s); // texture 
		//vHandle.put(tint).put(tint).put(tint);
		vHandle.put(+0.5f+ xOset).put(-0.5f+ yOset).put(+0.5f + zOset); // v  bottom right
		vHandle.put(tint-side2).put(tint-side2).put(tint-side2);
		vHandle.put(h+s).put(s); // 	t
		//vHandle.put(tint).put(tint).put(tint);
		vHandle.put(+0.5f+ xOset).put(+0.5f+ yOset).put(+0.5f + zOset); // v top right
		vHandle.put(tint-side).put(tint-side).put(tint-side);
		vHandle.put(h+s).put(0); // t
		//vHandle.put(tint).put(tint).put(tint);
		vHandle.put(-0.5f+ xOset).put(+0.5f+ yOset).put(+0.5f + zOset); // v top left
		vHandle.put(tint-side).put(tint-side).put(tint-side);
		vHandle.put(h).put(0); //t
		

Its interleaved, 3 vertex. 3 colour, 2 texture
h is the horizontal offset of my texture atlas (spritesheet) and s = size. on this particular cube there is no vertical offset.
tint is the light level of the cube
side and side 2 are used for some shading on the cube sides to differentiate them from the top.

if you have only 1 texture file per block, h = 0, and s=1

hope that helps…

Sorry, I was wondering if you could actually show me how you bind and render out the texture. So since you use VBOs, what parameters do you use for

glBindBuffer()

And do you just call

glBindTexture(GL_TETXURE_2D, id)

or do you do it a different way?

VBOs:

glBindBuffer(GL_ARRAY_BUFFER, bufferID);

Textures:

glBindTexture(GL_TEXTURE_2D, textureID);

Yep just like that.
I used this code
http://www.lwjgl.org/wiki/index.php?title=Using_Vertex_Buffer_Objects_(VBO)

Update:

I have added: Block braking animation and timer. Also had a go a water (translucent and animated)

Water has a volume, and when it flows into a new block it distibutes the volume over the new blocks. SO the water level lowers, untill its so low, its just absorbed!
(im going to have to work on the 3d picker now, the temp fix is anoying!)

IhsfYbcrfXw