Jump to content
  • Advertisement

vNeeki

Member
  • Content Count

    63
  • Joined

  • Last visited

Community Reputation

194 Neutral

About vNeeki

  • Rank
    Member
  1. Well done , well done. I'm still following the project ;)
  2. 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: /* * lines x-y: shader setup * lines z-w: vbo setup * ... */ 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 : CShader shader; shader.SetVSource("vert code"); shader.SetFSource("frag code"); shader.Compile(); shader.Bind(); shader.UnBind(); int uniform = shader.GetUniformLoc("variable"); Woahah sounds amazing! How about assimp model loading/rendering and multiple opengl contexts?
  3. Very nice work ...and i just learned about GLFW's existence Maybe it is about time to take divorce with SDL Quick-edit-- Suggestion : Maybe add a common module for the (common) shader stuff ?
  4. Ok thanks both of you then
  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.
  6. 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! 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. Thanks , but i know all these ;) What im not sure about is , if it is safe to not 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();
  8. 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 : //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); 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 : 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; } } //Test Bind("Player.png",0); DrawPlayer(); Bind("PlayerDetail.png",1); DrawPlayerDetails(); ??? Or do i really have to do this: 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; } } ?
  10. vNeeki

    Disable pixel shader

    I'm probably the worst GLSL programmer in the world , but why you don't try something like : uniform int enabled; void main () { if (enabled) { RunMyPixelShaderTask(); } } ?
  11. vNeeki

    Seams between tiles

    May i ask if by generating mipmap levels at runtime could fix the problem as well ?
  12. I'm looking for a really really simple example to get started , ie : Detect if current character is alpha numerical or letter.
  13. 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.
  14. [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 at the same time ? Thanks for looking[/s] Solved , there is an opengl wiki page about it
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!