Texture-blending operations.

Started by
4 comments, last by Barn Door 21 years, 5 months ago
Hi there, Are there any intuitive explanations for what the different texture-blending operations do? For example, what is the difference between using D3DTOP_MODULATE & D3DTOP_ADD? The first of these multiplies the two arguments together whilst the second just adds them but do these operations have a higher level, graphics specific meaning? Cheers, BD.
Advertisement
quote:them but do these operations have a higher level, graphics specific meaning?


Not really. Just think of anything in the colour channel as (conceptually) being like a 3D vector with components (r,g,b aka x,y,z) which range from 0 to 1 and get clamped after any operation (1+1=1, 0-1=0). The alpha channel is the same except its a scalar.

What might be thought of as higher level meanings is seeing the operations as just maths operators in an equation - that''s how you find interesting ways to reorganise operations to make more effective use of blend operations you have available and how things like DOT3 bump mapping starts to make sense.

The best way to learn this stuff is to use something which lets you play around with the blends such as ATIs Multex, nVidias BlendView or the tool in the DX SDK. Also get used to writing out any operations you want on a pixel as an equation:

OUTrgb = (TEXTURErgb * DIFFUSErgb) + ENVMAPrgb

[*]<br><br>Using simple maths rules such as commutativity and bracket precedence etc you can reorganise stuff easily.<br> <br><br>–<br>Simon O''Connor<br>Creative Asylum Ltd<br><A HREF="http://www.creative-asylum.com">www.creative-asylum.com</A>

Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

I don''t have the book with me, but the Focus on: 2D in Direct3D covers everyone in good detail. Just thought you should know.

Much greatness is achieved thru perseverance and faith.
Much greatness is achieved thru perseverance and faith.
Thanks for the replies.

That book ''Focus On 2D in Direct3D'' looks quite comprehensive.

Pity I vowed to stop buying big expensive computer books.

BD.
O.K. I tried running Nvidia's Blend View and it just quits and shows a message box which says...

DirectX Error: Can't create DDraw during enumeration!.
Error: DDERR_CANTCREATEDC


Apparently this program is for DirectX7. I tried installing this but it said I didn't need to because its earlier than the version already installed.

Any ideas? This program looks super cool.

BD.

[edited by - Barn Door on November 4, 2002 9:01:14 PM]
The version of BlendView I have didn''t come with an installer IIRC. Though it may be an ancient one (v0.90). Although it is from the DX7 days, most of the fixed function pixel blending pipe hasn''t changed in newer versions.

Just tried it on my work machine (P4, Win2k, GeForce2 Ultra, DirectX 8.1) and it worked fine.

It''s probably worth contacting one of the nVidia devrel people (Doug, Cem etc) - they''re usually quite helpful with things like this.

--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com

Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

This topic is closed to new replies.

Advertisement