CVS Check-in Feb. 5 2007

The number that can play at one time is dependant on your hardware.  Which sounds play is not currently prioritized beyond turning off sounds "out of your ear range".  Work would need to be done to generalize that concept though as sound priority might be defined differently in different games.  (eg. purely distance based vs. category based, etc.)

@renanse, how could you write OpenAL 1.1 specific code if you're using LWJGL's OpenAL?  Or are you?  If not, maybe we should consider going the "alternative" route unless of course that's more proprietary code that you could share with us but you'd have to kill us?  :stuck_out_tongue:

Not sure if this is the correct place to post this, but…



I use RenderToTexture for shadow maps and they do not work with the new FBO's. After fiddling around a bit I discovered that setRTTSource(…) with any other modes than RTT_SOURCE_RGB or RTT_SOURCE_RGBA (I use RTT_SOURCE_DEPTH) on the texture that is used with RenderToTexture produces a "java.lang.RuntimeException: FrameBuffer: 1, has caused a GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT exception". I looked around a bit in the code for RenderToTexture, but i could not find the problem more specific than that I'm afraid.



<Edit>

I found the error (in the case of depth-textures at least).



In LWJGLTextureRenderer, the following:

public void render(Spatial toDraw, Texture tex, boolean doClear) {

@renanse Switching off sounds outside hearing range sounds like a good start, since I can make most noises have a fairly short range. As far as a better system goes, seems like Comparator<SoundNode> would be perfect? If that could be given to the sound system somehow, it could keep the nodes sorted, with the top X being played. I don't know how simple that would be to do, but if it's not too hard it would be good to have. Actually, just the sound system as is would be good to have :stuck_out_tongue_winking_eye:

@marqx: Regarding depth textures, I'll have another look at that.  Your solution doesn't seem to work in all cases, but it looks like it may have something to do with records.  Thanks for pointing this out!

No problem! Thanks for looking into it!

Would you be able to provide me with a sample app that does what you are trying to do with depth textures?  I don't think I have anything quite like that to test against.

My own application works with the modifications to LWJGLTextureRenderer that I described a few posts ago. So if you have encountered any other problems, which have something to do with records i.e., I'm not really sure how to help you I'm afraid.

The reason I'm asking is because depth textures (such as hitting F3 in a test to see the depth buffer preview) now work fine in my editted version and I haven't messed with setting the read buffer.  I'm loathe to blindly set that for something I can't test myself.

Ok! I'll try to set up a test-case for it as soon as possible.



Btw, I found out about the read-buffer from this page http://lwjgl.org/wiki/doku.php/lwjgl/tutorials/opengl/basicfbo.


If you are only rendering to depth and/or stencil, you must set the draw and read buffers to GL_NONE, otherwise, the FBO isn’t complete and a RuntimeException will be thrown in the completeness check:
GL11.glDrawBuffer(GL11.GL_NONE);
GL11.glReadBuffer(GL11.GL_NONE);

Weird.  Wonder how it is working as is for water and the depth debugger.



Looking forward to your example.

I wrote a simple sample application that can be found at http://www.centenstate.com/ShadowMapSample.zip. It throws a GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT exception without GL11.glReadBuffer(GL11.GL_NONE) and works with it. The zip-file also also contains a modified version of LWJGLTextureRenderer.java that works with the application.

I don't know if this is relevant, because there must be something wrong in my code, but before a recent CVS update I had a WaterRenderPass working pretty much ok in Aircarrier, and now it is broken. It starts out with a texture that looks a bit like uninitialised memory, then starts flickering on and off (it looks about right when it is there). The water Tests seem fine though, so I'm going to try to work out what the difference is. It's odd since I pretty much just cut and paste the test code, and it did work before.