Linux for PlayStation 2 Community - Forums


Summary |  Home Page |  Forums |  Lists |  Tasks |  Docs |  Surveys |  News |  Files | 

Discussion Forums: Developers

Admin

Message: 50634
BY: panther
DATE: 2007-Nov-04 13:32
SUBJECT: Sky Box in sps2demo

Hi sorry to keep asking questions like this :/

i thought this would be a nice feature to add to the framework, give sceenes that bit more realism. and since its already been implemented once, would be quite easy for me to port accross.

This was the original code from the api Henry Fortuna developed.

VIFDynamicDMA.StartDirect();
VIFDynamicDMA.StartAD();
VIFDynamicDMA.AddAD(TEST_SET(0, 0, 0, 0, 0, 0, 0, 1), TEST_1);
VIFDynamicDMA.EndAD();
VIFDynamicDMA.EndDirect();

Matrix4x4 matSkyBox;
matSkyBox = Matrix4x4::IDENTITY;
Vector4 SkyBoxPosition = Pipeline.GetCameraPosition();

matSkyBox(3,0) = SkyBoxPosition.x;
matSkyBox(3,1) = SkyBoxPosition.y;
matSkyBox(3,2) = SkyBoxPosition.z;

globe.SetWorldMatrix(matSkyBox);
globe.Render();

VIFDynamicDMA.StartDirect();
VIFDynamicDMA.StartAD();
VIFDynamicDMA.AddAD(TEST_SET(0, 0, 0, 0, 0, 0, 1, 3), TEST_1);
VIFDynamicDMA.EndAD();
VIFDynamicDMA.EndDirect();

This is the modified code ive got so far for running in the sps2demo framework, ive added the includes "regdefines.h" and "dma.h" to main.cpp, to get it to compile, i also added <linux/ps2/dev.h>, but that returned an error
:

dynDma.startDirect();
dynDma.startAD();
dynDma.addAD(TEST_SET(0, 0, 0, 0, 0, 0, 0, 1), TEST_1);
dynDma.endAD();
dynDma.endDirect();

skydome.render(mat);

dynDma.startDirect();
dynDma.startAD();
dynDma.addAD(TEST_SET(0, 0, 0, 0, 0, 0, 1, 3), TEST_1);
dynDma.endAD();
dynDma.endDirect();

It compiles fine like this, but the strange thing is that the skydome model renders exactly the same as the rest in the scene, iam not noticing any sign of it remaining in infinate Z, as if TEST_SET is having no effect.

Ive also had no luck so far in getting the model connected to the camera movement.

I can work without a skybox so its not essential i get this to function, but its a nice thing to have in a high fidelity environment, and seems extreemly easy to implement for someone who actualy knew what they were doing :)

Yeah so any help on this would be great, if it is indeed to much trouble its not such a big problem.
Thanks.








 

Thread View

Thread Author Date
Sky Box in sps2demopanther2007-Nov-04 13:32
      RE: Sky Box in sps2demosparky2007-Nov-06 06:38
            RE: Sky Box in sps2demopanther2007-Nov-07 00:16
                  RE: Sky Box in sps2demosparky2007-Nov-07 07:59
                        memory allocationpanther2007-Nov-07 22:57
                              RE: memory allocationsparky2007-Nov-08 02:02
                              RE: memory allocationaik69802007-Nov-21 10:18

 

Post a followup to this message

You could post if you were [logged in]