Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (844)
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  
  Strange rendering carryover in lwjgl voxel project  (Read 2133 times)
0 Members and 1 Guest are viewing this topic.
Offline BrassApparatus

Junior Devvie

« Posted 2013-06-28 02:22:35 »

It's me again. This one is really eluding me. I slapped together some code for a voxel rendering engine and I'm in the process of cleaning it up and optimizing it. I'm using VBO's and VAO's and I just converted from using IBO's to not. I also just changed the way my vertex/color data is passed and the structure of my shaders. the method I was using can be seen in my renderplayer() method as I haven't bothered updating it yet. The next step is changing all of my rendering data to shorts or bytes.

All of my chunks were rendering properly before but now I get a weird errror where any chunk that is not init'd with the default configuration appears to -I'm gonna say- bleed over the three chunks preceding it in the list of chunks.
I am seeing the preceding chunks render as if they had block list composed of both their own and that of the offending chunk.

I've numbered chunks 0-5 here in blue and circled the offending chunk. Number 5 should appear as a y=x structure with no red base and the others should appear as y=0.
In addition I've pointed out a weird thing where chunk[offending - 3], in this case 2, renders differently from the others.

When I check the block list of my chunks they appear correct. The list of vertices for each chunk is the correct length, and the engine appears to be rendering the proper number of chunks.

Here is my code. // rendering happens here //very short //short
Shaders //should be of no use as far as this error // only included for completeness

I'm posting here because I can't find my error and I'm not sure if it's some stupid numerical typo or a fundamental misunderstanding of the rendering process I've built.

Thanks all in advance,

EDIT: Almost forgot to mention that my engine extends a program written ra4king and uses another.
They're here.
They too are included for completeness.
Offline BrassApparatus

Junior Devvie

« Reply #1 - Posted 2013-06-28 09:12:58 »

It's me again everyone.
I've altered the code for generating a "default" chunk. Now the code makes the flat red plane, previously at y=0, generate at y=chunk.x. This made me realize what I should have been acutely aware of all along. There is no 'offending' chunk. Every chunk seems to bleed over the previous chunks. PIC I have continued combing my code and now suspect more than ever that I fundamentally misunderstand the rendering process I've set up. I'd really appreciate someone straightening me out here as I'm thoroughly missing the point.

private void initDefaultBlockList(int x){
      for (int i = 0; i < CHUNK_SIZE; i++){
         for (int j = 0; j < CHUNK_SIZE; j++){
            for (int k = 0; k < CHUNK_SIZE; k++){
                  defaultBlockList[i][j][k] = 1;

That's the applicable portion of changed code (from

I am still sure that:
a. The chunks contain the proper number of blocks.
b. The chunks list of vertices are the proper length.
c. The engine is not rendering duplicate chunks.
All of this prints to the console when the program inits.

I therefore assume that I have massively screwed up my rendering (possibly with vbos?).
Offline BrassApparatus

Junior Devvie

« Reply #2 - Posted 2013-06-30 09:07:39 »

Just one shameless bump.  Clueless 
If there's anyone who looked at this I could use the advice. I'm at the point of rewriting everything from the ground up.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline UprightPath
« Reply #3 - Posted 2013-06-30 10:28:57 »

I have a guess! A big guess, but a guess none the less! If you have the red at y=0 over the entire set of chunks, and then have the green over it, then what's happening is a bug that occurs when you attempt to put two triangles in the same space. They overlap in funny ways (The depth isn't found correctly). Try rotating and see if there's any flicker (Red to green, green to red) if it does, then that's your problem. :3

Offline BrassApparatus

Junior Devvie

« Reply #4 - Posted 2013-06-30 22:44:22 »

I don't think that's it. Sad I have the camera rotating and there's no flicker. The default y=0 layer is only created if a chunk is initialized without a list of blocks. Thank you though! Any other ideas??
The problem is that every chunk is imprinting over the three chunks preceding it. No idea how.
Pages: [1]
  ignore  |  Print  

EgonOlsen (78 views)
2018-06-10 19:43:48

EgonOlsen (58 views)
2018-06-10 19:43:44

EgonOlsen (78 views)
2018-06-10 19:43:20

DesertCoockie (260 views)
2018-05-13 18:23:11

nelsongames (158 views)
2018-04-24 18:15:36

nelsongames (157 views)
2018-04-24 18:14:32

ivj94 (898 views)
2018-03-24 14:47:39

ivj94 (162 views)
2018-03-24 14:46:31

ivj94 (811 views)
2018-03-24 14:43:53

Solater (175 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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‑
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!