Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 01 Sep 2012
Offline Last Active Oct 20 2014 02:33 PM

Posts I've Made

In Topic: How to shade hair (line segments) in OpenGL

05 July 2014 - 04:11 AM

OK, I'll try that and see how it works.

In Topic: How to shade hair (line segments) in OpenGL

03 July 2014 - 07:42 AM

The thing is I am not sure how to pass that additional vertex. How can the shader know when its time to use it ?

If I just add a vertex to my buffer, the result will be the same I think?


EDIT: I managed to get better results with precalculating the segment directions, fill them in an array and pass them to opengl. But the shading is not smooth and you can see the different line segments, not sure how to interpolate it.

In Topic: How to shade hair (line segments) in OpenGL

03 July 2014 - 06:33 AM

I use the same vertex buffer for "vert" and "vertNext", just with different offsets. I guess that when "vert" points to the last element of the buffer, "vertNext" is some undefined garbage and weird things happen.


Any suggestion how can I get the line segment direction ? Do I need to calculate it outside of the shader and later pass it ?

In Topic: AI is harder than I thought

12 April 2014 - 01:13 PM

If you want you can have a look at this code: click

Specifically line 146 - computerMove() function.

I have written this version in my early years when I was learning C++ and some parts of the code look horrible :D

but the algorithm for the AI should work just fine.

In Topic: Mathematics for 3D programming - Exercises

22 January 2014 - 04:47 AM

I've started watching the linear algebra videos some time ago and they are really nice. But it seems short on exercises (or not deep enough)