Jump to content

  • Log In with Google      Sign In   
  • Create Account

help me understand this asm shader


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 Anddos   Members   -  Reputation: 499

Like
0Likes
Like

Posted 26 August 2012 - 11:45 PM

vs_1_1
dcl_position v0
dcl_texcoord1 v1
m4x4 oPos, v0, c0 // c0 would be world*view*projection right?
mov oT0.xy, v1.xyyy
dp4 oT1.x, v0, c4
dp4 oT1.y, v0, c5
:)

Sponsor:

#2 Nik02   Crossbones+   -  Reputation: 2833

Like
0Likes
Like

Posted 26 August 2012 - 11:56 PM

The m4x4 instruction multiplies a vector by a 4x4 matrix. Your guess is very likely correct.

The subsequent "mov" instruction copies input texture coordinates to the output, without modifying them.

Dp4 is a dot product with 4 components. In the two last rows, the dot product of vertex position and some constants are stored in the second texture coordinate output register. That said, the meaning of the constants c4 and c5 is unknown. Taken out of the context in which the code is used, it is very difficult to guess the actual purpose of the instructions. Dot product, in general, can be thought of as a measure of similarity between two directional vectors.

Edited by Nik02, 26 August 2012 - 11:59 PM.

Niko Suni





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS