• Content count

  • Joined

  • Last visited

Community Reputation

634 Good

About silvermace

  • Rank

Personal Information

  • Interests
  1. [quote name='ileonte' timestamp='1295437787' post='4761206'] It's not a question of 'if' it's a question of 'when' you will be forced to use VBO's. Remember: there's no such thing as a VAO in OpenGL 4.x/ES 2.x. Why not do the right thing and use VBOs everywhere ? [/quote] Hmm.... [url=""]OpenGL ES 2.x OES approved VAO Extension[/url] [url=""]OpenGL 4.1 Core Spec (pp. 52, Vertex Array Objects)[/url]
  2. Android devices

    I've been looking into Android development and I dont have much outside of a basic prototype, but the developer section is helpful for this kind of thing, [url=""]specifically the section on screen support[/url]. Hope that helps.

    most implementations of GL will only allow a stack depth of around 32. (you can check by calling glGetInteger with GL_MAX_MODELVIEW_STACK_DEPTH) Your problem is that you appear to be implicitly making a "recursive" call to glPush/glPop matrix. You are calling glCallList while making a new list which is already using the stack, you then replace the last 'list' value with the newly generated list, once you do this several times, you will easily creep past the max stack depth. You should refactor your code to not require display lists, as they will (or already are?) deprecated functionality. If you are adamant you want to keep the display lists, then you should only build and maintain 1 list, and each time you build it, you mustn't call any previous lists, I would suggest using a dirty flag for all your setters, and only build the list in the draw code if the dirty flag is set. void setPosition(NxVec3 pos) { this->pos = pos; dirty = true } void draw() { if(dirty) { createDisplayListFromScratch(); dirty = false; } glCallList(this->list) } Something along those lines..
  4. Quote:Original post by relsoft I would advise to use Octrees for big static meshes. I've used them in my engines and they certainly have a big impact on the speed of rendering. For dynamic objects, try to do narrow-phase collisions first and if you still have a slow engine, then that's the time to find other ways to optimize rendering.Seconded, a lightweight, non-recursive Octree will definitely help if your scene is suitable (not much occlusion, relatively static and high total polygon count with lop sided ratio of visible:non-visible at any given time). They are very easy to write as well, so hardly a waste of time if you have no scheme at all, in fact a great way to ease into a more complex system.
  5. Don't use a cubemap. Use a Texture2D, divide it up into 6 areas, rendering each direction to a corresponding area in the 2D texture, then use shader lookup logic to fetch the right area based on your standard 3D lookup vector. This is essentially flattening the cubemap, and allows filtering to take "edges" into account. You will have some wasted memory as a POT texture wont best fit 6 faces, but you can use the remaining space for something else if you like.
  6. batch cropper

    Quote:Original post by doesnotcompute You might try ImageMagick. I know it can perform operations like grabbing an arbitrary region of an image and creating a new image out of it. There's a C++ API you can use from your own applications, and there's also a command-line tool you could use for batch processing.We use ImageMagick command line and shell scripts, its perfect for this kind of task. e.g.#!/bin/bash for FILE in `find . -name "*.png"` convert "$FILE" -resize 256x256\! "$FILE" do donethat "in-place" resizes input file to 256 x 256 image, disregarding aspect ratio ( thats what the ! means)
  7. OpenGL OpenGL ES with Display List?

    Quote:Original post by karwosts You don't need display lists, you need VBO. Display list is deprecated, old, and useless in modern graphics programming. If you feel that it 'doesn't provide the performance of display lists', than you're doing it wrong. You can explain further what you're doing if you disagree.depending on your definition of modern, display lists still offer improved state caching performance which has no equivalent in the latest GL spec, but is coming soon (I believe it already exists in ES 2.x). Quote:Original post by karwosts karwosts is correct. VBOs are super fast. If they are slowing down your program, you are definitely doing something horribly wrong.Not strictly true, many mobile devices VBOs have no effect apart from "future proofing" your code. In mobile applications the GPU and CPU share the same memory and memory bus, so VBOs have little or no effect if the GPU does not have its own dedicated memory and/or controller. In these cases, your code may be slower due to increased complexity in your implementation's setup and bind logic. If you use a thin wrapper around VBOs and fastidiously share buffers and don't alter the GL state excessively, shared memory devices can experience somewhere around 5% increase in performance from using VBOs. To improve your performance, you're going to have to profile your code and see if you're vertex, fill or CPU bound, chances are one of these elements is whats causing your problems. Profile profile profile.
  8. you may not want to hear this, but it sounds like you don't have a good grasp of C++ and how it all works yet. If you want to get stuff explained to you, you're probably going to have provide a more complete picture of your code. It sounds like you're trying different things and just hoping, and that's not the best way to go about this particular issue.
  9. obj-c forward declaration

    Forward declaration is that same as with C9x, if VertexData_VTN is a struct use struct otherwise @class works for most other ObjC specific objects (interfaces etc) - as far as I know.struct VertexData_VTN; @interface Model3D : NSObject { NSString* m_Name; NSString* m_Texture; /*you may need struct here as well depending if VertexData_VTN is declared using typedef struct { ... } VertexData_VTN; or struct VertexData_VTN {}; */ struct VertexData_VTN* m_VertexDataArray; }
  10. what is m_szMenuHeader's type, is it "char* m_szMenuHeader" or "char m_szMenuHeader[100]" ? this is your problem line: m_szMenuHeader = cMenuHeaderBuffer if m_szMenuHeader is infact a char array and not a char pointer, then you can fix it by using: strcpy(m_szMenuHeader, cMenuHeaderBuffer); While this may fix your current problem, you are heading for a world of hurt if you dont use the right tools for the job. C++ version struct foo { std::string m_sMenuHeader; void bar() { std::string s("Please enter a key for the "); s += std::string("Quit"); m_sMenuHeader = s; } };
  11. Multiple UV's and Normal's per Vertex

    This is one of the oddities of the Wavefront OBJ format. The correct way to load these OBJ files is to build a list of faces and generate a final list of verticies duplicating norms/tc's as required. you should also know, the OBJs Face's are not guaranteed to be triangles, they are allowed to be arbitrary-n polygons.
  12. I tweaked your code on pastebin, reposted here for posterity. I think that should work now. GLSL compiler doesn't do implicit casting like a C++ one, so be very careful - trace your types line by line if you ever encounter these errors. #extension GL_EXT_gpu_shader4 : require #extension GL_EXT_geometry_shader4 : enable #extension GL_EXT_texture_integer : enable uniform int depth; varying float sphIndex; uniform sampler3D tex; uniform isampler3D texIndex; uniform isampler2D texIndexStartPoint; void main() { ivec2 vertCoord; vec4 color = vec4(1.0, 1.0, 1.0, 1.0); vec4 lastColor; vertCoord.s = int(gl_TexCoord[0].s*300.0); vertCoord.t = int(gl_TexCoord[0].t*300.0); ivec4 startPointValuev4 = texelFetch(texIndexStartPoint, vertCoord, 0); float startPointValue = float(startPointValuev4.r); if( startPointValue*1.0 == (19049758.0+0.5) ) color = vec4(0.0, 0.0, 1.0, 1.0); gl_FragColor = color; }
  13. beginner tinyxml++ question

    just noticed, begin() returns T* not Iterator<T> ?? ie. lines 8 and 9: 8 ticpp::Iterator< ticpp::Node > child; 9 for ( child = child.begin( root ); child != child.end(); child++ ) { 10 if ( child->Value() == "gun" ) { 11 // do an thing 12 } 13 }
  14. beginner tinyxml++ question

    can you paste the whole error? I think there's some vital info missing from the error - maybe include the build log in source tags. I would guess its a missing header, but that seems really unlikely as TiXML++ is like all of 2 header files.. My first suspicion was that child.begin( const Node* p ) wasn't being selected by the compiler because root is of type Element but its clearly obvious (to the compiler) that Element implements Node so that can't be it..
  15. try changing this line: glRenderbufferStorageMultisample( GL_RENDERBUFFER, 0, GL_DEPTH_COMPONENT, w, h ); to glRenderbufferStorage( GL_RENDERBUFFER, 0, GL_DEPTH_COMPONENT, w, h ); One other thing you might want to do, easiest and definately a must if the above doesnt work. Create a simple global method: glCheckError() { assert(glGetError() == GL_NO_ERROR); } and call this after every gl* function call - obviously you can remove them when you find the problem, but I usually keep em. -Danu EDIT: just noticed you're not setting your textures filtering options, this is more likely to be the culprit glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); place those just after you call glTexImage2D..