tag:blogger.com,1999:blog-8228224681659875765.post6097547381210769040..comments2013-08-19T10:13:34.176+02:00Comments on Hexahedra: GLSLUnknownnoreply@blogger.comBlogger9125tag:blogger.com,1999:blog-8228224681659875765.post-24258065963299649672012-02-16T13:27:07.496+01:002012-02-16T13:27:07.496+01:00That's a cool project you got there! I guess e...That's a cool project you got there! I guess everyone experimenting with this sort of thing ends up using binvox and broville somehow. ;) Good luck trying the trick with the texture array, let me know how it works for you.Noctehttps://www.blogger.com/profile/16639690217454668921noreply@blogger.comtag:blogger.com,1999:blog-8228224681659875765.post-32259772293131438962012-02-15T14:55:21.778+01:002012-02-15T14:55:21.778+01:00I'm glad I could help! You can indeed get rid ...I'm glad I could help! You can indeed get rid of half of the faces, but not for the chunks that are on the same axis as the player. You still need to display 5/6 faces for these chunks.<br />You're right, GL_MAX_ARRAY_TEXTURE_LAYERS seems to be around a thousand for recent graphic cards, I was afraid it was closer to 8! But I was wrong, it seems fine. Now that I know that, I will probably try to implement it on my own program. (http://code.google.com/p/cube-wars/wiki/PictureStory)<br />ThanksnickDhttps://www.blogger.com/profile/05047765892252072270noreply@blogger.comtag:blogger.com,1999:blog-8228224681659875765.post-46136628667884340632012-02-14T22:27:40.802+01:002012-02-14T22:27:40.802+01:00That's actually a very good idea! I was worrie...That's actually a very good idea! I was worried about the draw calls for a moment, but of course it is ridiculously easy to limit it to at the most 3 calls per chunk. I should definitely give that a try someday.<br /><br />I admit I haven't looked much into the limits of GL_MAX_ARRAY_TEXTURE_LAYERS. A quick google gives me varying values, all in the "couple o' thousand" range, but I wouldn't be surprised if older cards won't be able to keep up with material-heavy servers. The client already has an OpenGL 2.1 mode with a simple texture atlas, perhaps that could be a fallback for such cases. (At least until I've devised a better way of doing this with multiple array textures and a minimum of switching.)Noctehttps://www.blogger.com/profile/16639690217454668921noreply@blogger.comtag:blogger.com,1999:blog-8228224681659875765.post-15555387594753373012012-02-14T01:40:17.256+01:002012-02-14T01:40:17.256+01:00Okay I understand now, I was assuming that the tex...Okay I understand now, I was assuming that the texture coordinates should stay inside [0;1] but you're right, they can be higher and the texture will be repeated.<br />About the normal face, you could probably avoid the lookup table by having a different vertex array for each normal direction (only 6 after all, but of course this needs more draw calls). This way all the faces of the same array share the same normal, so no need to store the normal on a per face basis, it can just be passed as a uniform. So you save bytes and you can specialize the texture coordinate computation based on the normal direction.<br />But maybe you're already doing this and I've missed something?<br />I have another question:<br />I think the number of texture you can "slice" is limited, even on recent GPUs. Isn't that an issue if you want lots of different materials?<br />Thanks again!<br />NicknickDhttps://www.blogger.com/profile/05047765892252072270noreply@blogger.comtag:blogger.com,1999:blog-8228224681659875765.post-41757698081278689452012-02-13T16:02:06.380+01:002012-02-13T16:02:06.380+01:00Hey NickD,
Yes, I think I understand. :) If the t...Hey NickD,<br /><br />Yes, I think I understand. :) If the two faces ABCD and EFGH are in the same plane, B and E would have the same texture coordinates. We're using a texture array so they wrap in both directions. So E has (1,0), F has (2,0), and it will tile perfectly.<br /><br />If they're not in the same plane, but B and E still share the same vertex, their mappings would depend on the normals of the faces, and the multiplication matrixes from the lookup table. So if the B/E vertex is at (1, 3, 5), B's uv could be (1, 5), and E's could be (3, 5). If A is at (0, 3, 5) and F at (1, 4, 5), their respective texture coordinates would be (0, 5) and (4, 5).<br /><br />Hope this explains it!Noctehttps://www.blogger.com/profile/16639690217454668921noreply@blogger.comtag:blogger.com,1999:blog-8228224681659875765.post-16690555312319094992012-02-13T15:19:06.388+01:002012-02-13T15:19:06.388+01:00Hi.
Good work and thanks for your blog with useful...Hi.<br />Good work and thanks for your blog with usefull insights. <br />However, I don't understand how you can generate texture coordinates from world position. Two vertices may have the same world position but require different texture coordinates, because part of different faces.<br />A drawing would help, but I don't know how to upload images so I'll do this:<br /><br /><br />A---BE---F<br />|___|___|<br />D---CH---G<br />Here, we have two faces ABCD and EFGH the points B and E (and C and H) are at the same position but B will have texture coordinate like (1,0) and E will have (0,0)<br />I hope you understand what I'm trying to say.<br />Thanks.nickDhttps://www.blogger.com/profile/05047765892252072270noreply@blogger.comtag:blogger.com,1999:blog-8228224681659875765.post-82853834158606108502011-12-24T23:28:37.128+01:002011-12-24T23:28:37.128+01:00Thanks Nocte! I didn't know where would be the...Thanks Nocte! I didn't know where would be the best place to contact you so I posted both places.<br /><br />Thanks again!TronMinecrafthttps://www.blogger.com/profile/03426495925533999338noreply@blogger.comtag:blogger.com,1999:blog-8228224681659875765.post-16629353099835498112011-12-24T14:04:08.357+01:002011-12-24T14:04:08.357+01:00Hey TronMC!
I already responded to your PM, but I...Hey TronMC!<br /><br />I already responded to your PM, but I think I'll also write a blog post about it.Noctehttps://www.blogger.com/profile/16639690217454668921noreply@blogger.comtag:blogger.com,1999:blog-8228224681659875765.post-60849640431787557792011-12-24T02:29:11.348+01:002011-12-24T02:29:11.348+01:00Your work is truly awesome!
How have you been imp...Your work is truly awesome!<br /><br />How have you been implementing your voxel/block system? I am working on a similar project, but I am stuck on trying to figure out how to make the voxels and blocks work efficiently.<br /><br />Are you simply using a 3D array? if so how are you extracting you r mesh surface(s)?<br /><br />Thanks!!!!!TronMinecrafthttps://www.blogger.com/profile/03426495925533999338noreply@blogger.com