Log in or register to post comments

Will glLight work in renderFrameQCAR?

October 16, 2011 - 3:25pm #6

Hi, I hope someone can help.

I have an app using OpenGL ES 1.1 and I can't get lighting to work in the renderFrameQCAR callback. My object doesn't have a texture, just a glColor4f (which changes as an indicator to the user). I can light it nicely in my own renderFrame but whatever I try it just comes out flat in the QCAR one. I notice there are notes on the site about lighting being disabled but does that mean I can't turn them on again?

I assume I could get it to work using shaders in 2.0 but would prefer not to port when everything else is working so well.

Thanks

Edit:
This problem has gone away by changing the order the objects are drawn in but I don't know how or why. If anyone hits a similar problem I'd be happy to dig deeper and try to isolate the relevant gl calls.

Re: Will glLight work in renderFrameQCAR?

October 26, 2011 - 8:08am #5

Hi, I have same problem.

Please tell us about your 3d model (cube, cylinder ..etc.), and how did you change source files (or 3d model data) ?

Re: Will glLight work in renderFrameQCAR?

October 26, 2011 - 11:33pm #4

Hi goka, sorry not to reply to you sooner but I have an app demonstration in 40 hours and the pressure is on! I'll get to work on this after the weekend if that's ok.
Steve

Edit: maybe something to do with the sequence of creating/binding framebuffers?

Re: Will glLight work in renderFrameQCAR?

October 28, 2011 - 6:23pm #3

Hi Steve, Thanks to your reply.
I hope your demonstration works well.

Re: Will glLight work in renderFrameQCAR?

October 29, 2011 - 10:06pm #2

Thanks goka, they loved it!

SOLUTION:

QCAR::Renderer::getInstance().begin() enables GL_TEXTURE_2D

you need to glDisable(GL_TEXTURE_2D) to make non-textured rendering with glLight work.

Hope it works for you!

:)

PS Check out Dev Guide -> Tips, Tricks and Useful Tools -> OpenGL State Changes in Video Background for other things to watch out for - doesn't mention GL_TEXTURE_2D but I should have guessed from the other mentions of textures

Re: Will glLight work in renderFrameQCAR?

October 29, 2011 - 11:25pm #1

Hi Steve, Thanks to your advice!
glLight works in my environment too. :-)

I have commented out glEnable(GL_TEXTURE_2D), but I couldn't notice to use glDisable().

Log in or register to post comments