• Content count

  • Joined

  • Last visited

Community Reputation

115 Neutral

About wantnon_cn

  • Rank
  1. a question about OpenAL on iOS

    now, i have got most of the sound effect done in my game (using a modified version of the sample code). glad to see your replies about the question. it seems the conclusion is the sample code is no problem, right?
  2. a question about OpenAL on iOS

    if indeed like that, my worry will relieve.  
  3. a question about OpenAL on iOS

    i also suspected the reason lies in the alBufferDataStaticProc function. but does this mean we use normal memory instead of audio card memory? if so, would it be inefficient on performance or space?
  4. a question about OpenAL on iOS

    i thought, for iOS developing, Apple's official samples should be the most correct. but if this MusicCube is not so good, what else sample code should i refer to?  and, is there any possibility that the MusicCube sample is no inefficiency or leaking problems as we thought and there is something we not fully understand about this code?
  5. i am adding sound to my iOS game using OpenAL, i downloaded the sample code "MusicCube" at Apple Developer, i use the code directly in my game and it works fine. but however, i have a question about the sample code, in the sample code, in file MusicCubePlayback.m i find the initBuffer function, for your convenience i paste it here? my question is: after the alBuffer established, why didn't they free the _data?  i think the alBuffer should be a memory in audio card and through the initBuffer function we submit the audio data in _data to audio card(alBuffer) and then _data is no more needed so we can free it. but i tried to free _data and it cause the sound not play normal.  i just wonder why it is not just as the process of creating textures in OpenGL: when creating texture, after the texture established we can free the image data.  so, back to OpenAL and the MusicCube sample, did it freed the _data in some where else i did not notice? or it just not be freed? if _data not freed, may it cause memory inefficiency?          
  6. [quote name='C0lumbo' timestamp='1355472317' post='5010517'] Possibly - I'd recommend you be as explicit as possible with precision rather than using the default precision. [/quote] ok, i will take your advice and specify the precision explicitly to insure the matching.
  7. [quote name='C0lumbo' timestamp='1355346323' post='5009965'] I seem to remember an issue of severe performance problems if your vertex shader output precisions mismatch with their corresponding pixel shader input precisions. [/quote] so, if in vertex shader i do not specify a precision for a vertex shader output varying variable, and in the fragment shader i specify it with lowp or highp, will this cause a mismatch problem (have a risk of low performance) ?
  8. i am working on a iOS 3d game, because i don't have a real device in hand, so i have being test it in iOS simulator, and it always run well. today i got a itouch4 with 5.0.1 system and test my game on it. i found a strange problem: in shader, i set the texCoord to lowp, and the texture become mess on device (but nothing wrong in simulator), and when i modified it to mediump it fixed. there are some other wrong effect, and they are also finally solved by change lowp to mediump or highp. that is a little strange because even though we known a little precision loss many cause some flaws, but i never expected the flaw may so serious as to get totally wrong effect. and this is not the most strange thing, i also found that after i changed some of the lowp to mediump or highp, the game runs much more fluent on the device than before. so i start to suspect that may be lowp have some support issue on real device. does the system (here is iOS 5.0.1) not support lowp well? anyone else have the similar annoying experience with lowp? i also want to known if i should change all the lowp to mediump or highp (or may be better all change to highp)?
  9. thank you guys , now i am more clear with this question [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]
  10. i am using opengles 2.0. but i think the answer will be same with openGL. i am using VBO. every frame i bind the vertexBuffer and then use glBufferData to submit a vertexArray to GPU.the size of the vertexArray is different each frame. so i wonder if the space of the vertexBuffer reallocated every time? i guess if the vertexArray i submit this time is bigger than last time, the space of vertexBuffer on GPU side need to reallocate, and it may inefficient. am i right? do i need to reserve space for the vertexBuffer to avoid reallocation? i read on the opengles 2.0 reference and found the information that if we call glBufferData with * data set to NULL, it will perform space reservation, for example: glBufferData(GL_ARRAY_BUFFER, n_byte, NULL, usage);
  11. [quote name='NikolajThorsen' timestamp='1349210728' post='4986190'] Yes, i have used a similar solution, but this doesn't use the built-in GL_DEPTH24_STENCIL8_EXT. Having a separate color buffer just for stencil information seems very unnecessary. What is the correct way of getting the stencil part of GL_DEPTH24_STENCIL8_EXT, if i wish to display the stencil buffer on screen? If i have omitted any important details of my implementation, please tell me and ill give more information. [/quote] so, i want to know the answer, too. hope some one can solve this.
  12. why i cannot see the attached file? ok, you can see here: [url="http://user.qzone.qq.com/350479720/blog/1348470101"]http://user.qzone.qq.com/350479720/blog/1348470101[/url]
  13. why i cannot see the attached file? ok, you can see here: [url="http://user.qzone.qq.com/350479720/blog/1348470101"]http://user.qzone.qq.com/350479720/blog/1348470101[/url]
  14. i know a working way, but maybe not very elegant. you can attach your fbo a second color texture and render the stencil component to it (just make the second color buffer your render target, enable the stencil test and render a white quade cover the viewport, you know that). i am a beginner to shader. few days ago, i encounter the same problem you asked above, and can not solve it, too. then i happened read a post somewhere give that solution, though not perfect, but works, and i use it achieved my goal. the efficiency seems ok. anyway, always hope a better solution. ---- the attached file is what i got.