Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Everything posted by Tommato

  1. Hi All Now I use glPolygonOffset(0.0f, -fabs(zFar - zNear) / 1024); But it works bad, see "quadrangles" in the attached image. Setting bigger values can help with the actual model but rises probs with others. What am I doing wrong? Also: I've read about other solutions (instead of glPolygonOffset) like setup projection matrix or use shader code. But I think with ortho (no perspective) they do same as glPolygonOffset. Is it correct? Thank you
  2. Hi All, My application returns data for authentification in another thread. I use: auth = gst_rtsp_auth_new(); GstRTSPAuthClass* klass = GST_RTSP_AUTH_GET_CLASS(auth); klass->authenticate = authentificateAndAuthorizeAsync; ... gboolean authentificateAndAuthorizeAsync(GstRTSPAuth *auth, GstRTSPContext *ctx) { /*can send required answer in another thread*/ return true; } How can I use asynchronous authentification without blocking first thread. C++-tools like condition_variables and future/promise are not attractive, as far as they blocks first thread. Maybe GStreamer can handle it natively? Thanks!
  3. Ola Crazy! Thanks.. I will try Stack Overflow.. Tom
  4. Hi All My task is to save app data to video using different codecs. The data source is appSrc in ARGB format. I've created GstEncodingProfile with following strings: video/quicktime // Container format video/x-prores, variant=(string)4444, width=(int)[ 16, 2147483647 ], height=(int)[ 16, 2147483647 ]) // Video format It doesn't work (favorite -4 "not negotiated" error). Trying different "variant" options I've found only "standdard" works, (QT player shows the created video is Apple ProRes 422). All other variant choices give error. Same time with command line I can save videotestsrc in 4444 just fine. What an I doing wrong? Thx
  5. Tommato

    GstEncodingProfile for ApplePro Res 444

    Hehe, Thanks CrazyCdn!! GStreamer library is a Quicktime replacement Thanks a lot Tom
  6. 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
  7. Tommato

    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
  8. 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
  9. 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
  10. Tommato

    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?
  11. Tommato

    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
  12. 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  
  13. Tommato

    Attributes as arrays

    Thx for the detailed answer
  14. Tommato

    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|
  15. 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
  16. Tommato

    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
  17. Tommato

    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 :-(    
  18. Tommato

    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
  19. Tommato


    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
  20. Tommato


    Hi All   After several days of debugging     // It does NOT work, crash in glDrawElements #define MAX_TEXTURES  8 .. for (int i = 0; i < MAX_TEXTURES; ++i) { ... }   // All is ok uniform int textureCount; ... for (int i = 0; i < textureCount; ++i) { ... } I guess it's unroll problem (correct me if not). I use old ATI card intentionally as "minimal" because users can have any. So should I avoid unroll anywhere just because "there are some cards where it won't work"? What are better solutions for this?   Thank you 
  21. Tommato


    I thought about it, but there is a thing I don't understand well   Bigger shader == slower, isn't it? In other hand, unrolling speedup is significant, for example from 35 to 45 fps. So one contradicts to another? Please explain
  22. Hi All   I'm looking for convenient and fast way to create textures from one original with modified size and/or content:   - use a part (cropped rectangle) of whole image - invert RGB or Alpha or both - convert RGB to grayscale - deactivate Alpha (fill with 1.0)   I can load original pixels into CPU RAM, modify them and pass back to GPU (create a new texture). Is there a better way/technique to process all on GPU?   Thank you 
  23. Tommato

    Changing texture

    Yes, but how can I load the original to modify it with shaders? For example if I "draw some (textured) quad" then I've sampled (not original) pixels.   For now using CPU looks much simple, maybe slower but it;s not a catastrophe   Thx all for help 
  24. Tommato

    Changing texture

    Thx for your replies but I'm not sure that changing RGB/Alpha in shader (instead of another texture) is a solution here. I must change original pixels, not a sampled value received in shader. It's not same.
  • Advertisement

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!