반응형

CommitChanges 




현재 테크닉에서 ID3DXEffect::BeginPass/ID3DXEffect::EndPass  가 매칭되는 내부에서  ID3DXEffect::Set~ 함수를 쓰지 않았다면


ID3DXEffect::CommitChanges 를 할필요가 없고 BeginPass,  EndPass 내부에서 ID3DXEffect::Set~ 함수가 쓰인다면 



ID3DXEffect::CommitChanges   ID3DXEffect::BeginPass/ID3DXEffect::EndPass 이 매칭되는 사이에 반드시 호출해야하는데

반드시 DrawxPrimitive 호출하기 전에 ID3DXEffect::CommitChanges 를 호출해야 한다


안에 쓰는것과 밖에 쓰는것은 좀 다른데 밖에쓰면 상관없지만 내부에다 쓰면 공유되는 상태가 되어 다음에까지 영향을 미친다



- 아래는 Direct SDK 에서 발췌한 내용이다






Remarks

If the application changes any effect state using any of the ID3DXEffect::Setx methods inside of an ID3DXEffect::BeginPass/ID3DXEffect::EndPass matching pair, the application must call ID3DXEffect::CommitChanges before any DrawxPrimitive call to propagate state changes to the device before rendering. If no state changes occur within a ID3DXEffect::BeginPass and ID3DXEffect::EndPass matching pair, it is not necessary to call ID3DXEffect::CommitChanges.


This is slightly different for any shared parameters in a cloned effect. When a technique is active on a cloned effect (that is, when ID3DXEffect::Begin has been called but and ID3DXEffect::End has not been called), ID3DXEffect::CommitChanges updates parameters that are not shared as expected. To update a shared parameter (only for a cloned effect whose technique is active), call ID3DXEffect::End to deactivate the technique and ID3DXEffect::Begin to reactivate the technique before calling ID3DXEffect::CommitChanges.





    // Using current technique

    // Begin           starts active technique

    // BeginPass       begins a pass

    // CommitChanges   updates changes to any set calls in the pass. This should be called before any DrawPrimitive call to d3d

    // EndPass         ends a pass

    // End             ends active technique


이건  에 대한 d3dx9effect.h 에 있는 설명 에 있다


반응형

'그래픽스(Graphics) > DirectX9~12' 카테고리의 다른 글

간략한 파티클 시스템  (0) 2013.01.31
파티클 간단한 렌더링  (0) 2013.01.31
Effect::CommitChanges()  (0) 2013.01.25
모션 블러(Motion Blur)  (0) 2013.01.25
인스턴싱 (Instancing)  (1) 2013.01.25

+ Recent posts