Jump to content

Arjan B

Member Since 04 Nov 2007
Offline Last Active May 14 2016 03:39 AM

Posts I've Made

In Topic: 'Remove' direction from velocity

19 January 2016 - 08:16 AM

Just to add to Alvaro's comment: projection of A onto B gives you all of A in the direction of B. This is why he/she subtracts that projection from A. The Wikipedia page on vector projection calls this the rejection of A from B: https://en.wikipedia.org/wiki/Vector_projection

In Topic: Uploading a 1D texture in OpenGL - All (0, 0, 0, 1)

26 November 2015 - 12:06 PM

Wow, thanks a lot guys!


I ended up doing what Juliean said, which brought me right to the glUniform1f() function. And exactly as Nanoha stated, it generated a GL_INVALID_OPERATION error, which was fixed by simply replacing the 'f' with an 'i'. Wish I'd posted here sooner, I spent tons of hours sadly staring at my screen as well.


Thanks again!

In Topic: Is ray tracing hard or is it just me?

24 August 2015 - 09:54 AM

I think it's appropriate here to link to Bacterius' journal: http://www.gamedev.net/blog/2031-ray-tracing-devlog/. I think he does a good job at thoroughly explaining the process of writing a raytracer.

In Topic: Beginning GLSL - Quick Question

08 June 2014 - 05:45 PM

Good luck! This online book helped me greatly: http://www.arcsynthesis.org/gltut/index.html

In Topic: Beginning GLSL - Quick Question

08 June 2014 - 12:41 PM

You calculate your view matrix and you calculate your projection matrix. Instead of telling your shader: "Here's the both of them", you simply multiply them once on the CPU and tell your shader: "Here's the view*projection matrix". There's no need to work out how to calculate the both of them in one go.


Since the result of that matrix multiplication is the same for one draw call anyway, you might as well do it just once on the CPU, instead of doing it again and again for every vertex in the shader.


Yes, every time you update your view matrix, you will have to multiply it with the projection matrix again and then feed that to your shaders.