Skip to main content
gamedev.net
🔒 Locked

Cg: float3x3 and float[3][3]

Started by _dogo Sep 22, 2005 at 6:36 AM 0 replies 2.3k views
Original Post
_dogo
_dogo
Hi, I write shader in cg, i have to pass a uniform matrix parameter. There is no problem up to 4x4 size-matrices, as they are definied in cg as float 3x3, float4x4, etc., and i can use them perfectly. But float5x5 is NOT, and if i want to pass a float[5][5] matrix, it does not work. The values are not passed. It seems i cannot pass a float[5][5] matrix i have to convert it someway. If i pass tis way, it works: fragpout main(fragin IN, uniform float3x3 convMx) But this way it does not: fragpout main(fragin IN, uniform float convMx[3][3]) I understand they are not equivalent, but i have to use bigger matrices as well... Have you got any ideas?
credo
dimensionX
dimensionX
I have the same problem with GLSL. Since there is no arbitrary dimension matrices (> mat4) I had to declare:

float tmp[5][5];

and assign values to each element separately. Is there a 2D array declaration/initialization like in C ?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.