Re: DXSDK Doc's Optimization Technique

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Eyal Teler (et_at_nospam-et3d.com)
Date: 06/29/04


Date: Tue, 29 Jun 2004 13:26:52 +0200

The reason it's useful to pre-multiply for shaders is if you just want
to multiply by several transforms one after the other (with no other
processing between) there's no reason to do it per vertex.

        Eyal

d000hg wrote:
> That's what I always figured - D3D must just multiply them anyway for the fixed pipeline. Is there likely to be much penalty for an extra matrix parameter passed to a shader - that's the only factor I presume - passing more information in?
>
> "Eyal Teler" wrote:
>
>
>>I agree that it seems unnecessary for the fixed function pipeline. If
>>it produces any gain, it should be very minor. Only in the case of
>>vertex shaders is it useful to pre-multiply these matrices, if the
>>shader doesn't need them separate.
>>
>> Eyal
>>
>>M Owais Khan wrote:
>>
>>>Hi,
>>> I've read the following snippet from DXSDK tutorial on "World
>>>Transformation".I've implemented this technique using 2 D3DMATRIX16
>>>variables for View Matrix.One is used to hold Identity Matrix values
>>>and other holds current View Matrix which keeps changing as i move my
>>>camera.Please,Review this technique.It seems to me no optimization at
>>>all.Or i've headed in the wrong direction.
>>>Thanks,
>>>Owais.
>>>
>>>>From DXSDK Docs.
>>>
>>>Note Direct3D uses the world and view matrices that you set to
>>>configure several internal data structures. Each time you set a new
>>>world or view matrix, the system recalculates the associated internal
>>>structures. Setting these matrices frequently—for example, thousands
>>>of times per frame—is computationally time-consuming. You can minimize
>>>the number of required calculations by concatenating your world and
>>>view matrices into a world-view matrix that you set as the world
>>>matrix, and then setting the view matrix to the identity. Keep cached
>>>copies of individual world and view matrices so that you can modify,
>>>concatenate,and reset the world matrix as needed. For clarity, in this
>>>documentation Direct3D samples rarely employ this optimization.
>>



Relevant Pages

  • Re: Determining which skinning Method to use
    ... The main reason is that fixed function skinning is limited to 4 ... I have no idea why that is, although the reason I suggested shaders ...
    (microsoft.public.win32.programmer.directx.graphics)
  • Re: glColor
    ... I avoid using shaders when there's no need to do so, ... On SM>=3 capable hardware you can bet, ... The reason I don't use shaders unless I ... John Tsiombikas ...
    (comp.graphics.api.opengl)
  • Re: SRs velocity addition -- ANY Experimental Evidence?
    ... |>>to observe Galilean symmetry, since we do, your point isn't made. ... Mapping k -> K ... Thus I observe the Galilean Transforms to be symmetric. ...
    (sci.physics)
  • Re: SRs velocity addition -- ANY Experimental Evidence?
    ... |>>to observe Galilean symmetry, since we do, your point isn't made. ... Mapping k -> K ... Thus I observe the Galilean Transforms to be symmetric. ...
    (sci.physics.relativity)
  • Re: Diverging Opinions on Physics Foundations
    ... Arnold Neumaier, when it was actually directed to Perspicacious. ... things from gallilian transforms, k should be zero. ... that reason is, other than saying "by throwing some number in somewhere, ...
    (sci.physics.research)