Jump to content
  • Advertisement
Sign in to follow this  
Anddos

help me understand this asm shader

This topic is 2298 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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. Edited by Nik02

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!