[SOLVED] MasterEffect OpenGL matrix swizzeling problem

  • Mikan
  • Topic Author
More
9 years 2 months ago - 9 years 2 months ago #1 by Mikan MasterEffect ReBorn official thread was created by Mikan
Hi again^^
Amnesia the Dark Decent would not accept this part of SSAOgen, not sure why.. code looks good and work on other games :huh:
float3x3 matRotate;

	float hao = 1.0f / (1.0f + vRotation.z);

	matRotate._m00 =  hao * vRotation.y * vRotation.y + vRotation.z;
	matRotate._m01 = -hao * vRotation.y * vRotation.x;
	matRotate._m02 = -vRotation.x;
	matRotate._m10 = -hao * vRotation.y * vRotation.x;
	matRotate._m11 =  hao * vRotation.x * vRotation.x + vRotation.z;
	matRotate._m12 = -vRotation.y;
	matRotate._m20 =  vRotation.x;
	matRotate._m21 =  vRotation.y;
	matRotate._m22 =  vRotation.z;


Changed it to this one and it worked fine and should do same I think. Tested with both Amnesia and Borderlands 2 ^^
float hao = 1.0f / (1.0f + vRotation.z);

  float3x3 matRotate = float3x3(float3(  hao * vRotation.y * vRotation.y + vRotation.z,
                                        -hao * vRotation.y * vRotation.x, -vRotation.x ),
                                float3( -hao * vRotation.y * vRotation.x,
                                         hao * vRotation.x * vRotation.x + vRotation.z, -vRotation.y ),
                                float3( vRotation.x, vRotation.y, vRotation.z) );
Last edit: 9 years 2 months ago by Mikan. Reason: Oops :P

Please Log in or Create an account to join the conversation.

  • crosire
More
9 years 2 months ago #2 by crosire Replied by crosire on topic MasterEffect ReBorn official thread

Mikan wrote: Hi again^^
Amnesia the Dark Decent would not accept this part of SSAOgen, not sure why.. code looks good and work on other games :huh:

That's a bug in the current ReShade to GLSL compiler, where I erroneously asumed GLSL supports matrix swizzeling (which actually works on NVIDIA). Fixed in the next version, where it generates working code again. Workaround for now is to use the array operator or the constructor directly (like you did). =)

Please Log in or Create an account to join the conversation.

  • Mikan
  • Topic Author
More
9 years 2 months ago #3 by Mikan Replied by Mikan on topic MasterEffect ReBorn official thread

crosire wrote: That's a bug in the current ReShade to GLSL compiler, where I erroneously asumed GLSL supports matrix swizzeling (which actually works on NVIDIA). Fixed in the next version, where it generates working code again. Workaround for now is to use the array operator or the constructor directly (like you did). =)


The amount code you guys are keeping track on most be quite a lot :ohmy:
Trying to learn myself. :blush: Looking forward to new updates^^

Please Log in or Create an account to join the conversation.

We use cookies
We use cookies on our website. Some of them are essential for the operation of the forum. You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.