Re: DXSDK Doc's Optimization Technique
From: Eyal Teler (et_at_nospam-et3d.com)
Date: 06/29/04
- Next message: Eyal Teler: "Re: Care to recommend a multi-head graphics card...?"
- Previous message: d000hg: "Care to recommend a multi-head graphics card...?"
- In reply to: d000hg: "Re: DXSDK Doc's Optimization Technique"
- Messages sorted by: [ date ] [ thread ]
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.
>>
- Next message: Eyal Teler: "Re: Care to recommend a multi-head graphics card...?"
- Previous message: d000hg: "Care to recommend a multi-head graphics card...?"
- In reply to: d000hg: "Re: DXSDK Doc's Optimization Technique"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|