help me understand this asm shader

Started by
0 comments, last by Nik02 11 years, 8 months ago
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
:)
Advertisement
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.

Niko Suni

This topic is closed to new replies.

Advertisement