LMP3D 3D Library for Dreamcast, PS2, PS1

Start a log and update it occasionally with your projects progress
Post Reply
Kannagi
Interested PSXDEV User
Interested PSXDEV User
Posts: 6
Joined: April 30th, 2018, 12:58 am
I am a: Retro-Programmer
PlayStation Model: SCPH-7502
Location: France

LMP3D 3D Library for Dreamcast, PS2, PS1

Post by Kannagi » April 30th, 2018, 1:36 am

Hello,I will talk here mainly about the PSX version.

This lib uses PSXSDK, I have not yet been tested on the real hardware, emulator indicates me between 2000-3200 triangles max (but I have not really optimized the rendered part).

It's an alpha version for the moment, you could not make a game with it.

I think I will do 4 functions for 2D :
-Sprite
-Sprite_Array
-Text
-TileMap

For the 3d, I think to put the animation by skeleton and some optimization like "Viewing frustum culling" and "Contribution culling" (it will be possible to enable/disable).

Screen :
Image

LMP3D Demo:
https://www.youtube.com/watch?v=AEwg1k-KOf4

PSX Demo :
https://www.youtube.com/watch?v=GMi-hJxRsLU
As I mentioned on my last video, I have long had perspective bug using the GTE.

The code works on Windows, Linux, PS1 / PS2,DC.
For each platform I manage the appropriate conversions floating / fixed number, a small idea of what format is optimized for each platform:
PC: floating point number, index
PS1: fixed number, no index
PS2: fixed number, index + submesh
DC: floating point number, index

I create a converter (internal) that converts the images into the appropriate format, here are the recommended formats:
PS1, PS2: PCX
DC: PNG or VQ compressed
PC: PNG

For the PS1, I will advise to use textures of 128x256 in PCX format, it will put about 16 textures, you can put another image in 4bpp (for hud or other).

For 3D format, I use my own format, a converter exists here : https://github.com/Kannagi/BCMConvert
The source code : https://github.com/Kannagi/LMP3D

Thanks for reading me ! :)

User avatar
Shadow
Admin / PSXDEV
Admin / PSXDEV
Posts: 2176
Joined: December 31st, 2012, 5:37 pm
PlayStation Model: H2000/5502

Re: LMP3D 3D Library for Dreamcast, PS2, PS1

Post by Shadow » April 30th, 2018, 12:18 pm

My gosh that is impressive. Excellent work! Can't wait to see how this progresses :)
Development Console: SCPH-5502 with 8MB RAM, MM3 Modchip, PAL 60 Colour Modification (for NTSC), DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.

Development Computer: Windows 98, Pentium 3 [400MHz], 128MB SDRAM, DTL-H2000, DTL-H201A, 21" Sony Trinitron CRT, CD-ROM burner, 3.25" and 5.25" Floppy Diskette Drives and a ZIP 100 Diskette Drive.

Kannagi
Interested PSXDEV User
Interested PSXDEV User
Posts: 6
Joined: April 30th, 2018, 12:58 am
I am a: Retro-Programmer
PlayStation Model: SCPH-7502
Location: France

Re: LMP3D 3D Library for Dreamcast, PS2, PS1

Post by Kannagi » May 1st, 2018, 3:56 am

Thank you, but it will be a bit long, I have a lot of details to finish.
I hope to finish a stable version soon enough! ;)

Xavi92
C Programming Expert
C Programming Expert
Posts: 118
Joined: October 6th, 2012, 12:53 am

Re: LMP3D 3D Library for Dreamcast, PS2, PS1

Post by Xavi92 » May 1st, 2018, 10:25 pm

You already know my opinion about this. You are awesome!!

Kannagi
Interested PSXDEV User
Interested PSXDEV User
Posts: 6
Joined: April 30th, 2018, 12:58 am
I am a: Retro-Programmer
PlayStation Model: SCPH-7502
Location: France

Re: LMP3D 3D Library for Dreamcast, PS2, PS1

Post by Kannagi » May 13th, 2018, 4:39 am

Thank you, I hope you will be a user of my new lib ;)

Well, I have news since :)

I finally add my 2D functions, do 4 times the same code in a slightly different way is a bit painful.
This results in:
Image

It took me a lot of time because I wanted to manage the 8bpp / 4bpp for each platform.
The Dreamcast is quite limited on this point, it only manages 1024 levels of color palette (say that the compression is not really at this level).
On PC 8bpp converted to RGBA (but if you use effects on the palette it will not work on PC ah ah xD).

I add the Backface culling on PS1, PC and Dreamcast.
On Dreamcast, there is no cross product in hardware, I made 2 inner products + subtraction :p

I hope to quickly finish the management of the Camera.
The 'Viewing frustum culling' will be easy to do, I already have my 3D box.

I have not updated for Github yet,I think I will compile the library for each platform, I will update the source code later.
So I think I'm close to a stable version, when it will be the case will remain that the Skeletal animation ^^

I made a video :
https://youtu.be/yobIrC6U320

Kannagi
Interested PSXDEV User
Interested PSXDEV User
Posts: 6
Joined: April 30th, 2018, 12:58 am
I am a: Retro-Programmer
PlayStation Model: SCPH-7502
Location: France

Re: LMP3D 3D Library for Dreamcast, PS2, PS1

Post by Kannagi » September 23rd, 2018, 10:29 pm

I was pretty busy, not big news (except that the code is cleaner and consistent), unfortunately I don't intend to advance the PS1 version because doing 3D on it is quite painful (matrix3x3, no Zbuffer, fixed point etc etc).

But if one of you has a little knowledge of 3D and uses PSXSDK then I would be happy to see you as a future contributor;)

This will allow me to focus on the Gamecube / Wii version ^^

User avatar
LameGuy64
Psy-Q Enthusiast
Psy-Q Enthusiast
Posts: 309
Joined: April 10th, 2013, 3:47 pm
I am a: Hobbyist Game Developer
Motto: Commercial or not, play it!
PlayStation Model: H2000/7000
Skype: lameguy64
Location: Philippines

Re: LMP3D 3D Library for Dreamcast, PS2, PS1

Post by LameGuy64 » September 25th, 2018, 12:26 pm

I have a lot of experience regarding 3D graphics programming on the PS1 but I only work with the Programmers Tool/PsyQ SDK which I think you'd be too squeamish to use in your project. I've been occasionally tinkering with writing my own SDK based on GCC that has support for calling console BIOS functions and even wrote my own ELF to PS-EXE converter that doesn't suck (because PSXSDK's elf2exe never works for me) but I've been busy with other things.
Please don't forget to include my name if you share my work around. Credit where it is due.

Dev. Console: SCPH-7000 with SCPH-7501 ROM, MM3, PAL color fix, Direct AV ports, DB-9 port for Serial I/O, and a Xplorer FX with Caetla 0.35.

DTL-H2000 PC: Dell Optiplex GX110, Windows 98SE & Windows XP, Pentium III 933MHz, 384MB SDRAM, ATI Radeon 7000 VE 64MB, Soundblaster Audigy, 40GB Seagate HDD, Hitachi Lite-on CD-RW Drive, ZIP 250 and 3.5" Floppy.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests