I am trying to start studying this project and have made an experimental branch https://github.com/meisei4/ps2gl/blob/experimentation_only (not planning to request merge, I just have it for studying so far) and I am finding some issues with Color behavior quite a lot.
I know that from this Issue: #11, the fix has been to add to the examples ColorMaterial enabling and Lighting as well, but I am trying to figure out how to get things working without Lighting or Material.
Lesson05 Behavior
I was able to get lesson05 working to what I think is expected to show up (but it still requiring lighting and material though):
Current main branch behavior: 
Where two things happen:
-
The Colors for the quad based cube are not set at a per face basis like they seem to be intended to (instead they are only attached per vertex, where unlike the Normals and Texcoords, there is no filling of the per vertex colors via any GetCurColor (something i will bring up later, and have tried to reconcile with CurMatColor, and CurGeomColor in some experiments i have added <- this is likely only introducing more complexity though compared to how i think OpenGL would expect this to work).
-
After enough time the rotations result in the per vertex colors completely fading to black because they depend on the lighting.
Experiments fork
Here is my fork’s result after updating the two issues to allow for updating the Colors at a per vertex basis (still trying to figure out if this should be on Material or if it’s better as an actual Geometry attribute... it seems to cause issues with other tests like lesson02).
Code changes involve:
intended Examples
I have also added two examples that I am trying to get working:
The unlit version relies on a very poor attempt at working backwards from general_pvc_diff_tri_vcl.vsm to make this microcode:
https://github.com/meisei4/ps2gl/blob/experimentation_only/vu1/proper_nolights_pv_color_vcl.vsm
That aims to get the RGBA data to just pass through without any lighting instructions. I spent a little bit too much time on this and kind of gave up because I am hoping I can be pointed towards better VCL tools... (or even any vsm examples that cover the most simple way to diagnose what registers are set up for RGBA when its a pass through and then also just how kInputQPerV works with the ordering of lanes when XferColors, XferNormals and everything is being passed
As you can see in the result, I am able to get Vertex data through, it is just that the Registers for loading in the correct RGBA data seem to be scrambling or reading from the wrong lanes or something and alignment is all wrong.
Contribution Interest
I would really like to help contribute to this project in light of the potential it has for raylib interfacing, but I am having trouble with the approach here and whether or not VU1 should be how this GL layer is done.
I will provide some links of the resources I have found just for documenting myself below (some I have tried, e.g. VCL Linux compiler, but having no luck with getting it to work, and it seems like many ps2sdk libraries no longer use VU microcode to draw things anymore).
Resources
very dense ps2 documentation: * http://lukasz.dk/playstation-2-programming/an-introduction-to-ps2dev/
I hope to come back to this, but I believe that I need to take a break and am hoping for potential review of the locations in the code I am trying to experiment with, to get any insight as to what the main design is intended to be here and what is the best way to begin reviving this project.
I am trying to start studying this project and have made an experimental branch https://github.com/meisei4/ps2gl/blob/experimentation_only (not planning to request merge, I just have it for studying so far) and I am finding some issues with
Colorbehavior quite a lot.I know that from this Issue: #11, the fix has been to add to the examples
ColorMaterialenabling andLightingas well, but I am trying to figure out how to get things working withoutLightingorMaterial.Lesson05 Behavior
I was able to get
lesson05working to what I think is expected to show up (but it still requiring lighting and material though):Current main branch behavior:
Where two things happen:
The
Colorsfor the quad based cube are not set at a per face basis like they seem to be intended to (instead they are only attached per vertex, where unlike theNormalsandTexcoords, there is no filling of the per vertex colors via anyGetCurColor(something i will bring up later, and have tried to reconcile withCurMatColor, andCurGeomColorin some experiments i have added <- this is likely only introducing more complexity though compared to how i think OpenGL would expect this to work).Texcoordsdoes it:https://github.com/ps2dev/ps2gl/blob/master/src/base_renderer.cpp#L167
After enough time the rotations result in the per vertex colors completely fading to black because they depend on the lighting.
Normalsas they rotate (documented in comments where this happens, and how i understand it to work:https://github.com/meisei4/ps2gl/blob/experimentation_only/src/gmanager.cpp#L50)Experiments fork
Here is my fork’s result after updating the two issues to allow for updating the
Colorsat a per vertex basis (still trying to figure out if this should be onMaterialor if it’s better as an actualGeometryattribute... it seems to cause issues with other tests likelesson02).Code changes involve:
Normals:https://github.com/meisei4/ps2gl/blob/experimentation_only/examples/nehe/lesson05/lesson5.cpp#L50
ImmgManager, trying to correct the wayColorsare being added, such that it follows the pattern ofTexcoordsandNormalsmore closely (from my understanding this is how OpenGL would be doing it, rather than only storingColorsas aMaterialattribute...):https://github.com/meisei4/ps2gl/blob/experimentation_only/src/immgmanager.cpp#L123
intended Examples
I have also added two examples that I am trying to get working:
PVC lit:
https://github.com/meisei4/ps2gl/blob/experimentation_only/examples/box/lit_pvc_box.cpp
Corresponding unlit version:
https://github.com/meisei4/ps2gl/blob/experimentation_only/examples/box/unlit_pvc_box.cpp
The unlit version relies on a very poor attempt at working backwards from
general_pvc_diff_tri_vcl.vsmto make this microcode:https://github.com/meisei4/ps2gl/blob/experimentation_only/vu1/proper_nolights_pv_color_vcl.vsm
That aims to get the RGBA data to just pass through without any lighting instructions. I spent a little bit too much time on this and kind of gave up because I am hoping I can be pointed towards better VCL tools... (or even any vsm examples that cover the most simple way to diagnose what registers are set up for RGBA when its a pass through and then also just how
kInputQPerVworks with the ordering of lanes whenXferColors,XferNormalsand everything is being passedAs you can see in the result, I am able to get
Vertexdata through, it is just that the Registers for loading in the correct RGBA data seem to be scrambling or reading from the wrong lanes or something and alignment is all wrong.Contribution Interest
I would really like to help contribute to this project in light of the potential it has for raylib interfacing, but I am having trouble with the approach here and whether or not VU1 should be how this GL layer is done.
I will provide some links of the resources I have found just for documenting myself below (some I have tried, e.g. VCL Linux compiler, but having no luck with getting it to work, and it seems like many ps2sdk libraries no longer use VU microcode to draw things anymore).
Resources
very dense ps2 documentation: * http://lukasz.dk/playstation-2-programming/an-introduction-to-ps2dev/
(even the core ps2sdk draw examples do not demonstrate any simple PVC non-lighting, non-textured rendering... * https://github.com/ps2dev/ps2sdk/tree/master/ee/draw/samples
lua abstraction layer for potential inspiration * https://github.com/DanielSant0s/Enceladus
I hope to come back to this, but I believe that I need to take a break and am hoping for potential review of the locations in the code I am trying to experiment with, to get any insight as to what the main design is intended to be here and what is the best way to begin reviving this project.