BY: aik6980 DATE: 2007-Nov-10 08:09 SUBJECT: 2 different vu1 mpg at runtimei got the problem when i try to upload different vu mpgs at runtime, it clashes the ps2
i have some different vu code which need to upload for rendering different model, as terrain
, 3d animated model.
firstly, i tested rendering each of them on their own, the application works fine.
secondly, i tested rendering more than one model, with different vu code but same vumem's data struture (same base, same offset), the application still works fine.
the problem's happened when i try to render more than one model with each of them has a different vu mpg and different vumen's structure (different base, offset),
my ps2 clashes.
I think the problem is about some kind of the syncronization.
I try to add (FLUSH) command in every upload processes, this still no good.
could anyone give me any suggestion? all models use Quadbuffering technique
here's some of my code,
this is the main render loop
================================
// there's flush in the following func
gVu1mpg->Upload();
// there's flush in the following func
gTerrain.Render();
KMatrixTranslation(&T,10,-10,-20);
W = T;
WVP = W * VPMat;
VIFDynamicDMA.Add32(FLUSH);
VIFDynamicDMA.AddUnpack(V4_32, 4, 5);
VIFDynamicDMA.AddVector(gVPScaleVec);
VIFDynamicDMA.AddMatrix(WVP);
// there's flush in the following func
gMesh.Render();
KMatrixTranslation(&T,0,-10,-15);
W = T;
WVP = W * VPMat;
VIFDynamicDMA.Add32(FLUSH);
VIFDynamicDMA.AddUnpack(V4_32, 4, 5);
VIFDynamicDMA.AddVector(gVPScaleVec);
VIFDynamicDMA.AddMatrix(WVP);
// there's flush in the following func
gVu1skinedmesh->Upload();
// there's flush in the following func
gSkinedMesh.Render();
SPS2Manager.EndScene();
============================================
|