• Content count

  • Joined

  • Last visited

Community Reputation

237 Neutral

About Tommato

  • Rank
  1. Hi All I've read OpenGL Wiki and other resources, hope I've understood MSAA technique overview. But I can't figure out what are reasons to use it. If a multisampled context is created, then render itself takes care of AA, so why (or when) need to do same manually? Can you please explain cases when MSAA is better or/and faster? Thank you
  2. Mac hangs

    Hi All   I've a nasty bug: after 2-10 frames rendered my Mac hangs. It I do nothing it enters in "sleep mode" (as it should) and then I can "awake" it by pressing Esc. But nothing more: any keys presses  and mouse clicks has zero effect. The bug doesn't appear if I load Mac in "Safe mode". There is no crash, no any errors, system logs has only this   12/17/16 8:35:05.000 AM kernel: ** Device in slot: SLOT-1 ** 12/17/16 8:35:05.000 AM kernel: ** GPU Debug Info Start ** 12/17/16 8:35:05.000 AM kernel: 0x00009588 12/17/16 8:35:05.000 AM kernel: 0x000000d8 12/17/16 8:35:05.000 AM kernel: 0x00000001 12/17/16 8:35:05.000 AM kernel: 0x00000018 .... 12/17/16 9:16:25.000 AM kernel: 0x00000000 12/17/16 9:16:25.000 AM kernel: 0x00000002 12/17/16 9:16:25.000 AM kernel: 0x00003808 12/17/16 9:16:25.000 PM kernel: ** GPU Debug Info End ** 12/17/16 9:16:58.000 AM bootlog: BOOT_TIME 1481959018 0  // next boot   If I try to change my C++ or GLSL code, or change the scene - the hang disappears. Any idea how to get more info about what's wrong?   Thank you
  3. Hi All   I realize OpenGL draws a quad as 2 triangles with barycentric interpolation for each one. But it looks "not symmetric" (attach), that confuses users and produces unneeded questions. Is there a way to change this, or it's unavoidable?   Thank you
  4. Draw mixed geometry

    I'm testing with user's project 4.6 millions of polys, approx same vertices. 130 objects, a half of them have intensive triangles/quads mix.   Is there a way(s) to transform this "some" into something more concrete that I could use in runtime? For example (pseudocode)   if (SomeTest())     // use glMiltiDrawElements else  // rebuild indices   Th?
  5. Draw mixed geometry

    I've rebuilt my code to use glMultiDrawElements. This call looks appropriated but I see no any speedup - same fps as with multiply glDrawElements ;-( It was unexpected, I hoped one call should be faster than hundreds (sometimes even thousands).    So now I make a copy of "indices" and sort it, then pass the copy to VBO. It's twice faster although works well for static geometry only   Thx
  6. Attributes as arrays

    Thx for the detailed answer
  7. Hi All   Most probably it's a naive question but I can't find any answer. Can I use attribute as array (pseudocode)?   // vertex shader attribute vec4 pos; varying test; ... void main( void ) {  ...   test = pos[5];  ... }   Is it valid? If yes what is returned? A value from attribute start or from current vertex?   Thank you  
  8. Draw mixed geometry

    In my case it doesn't work well. I can't change topology as it's better for me/drawing, e.g. p?lygons should follow in their original order, they are used in many ways besides drawing. Creating another one indices (just for drawing) is often counter-productive because it can't be done once for example when a new geometry arrives at every frame   I meant "face offset" (not "vertex index"). It looks like   v0|v1v|2|v3|v4|v5|..............|vx|vx|vx|
  9. Draw mixed geometry

    Not every, example:   there are, say, 2 blue triangles, their indices start from 0. And there are another 3 blue triangles at indices 100. Now I use 2 calls glDrawElements to draw first 2 then second 3. How can I draw them with one call?   Thx
  10. Hi All   I'm looking for more appropriate API calls for:   - model can have different faces (with 1, 2, 3, or 4 vertices) - model can have different faces' colors - model can have different materials assigned by user to arbitrary set of polygons   Now I just call glDrawElements for each part/piece of drawing and sometimes it becomes much slower. Please suggest better solution(s)   Thank you
  11. OpenGL Outline Shader

    >> By unshared edges do you mean exterior edges/silhouette?   Example (attach). Left = wireframe, Right = outline. Note that some unshared edges are not in silhouette but drawn.   All would be simple if possible to pass some "per-face" data to shader(s). But looks like OpenGL can't do it at all :-(    
  12. OpenGL Outline Shader

    In both cases I can't see how to draw unshared edges too (not contour only)   Never used such kind of shader yet. From API I see - yes, the current face vertices are known and I can generate some edges as lines. But based on what? I see no any way to pass data of the current face neighbors. Have I missed something?   Thx
  13. Hi All   It's very simple on CPU. There is an array of facet normals and array of edges. Pseudocode   struct Edge {  int v0, v1;     // vertex indices  int f0, f1;      // indices of facets sharing this edge };   bool ShouldDrawEdge( const Edge & e, const std::vector<Point3f> & faceN ) {  if (e.f1 < 0) return true;  // unshared edge is always drawn  bool visible0 = dot(ToCamera(faceN[e.f0]), view_direction) >= 0;  bool visible1 = dot(ToCamera(faceN[e.f1]), view_direction) >= 0;  return visible0 != visible1;   // draw silhouette edge }   But, of course, it works slow ;-( How to use GPU for this? Or more general question: how to pass "per face" attributes to shader? Or it's impossible with modest card like OpenGL 3.3? Or impossible at all? So powerful GPU and so simple task - why it can't? ;-)   Note: no "pixel-based" solutions please, it's not interested   Thank you
  14. Unroll

    That is a normal (CPU) logic. But GPU has other, for example   if (some_value == 0) { // 1000 lines of code here }   The 1000 lines would make shader much slower NO MATTER the some_value is never zero in runtime, e.g. the 1000 lines are never executed. So I've doubts that just "unroll everything" is always good, most probably unroll is effective up to some limit(s). But it's my assumption only, nothing more