Arkhyl

Member
  • Content count

    44
  • Joined

  • Last visited

Community Reputation

626 Good

About Arkhyl

  • Rank
    Member
  1. Order your draw calls..

    Overlapping objects will be an issue when you are dealing with transparent objets, and in this case the only solution, beside OIT techniques, is not to sort objects but triangles by depth to avoid potential artifacts, which might be impracticable in real-time (Unigine seems to do it, but I don't know how). So, in the general case, centroid distance is generally enough for draw call sorting.
  2. You have to put thee three SDL_GL_SetAttributes before the context creation for them to be taken into account. Actually you create a GL context with default parameters, which is surely a forward compatible context.
  3. GLSL initialize uniform variable with default value

    As said in OpenGL wiki, it is possible to initialize uniform variables as you do, but it might not be correctly implemented in some drivers : http://www.opengl.org/wiki/Uniform_(GLSL)#GLSL_definition_and_behavior.
  4. GL_MAX_DRAW_BUFFERS indicate the maximum number of buffers in which you can simultaneously draw, not the number you can create. So your problem is not here.   Do you call wglMakeCurrent in each thread in order to use the correct context?
  5. 3D surface reconstruction

    Look for Bundler (http://phototour.cs.washington.edu/bundler/) for the Structure from Motion part (retrieving of cameras position, orientation, ...) and after that PMVS to generate a point cloud of the surface (Bundler gives a script to generate PMVS input from its own output). Then you can try http://www.cs.jhu.edu/~misha/Code/PoissonRecon/Version4.51/ or maybe Meshlab to obtain a triangulation of the point cloud.   There is also 123D Catch (http://www.123dapp.com/catch) that generate a triangular model and a texture atlas from images, but I never been able to obtain as good results as with Bundler + PMVS.
  6. Going crazy - 3D at GL 3.2 doesnt work

    In your vertex shader, you are passing your matrices as vertex attribute ("in" keyword). Replace this keyword with "uniform" to pass them as uniform values. PS : #version 150 is correct for OpenGL 3.2. The new version notation (using opengl version) started since opengl 3.3
  7. I think texture views ([url="http://www.opengl.org/registry/specs/ARB/texture_view.txt"]http://www.opengl.org/registry/specs/ARB/texture_view.txt[/url]), introduced in OpenGL 4.3, might be able to do this.
  8. [quote name='jonathon99' timestamp='1341098916' post='4954398'] glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR_MIPMAP_LINEAR ); [/quote] You can only set mag filter to GL_LINEAR or GL_NEAREST. Also, for your alpha func, the equivalent OpenGL to D3DCMP_GREATEQUAL is GL_GEQUAL.
  9. Fast C++ casting

    Something like this will avoid the creation of a temporary variable void someFunction(void* v) { ((SomeType*) v)->someOperation(); } [\source]
  10. The line uniform vec2 pixelSize = vec2(24,24); seams wrong to me. Texture coords for samplers 2D range from 0.0 to 1.0, so with this pixel size you read outside the bounds of the texture (and with GL_REPEAT,you will have really awkward results). Try something like pixelSize = vec2(1.0 / screenWidth, 1.0 / screenHeight).
  11. Your DataHandler function takes a char instead of a char * (and it's the same for the return value). Also, to compare two strings stored in char arrays, you have to use strcmp. The == operator will just compare the two pointers, not the strings.
  12. A minimal example of what I have in my makefiles CC = g++ #compiler name BIN = demo #binary name SUBDIRS = . #list of source directories SRC = $(foreach dir, $(SUBDIRS) , $(wildcard $(dir)/*.cpp)) #generate the list of source files OBJ = $(SRC:.cpp=.o) #generatethe list of obj files all: $(BIN) $(CC) $(OBJ) -o $@ %.o : %.cpp $(CC) -c $< -o $@ You can also use cmake, which can do the same thing.
  13. IDE war ?

    Quote:Original post by Hodgman Real programmers use butterflies, you fool. The M-x butterfly command from emacs?
  14. Assimp (http://assimp.sourceforge.net/index.html) do this, if I remember well.
  15. KD-Tree, simple theory

    Quote:And this is my problem, how can I know which side (or axis) is the longest? During the building of your KD-tree, you will have to know the bounding-box of each cell. With this, it is easy to determine wich axis is the longest.