Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 25 Oct 2010
Offline Last Active Today, 08:42 AM

Posts I've Made

In Topic: Draw mixed geometry

Today, 05:53 AM

With the same shader and uniforms?

In Topic: Draw mixed geometry

Yesterday, 09:38 PM

dont call gldrawelements every face you draw

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?



In Topic: Outline Shader

21 October 2016 - 04:39 AM

>> 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 :-(



In Topic: Outline Shader

21 October 2016 - 02:19 AM

One way is to draw your object twice ...


Another way is to render your object setting the stencil value to 1, t

In both cases I can't see how to draw unshared edges too (not contour only)


You can do it with the geometry shader.
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?



In Topic: Unroll

15 October 2016 - 10:47 PM

Here "big" is not measured in lines of code or generated instructions, but rather in the total number of instructions executed. A shader with 5 instructions that loop 1000 times is just as "big" or "bigger" than an unrolled loop with 5000 instructions.
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