Page 3 of 9

Re: Minecraft remake- Crafter

Posted: Wed Jun 01, 2011 3:03 pm
by MrDeathNote
How the fuck was I not sub'd before?

Re: Minecraft remake- Crafter

Posted: Fri Jun 03, 2011 11:20 am
by LeonBlade
Looks awesome! And yes, I can see the blocks better now :P

Re: Minecraft remake- Crafter

Posted: Sat Jun 04, 2011 11:23 am
by N64vSNES
Hooray for building things!




Image

Image

Image

Sorry for the shitty video camstudio completely screwed up and I was too lazy to rebuilt the house again :lol:


Anyway this is fairly old (account issues) so I'll be doing a newer one soon :)

Re: Minecraft remake- Crafter

Posted: Sat Jun 04, 2011 11:42 am
by Ginto8
I'm curious, how did you get the transparent textures to work?

Re: Minecraft remake- Crafter

Posted: Sat Jun 04, 2011 1:36 pm
by N64vSNES
Ginto8 wrote:I'm curious, how did you get the transparent textures to work?
When dealing with 3D you just have to fill the vertices counter clockwise. there are other alternatives but this is the easiest in my opinion.

Not sure how specific you want me to be so do say if you want me to elaborate :lol:

EDIT:
I think I know why you asked, if it's about part of the inner house showing in one of the screen shots then it's because I'm drawing the faces of each cube only if it's visible to the camera and obviously it needs to ignore this for transparent ones. I've got to finish block attributes before I can add this kind of functionality though.

Re: Minecraft remake- Crafter

Posted: Sat Jun 04, 2011 2:29 pm
by Ginto8
I was asking how you got transparency to work in 3D because I've heard that it's very difficult to pull of with the depth buffer, because you end up with transparent things being drawn and, instead of allowing things behind them to be visible, it blocks them out via the depth buffer.
I think that's clear, but I might just be babbling from my headache. If you didn't understand it, I'll clarify when it goes away ;)

Re: Minecraft remake- Crafter

Posted: Sat Jun 04, 2011 3:48 pm
by N64vSNES
Ginto8 wrote:I was asking how you got transparency to work in 3D because I've heard that it's very difficult to pull of with the depth buffer, because you end up with transparent things being drawn and, instead of allowing things behind them to be visible, it blocks them out via the depth buffer.
I think that's clear, but I might just be babbling from my headache. If you didn't understand it, I'll clarify when it goes away ;)
I agree I've read that when using depth you should always draw your polygons and then your transparent ones each frame so that OpenGL can handle the rendering order correctly.

So far though minus my little map bug which will be fixed soon I've had no problems rendering transparent ones as they are found. However the entire portion of the map that gets drawn is rendered as a single mesh for performance reasons so I'm *guessing* this has something to do with it.

Re: Minecraft remake- Crafter

Posted: Sat Jun 04, 2011 7:42 pm
by Ginto8
so you ARE using the depth buffer right?

Anyway, for your bug it just looks like an error when calculating which faces to draw. You're not drawing faces that are either touching glass or touching the "selection" block, and that's causing the "I can see inside blocks!" glitch. Also, you might want to set up backface culling.

Re: Minecraft remake- Crafter

Posted: Sun Jun 05, 2011 8:07 am
by N64vSNES
Ginto8 wrote:so you ARE using the depth buffer right?

Anyway, for your bug it just looks like an error when calculating which faces to draw. You're not drawing faces that are either touching glass or touching the "selection" block, and that's causing the "I can see inside blocks!" glitch. Also, you might want to set up backface culling.
Yip I'm definitely using the depth buffer and I've already got backface culling. Like I said it is in fact a glitch with the way I'm drawing the faces of each cube.

For example if I'm about to draw the left face of a cube then I'd do something like this:

Code: Select all

// If there is a block to the left then the player wouldn't see this face. (0 = no empty space)
if ( Blocks[x-1][z][y] == 0 ) {
    // Draw the face
}
If there is already something there then that face wouldn't be visible to the player and as you said to me on the IRC it was causing those problems with the textures, but there needs to be an exception for this because if the block that's hiding that specific face is transparent then the face is in fact visible thus causing "I can see through blocks!".

Once I've set it up so that each type of block I.E. grass, dirt, water etc have their own attributes I can give an exception so that if the block is at all transparent it will ignore this logic.

Re: Minecraft remake- Crafter

Posted: Sun Jun 05, 2011 5:03 pm
by LeonBlade
Awesome job man! This looks great! :D

Re: Minecraft remake- Crafter

Posted: Mon Jun 06, 2011 11:52 am
by TheBuzzSaw
Source code or it didn't happen!

I'm actually curious as to how you built your scene graph. Are you just using a massive array as hinted at in that code sample above?

Re: Minecraft remake- Crafter

Posted: Mon Jun 06, 2011 2:01 pm
by N64vSNES
TheBuzzSaw wrote:Source code or it didn't happen!

I'm actually curious as to how you built your scene graph. Are you just using a massive array as hinted at in that code sample above?
You're correct I use a simple 3D array 256x256x64. Let's be fair this seems the simplest way to do this and from what I've heard of interviews with Notch he does it the same way too only you can go higher than this (Crafter will too eventually)

Re: Minecraft remake- Crafter

Posted: Mon Jun 06, 2011 3:42 pm
by MadPumpkin
The issue you and Ginto8 are talking about with the depth is mostly ancient and USUALLY doesn't happen with a handy dandy depth buffer. Honestly this still comes up from time to time, but until it does (even once) you really shouldn't worry about it too much. I've not had a problem with it for a long time.(But, shit happens)

EDIT: But I have had problems with it, just not since I got better at rendering techniques.

Re: Minecraft remake- Crafter

Posted: Mon Jun 06, 2011 5:19 pm
by N64vSNES
MadPumpkin wrote:The issue you and Ginto8 are talking about with the depth is mostly ancient and USUALLY doesn't happen with a handy dandy depth buffer. Honestly this still comes up from time to time, but until it does (even once) you really shouldn't worry about it too much. I've not had a problem with it for a long time.(But, shit happens)

EDIT: But I have had problems with it, just not since I got better at rendering techniques.
Don't worry I think I'm not describing what's causing the issue too well ;)

Some of my optimization is having a lot of strange but expected affects such as this one. Just you wait until I've finished the block attributes and I promise this issue will be gone forever :)

Re: Minecraft remake- Crafter

Posted: Tue Jun 07, 2011 5:08 pm
by THe Floating Brain
Its looking good :-)