• Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

194 Neutral

About vNeeki

  • Rank
  1. Well done , well done. I'm still following the project ;)
  2. [quote name='japro' timestamp='1340973240' post='4953939'] [quote name='vNeeki' timestamp='1340954539' post='4953869'] Maybe add a common module for the (common) shader stuff ? [/quote] You mean as in a separate file or just separate functions? I'm aware that the examples aren't exactly best coding practice in terms of structuring etc. But I wanted to avoid introducing to much of my structure since that is one of the things that I often don't like in tutorials. That the author structures the code in some way that is intuitive to him but not me. Which in the end makes it harder to find what I'm actually looking for. Also I wanted the examples to be self contained without external includes other than the libs. I was considering putting something like a index on the top of the examples like: [code] /* * lines x-y: shader setup * lines z-w: vbo setup * ... */ [/code] to make it easier to find the relevant parts. Can you elaborate on what you mean with modules? [/quote] I meant a simple wrapper class to handle shaders.Something like : [CODE] CShader shader; shader.SetVSource("vert code"); shader.SetFSource("frag code"); shader.Compile(); shader.Bind(); shader.UnBind(); int uniform = shader.GetUniformLoc("variable"); [/CODE] [quote name='japro' timestamp='1340973240' post='4953939'] The next examples I'm considering to add are sync queries and buffer mapping (for texture streaming), timer queries, occlusion queries and conditional render as well as transform feedback. For the moment I'm going through OpenGL3.3 features and after having covered those I'll also look into 4+ stuff (tessellation most notably). [/quote] Woahah sounds amazing! [quote name='japro' timestamp='1340973240' post='4953939'] There might be other features I'm currently not thinkingof? [/quote] How about assimp model loading/rendering and multiple opengl contexts?
  3. Very nice work ...and i just learned about GLFW's existence [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] Maybe it is about time to take divorce with SDL [img]http://public.gamedev.net//public/style_emoticons/default/wub.png[/img] Quick-edit-- Suggestion : Maybe add a common module for the (common) shader stuff ? [img]http://public.gamedev.net//public/style_emoticons/default/dry.png[/img]
  4. Ok thanks both of you then [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]
  5. All i need to know is if glBindTexture binds the texture globally or if it is texture unit context sensitive , because if it is a global state change then i would have to bind the texture linked with each texture unit after each texture unit state change. [img]http://public.gamedev.net//public/style_emoticons/default/tongue.png[/img]
  6. [quote name='Aks9' timestamp='1340871296' post='4953588'] Third, why are you loosing days asking something that you can try in a minute? [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] [/quote] Because its OpenGL. When something works for you it doesn't mean that it will work for everybody. I've spent 2 weeks in the past finding an odd ati driver texturing bug(it would disable texturing) which was caused due to missing glEnable(texture 2d) before each texture upload(glteximageXX)....Basically glteximageXX would discard any previous glEnable(texture 2d) call for no reason! [quote name='Aks9' timestamp='1340871296' post='4953588'] Second, what is bound stays bound until you explicitly bind something else. [/quote] I know this what i don't know and can't find any info on the internet is if it is still valid for ALL texture layers!
  7. [quote name='dpadam450' timestamp='1340822907' post='4953411'] Not sure what you mean. You have 8 texture units by default. You can bind any texture you want to any unit, and they remain there for the life of the program no matter what unit is active or if texturing is disabled for that unit. The texture will stay bound even if texturing is disabled. If you have a model with 3 textures, 2 textures and 1 texture, you can do: activeate3Textures(); drawModel1(); disableTexture3(); drawModel2(); disableTexture2(); drawModel1(); EnableTexture2(); EnableTexture3(); drawModel3(); //again That what you mean? [/quote] Thanks , but i know all these ;) What im not sure about is , if it is safe to [b]not[/b] bind all the time textures for units 2..Count since im only using a large animation sprite sheet in the second pass and the state change would be unnecessary. In other words what i want to know is if this is safe : Init: -Activate Texture 0 -Enable Texturing -Upload Texture 0 -Bind Texture 0 -Activate Texture 1 -Enable Texturing -Upload Texture 1 -Bind Texture 1 In some Loop: Pass1: -Activate Texture 0 (Texture was already bound at init so skip glBindTexture for speedup) -DoPass1(); Pass2: -Activate Texture 1 (Texture was already bound at init so skip glBindTexture for speedup) -DoPass2(); [img]http://public.gamedev.net//public/style_emoticons/default/wacko.png[/img]
  8. [quote name='dpadam450' timestamp='1340815608' post='4953373'] Once you bind a texture it is always bound not matter what until you decide to glBindTexture a new one to that texture unit. [/quote] Yes but i can i have 2 textures at the same time uploaded to VRAM (GL_TEXTURE0 + GL_TEXTURE1) without having to waste time with uploads due to active texture changes?
  9. Hello ;) Lets assume that i have 2 animation sheet textures which i bind this way : [CODE] //This is simplified code which simulates the run cycle of my basic texture management class //Just bind both once glActiveTexture(GL_TEXTURE0 ); glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D,SomeID1); glActiveTexture(GL_TEXTURE1); glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D,SomeID2); [/CODE] Now what i would like to know is if by switching to different texture layer(ie GL_TEXTURE0,GL_TEXTURE1) the VRAM will contain the last bound texture or if it will contain room for both of them without having to do wasteful uploads...In other words , would something like this work : [CODE] bool TexMgr::Bind(const Texture& Tex,int Active) { if (ActiveTexture != Active) { glActiveTexture(Active ? GL_TEXTURE1 : GL_TEXTURE0); glEnable(GL_TEXTURE_2D); ActiveTexture = Active; } if (BoundTexture != Tex.Id) { glBindTexture(GL_TEXTURE_2D,Tex.Id); BoundTexture = Tex.Id; } } [/CODE] [CODE] //Test Bind("Player.png",0); DrawPlayer(); Bind("PlayerDetail.png",1); DrawPlayerDetails(); [/CODE] ??? Or do i really have to do this: [CODE] bool TexMgr::Bind(const Texture& Tex,int Active) { //Force upload(bind) texture aswell!! if (ActiveTexture != Active) { glActiveTexture(Active ? GL_TEXTURE1 : GL_TEXTURE0); glEnable(GL_TEXTURE_2D); ActiveTexture = Active; glBindTexture(GL_TEXTURE_2D,Tex.Id); //Force upload! } else if (BoundTexture != Tex.Id) { glBindTexture(GL_TEXTURE_2D,Tex.Id); BoundTexture = Tex.Id; } } [/CODE] ?
  10. Disable pixel shader

    I'm probably the worst GLSL programmer in the world , but why you don't try something like : [CODE] uniform int enabled; void main () { if (enabled) { RunMyPixelShaderTask(); } } [/CODE] ? [img]http://public.gamedev.net//public/style_emoticons/default/unsure.png[/img]
  11. Seams between tiles

    [quote name='Ashaman73' timestamp='1299753842' post='4783949'] This seems to be a texture bleeding issue when linear filtering is enabled. Here are some hints/tricks to get rid of it: 1. You tiles should be of power of two size, this could prevent texture bleeding from mipmapping. 2. Try to use [url="http://www.opengl.org/wiki/Array_Texture"]array textures[/url]: put each tile on a single layer (thought I don't know if the iphone supports this). Don't try to archive this with 3d textures (=>mipmapping issues)! 3. Try to clamp to the tile borders using a shader, add a small border to the tiles,but your total tile size(including border) should be still a power of 2. [/quote] May i ask if by generating mipmap levels at runtime could fix the problem as well ?
  12. [quote name='_moagstar_' timestamp='1338418986' post='4944810'] Here is a really good introduction [url="http://www.ibm.com/developerworks/library/l-neural/"]http://www.ibm.com/d...brary/l-neural/[/url] The python library they use is also great for quickly getting started [url="http://arctrix.com/nas/python/bpnn.py"]http://arctrix.com/nas/python/bpnn.py[/url] [/quote] Great material.Thank you!
  13. [quote name='frob' timestamp='1338400148' post='4944738'] What kind of neural network? There are many varieties to choose from. [/quote] I'm looking for a really really simple example to get started , ie : Detect if current character is alpha numerical or letter.
  14. What title says : Are there any simple NN examples with source code to look at ? I would really like to implement a NN based AI for my game but i just can't figure out how to start so i would appreciate any input on the matter.. Thanks for your time.
  15. [s]Hey. Has anyone managed to get multiple opengl contexts to work with SDL 1.3 ? And if so , is it safe to use more than one contexts [b]at the same time [/b]? Thanks for looking[/s] [b]Solved , there is an opengl wiki page about it[/b]
  • Advertisement