Jump to content

View more

Image of the Day

Boxes as reward for our ranking mode. ヾ(☆▽☆)
#indiedev #gamedev #gameart #screenshotsaturday https://t.co/ALF1InmM7K
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

help me understand this asm shader

4: Adsense

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   

588
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
:)

#2 Nik02   Members   

4297
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.