Pixel Shader Programming, Continued
Table of content:
Pixel Shader Programming, Continued
Ad

Above you see a typical example for EMBM.
Here's a list of the rather simple texture blending instructions:
| Texture Blending Instruction | Parameters | Explanation |
|---|---|---|
| add | dest, src1, src2 | dest = src1 + sr2 |
| sub | dest, src1, src2 | dest = src1 - src2 |
| dp3 | dest, src1, src2 | dest = ( src1.x * src2.x + src1.y * src2.y ...) |
| lrp | dest, factor, src1, src2 | dest = (factor)src1 + ( 1-factor)src2 |
| mul | dest, src0, src1 | dest = src0 * src1 |
| mad | dest, src0, src1, src2 | dest = ( src0 + src1 * src2 ) |
| mov | dest, src | dest = src |
| cnd | dest, r0.a, src1, src2 | if ( r0.a > 0.5 ) { dest = src1; } else { dest = src2; } |
The pixel shader supports argument and instruction modifiers as well, to make life easier for programmers:
| Modifier | Explanation |
|---|---|
| r0.a | Alpha Replicate |
| 1 - r0 | Invert |
| -r0 | Negate |
| r0_bias | Bias - subtract 0.5 |
| r1+bx2 | Signed Scale - 2 * ( x - 0.5f ) |
| _x2 | double result |
| _x4 | quadruple result |
| _d2 | halve result |
| _sat | clamp < 0 to 0 and < 1 to 1 |
So far about the dry theory of pixel shader programming. Let's get to something more interesting.
- Previous page 2 Textures Per Clock Cycle, But 4...
- Next page Advances And Advantages Of The Pixel...
Ad
Google Ads
Ad
The Miscellaneous Articles and reviews
- Socket 5: Tuning Old PC Systems
- DDR For Pentium III - VIA's Apollo Pro 266 Chipset
- Late Vintage: High Degree of Maturity of the KT133
- Do-It-Yourself PC System: CPU & Motherboard
- SiS Back On Stage: The SiS730 Chipset for Duron and Athlon
- The Three Musketeers: Athlon Platforms For 133 MHz FSB
- Tom's Blurb: Pre-Christmas Blurb
- Head Two Head: Matrox Millennium G450
- Tom's Blurb: Pentium 4 - Another Recount?
- Tom's Favorite Gadget - The Nomad Jukebox from Creative
News
Reviews
Forum
- Looking for a high quality Camera Cell Phone
- K850
- cell phone radiation
- Sharing Cellphone Internet Access with 2 Laptops
- The iPhone, Many Hits, Few Misses
- Helpful: Share an easy way to rip DVD to MP4, AVI, MP3, WMV, WMA, FLV,
- How to rip DVD and convert video with only one converter
- Movies
- Guild Wars 2: In-House FAQ
- Movie Review - The X-Files: I Want to Believe
Related Content