Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - scottyaim

Pages: [1]
1
General / Re: glm::mat4 in setUniform?
« on: October 09, 2016, 02:50:57 pm »
It's not that hard, just look at the documentation.

Quote
The matrix can be constructed from an array with 4x4
elements, aligned in column-major order. For example,
a translation by (x, y, z) looks as follows:

float array[16] =
{
    1, 0, 0, 0,
    0, 1, 0, 0,
    0, 0, 1, 0,
    x, y, z, 1
};
sf::Glsl::Mat4 matrix(array);

And then in glm::mat4 you have glm::value_ptr to get a float* out of a glm::mat4.

Thank you that solved it!

2
General / Re: glm::mat4 in setUniform?
« on: October 09, 2016, 01:16:49 pm »
Because SFML isn't GLM?

You'll need to pass it as a sf::Glsl::Mat4.

Okay i see. What is an easy why to pass a glm::mat4 for into a Glsl::mat4?

3
General / glm::mat4 in setUniform?
« on: October 07, 2016, 10:33:24 pm »
Hi, I am trying to load a glm::mat4 into a shader but there are no overloads for glm::mat4 in shader.setUniform().

Is there any why to upload a glm::mat4 into a uniform with shader.setUniform()?

Pages: [1]
anything