Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


OpenGL ES 2.0: Weird artifact renderering plane


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Tchom   Members   -  Reputation: 193

Like
0Likes
Like

Posted 11 May 2013 - 10:45 PM

I'm trying to render a basic plane and I'm having a pretty bad time. I render the square ant it draws, but it also seems to draw a giant half-cube on top of it.

 

 

Y2mBAmt.png

 

Is there any obvious mistake I'm making that might be responsible for this?



Sponsor:

#2 frob   Moderators   -  Reputation: 22692

Like
1Likes
Like

Posted 11 May 2013 - 11:51 PM

Sadly it could be lots of things.

Check your data. Are you really just going over the points you think you are?

Check your code. Step through each line, are there any extra draw calls? Any extra transformations?

Check your shaders, if any, for the same things.


Writing an rendering engine is tricky and math-intensive. Sometimes you create a subtle bug and the world explodes and you can't figure out why. Or the world becomes black and you can't figure out why. Or even worse, sometimes you don't notice anything at all is wrong and then suddenly the engine falls apart because of a graphical glitch written months earlier.

It is generally best to go with an existing rendering engine unless this is a learning experiment for you.

Check out my book, Game Development with Unity, aimed at beginners who want to build fun games fast.

Also check out my personal website at bryanwagstaff.com, where I write about assorted stuff.


#3 Tchom   Members   -  Reputation: 193

Like
0Likes
Like

Posted 12 May 2013 - 12:41 AM

@frob

 

Thanks for the advice. I'm very quickly learning that debugging rendering code is very different to other kinds of debugging. I'm working on this for a hobby project, so I'm enjoying the challenge and the smug sense of self-satisfaction that comes with owning your own engine.

 

I found the bug and believe it or not, it was my own carelessness. Turns out I was passing the wrong number of indices into my "GLES20.glDrawArrays" call.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS