RSD Export Plug-in for Blender

Downloadable items posted by PSXDEV members are within this forum.
User avatar
LameGuy64
Verified
Psy-Q Enthusiast
Psy-Q Enthusiast
Posts: 388
Joined: Apr 10, 2013
I am a: Hobbyist Game Developer
Motto: Commercial or not, play it!
PlayStation Model: H2000/7000
Location: Philippines
Contact:

RSD Export Plug-in for Blender

Post by LameGuy64 » March 18th, 2015, 12:05 am

UPDATE: Added link to latest RSD plug-in on Github!

Since using my PLY2RSD wasn't convenient enough for making nicer looking models for the PlayStation especially when multiple TIM files can't be assigned to a single model and mixing textured and untextured polygons in a single model mesh was a pain (UVs of all untextured polys must be exactly 0,0), I've decided to make something much more convenient and flexible to use and that is by making a custom export script for Blender.

This plug-in will allow you to export your models straight into RSDLINK compatible RSD format with all normals, vertex colors, UVs and texture assignments intact. One huge improvement of this plug-in over my PLY2RSD tool is that multiple textures can be assigned to any polygon individually which is a necessity for designing 3D 'world' models.

Here's an example of a simple 'world' model I made exported straight from Blender with vertex color shading and multiple textures (textures are from Ken Silverman's KenBuild test game):
Image

As a little note though, TMD files are not really suitable for handling world geometry since there seems to be no way to do far-clipping and performing active sub-divsion causes severe stability issues when rendering such models with the stock libgs TMD routines probably because there are too many polygons for the stock functions to handle. Instead, you'll have to make a custom renderer as demonstrated in my old 3D FPS example and a custom RSD linker as well.

Github repository to the most recent version of the plug-in:
https://github.com/Lameguy64/Blender-RSD-Plugin

The old plug-in can be downloaded here (24KB, Python script for Blender):
http://www.mediafire.com/view/otz5wyg2c ... ort_rsd.py

To install this plug-in, simply use the Install from File option in the add-ons tab in the Blender User Preferences dialog. The plug-in was initially made for Blender 2.69 but should work in newer versions of Blender and this plug-in was recently tested in 2.78c and it worked properly on that version.

If you encounter any issues or have useful suggestions, please let me know...
You do not have the required permissions to view the files attached to this post.
Last edited by LameGuy64 on December 12th, 2017, 12:14 am, edited 2 times in total.
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.

User avatar
Shadow
Verified
Admin / PSXDEV
Admin / PSXDEV
Posts: 2670
Joined: Dec 31, 2012
PlayStation Model: H2000/5502
Discord: Shadow^PSXDEV

Post by Shadow » March 18th, 2015, 12:45 am

Very, very nice work LameGuy.

*EDIT* LameGuy sent me his 3D DEMO, and with his permission, here is his "3D DEMO" as a bootable ISO :dance
:null:
3DDEMO.zip
You do not have the required permissions to view the files attached to this post.
Development Console: SCPH-5502 with 8MB RAM, MM3 Modchip, PAL 60 Colour Modification (for NTSC), PSIO Switch Board, DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.

PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.

User avatar
LameGuy64
Verified
Psy-Q Enthusiast
Psy-Q Enthusiast
Posts: 388
Joined: Apr 10, 2013
I am a: Hobbyist Game Developer
Motto: Commercial or not, play it!
PlayStation Model: H2000/7000
Location: Philippines
Contact:

Post by LameGuy64 » September 17th, 2015, 11:54 pm

I recently discovered a flaw in this exporter when it comes to exporting models that contain flat shaded faces where the normals of such faces will be incorrect which results to severe lighting problems of such faces. To remedy this, apply an Edge Split modifier to the model which should do the trick.

I'll eventually make an update of the export script so that flat shaded faces will be exported with correct normals even without the edge split modifier.
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.

User avatar
gwald
Verified
Net Yaroze Enthusiast
Net Yaroze Enthusiast
Posts: 282
Joined: Sep 18, 2013
I am a: programmer/DBA
PlayStation Model: Net Yaroze
Contact:

Post by gwald » January 31st, 2016, 10:29 pm

Hi,
This is impressive!! the plug in and the little demo :clap
As a little note though, TMD files are not really suitable for handling world geometry since there seems to be no way to do far-clipping and performing active sub-divsion causes severe stability issues...
So the demo is a single TMD?
It's small but runs well, maybe a sections of these would work.. i think tomb raid had sections/rooms also.
Not sure if they're single TMD's tho.
LameGuy64 wrote:I recently discovered a flaw in this exporter ....
Any update on the normal issue?
I'm no blender fan but i'll have to install it just for the plug in :dance


came across this:
neogeo.tar.gz
http://www.psxdev.net/forum/viewtopic.p ... wave#p4529
It's PSXDEV, I'm guess it was part of blender when it was console dev tool:
http://download.blender.org/source/ches ... on_engine/
Last edited by gwald on February 4th, 2016, 5:10 pm, edited 1 time in total.

User avatar
LameGuy64
Verified
Psy-Q Enthusiast
Psy-Q Enthusiast
Posts: 388
Joined: Apr 10, 2013
I am a: Hobbyist Game Developer
Motto: Commercial or not, play it!
PlayStation Model: H2000/7000
Location: Philippines
Contact:

Post by LameGuy64 » February 2nd, 2016, 12:53 am

gwald wrote: So the demo is a single TMD?
It's small but runs well, maybe a sections of these would work.. i think tomb raid had sections/rooms also.
Not sure if they're single TMD's tho.
Yeah, the entire world geometry was entirely just single TMD file. Slicing up a large world into pieces as multiple TMD files may work but I think you might eventually experience difficulties later down the line with that method. Most developers resort to writing their own renderers for rendering world geometry.
gwald wrote: Any update on the normal issue?
I'm no blender fan but i'll have to install it just for the plug in :dance
Well, I haven't touched much about my RSD exporter for a long while now but the normal problem can be easily fixed by adding an Edge Split modifier.
gwald wrote: came across this:
http://download.blender.org/source/chest/neogeo.tar.gz
It's PSXDEV, I'm guess it was part of blender when it was console dev tool:
http://download.blender.org/source/ches ... on_engine/
That seems very interesting, I may take a closer look into that in the future.
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.

User avatar
sickle
Verified
C Programming Expert
C Programming Expert
Posts: 257
Joined: Jul 17, 2013
I am a: Chocolate-fueled pug fetish robot.
Location: Scotland

Post by sickle » February 4th, 2016, 11:11 pm

Thanks for all your work on this and the other 3D demo btw man. Found it seriously useful to learn from.

Might sound weird, but I"m wondering if you've considered using Unity (with just an editor script) to generate worlds?
It's pretty handy to be able to tag things as different groups and compose a scene, then rattle through all the polys and export them however you want. (script took ~about an hour max). I'm finding it especially handy for exporting with precomputed collison data, etc :D

Anyhoo, thanks again for sharing this stuff ^^

Mills
Curious PSXDEV User
Curious PSXDEV User
Posts: 16
Joined: May 03, 2016

Post by Mills » May 3rd, 2016, 11:28 pm

LameGuy64 wrote:S I've decided to make something much more convenient and flexible to use and that is by making a custom export script for Blender...

...If you encounter any issues or have useful suggestions, please let me know...
HI! I tested your plugin and it is not working with last blender 2.76 :(.
EDIT: it suddenly worked... don't know why. BUT i could not convert the resulting RSD to TMD :(, rsdlink keeps failing "could not find model.ply".

Are you still working on this?. Is there a way to load the models instead of converting them to a c array?

It is awesome there is still a forum about PSX development, I have a PSP and i'd like to make some homebrews to test with the PSX emulator inside PSP, I wonder if the 640x480 mode works with the tv out mode, i'll try to test later.

EDIT: Mmm My PSP didn't load a sample I compiled with psy q. Does anybody know how to make the iso properly for PSP?

User avatar
LameGuy64
Verified
Psy-Q Enthusiast
Psy-Q Enthusiast
Posts: 388
Joined: Apr 10, 2013
I am a: Hobbyist Game Developer
Motto: Commercial or not, play it!
PlayStation Model: H2000/7000
Location: Philippines
Contact:

Post by LameGuy64 » May 4th, 2016, 6:36 pm

Mills wrote:
LameGuy64 wrote:S I've decided to make something much more convenient and flexible to use and that is by making a custom export script for Blender...

...If you encounter any issues or have useful suggestions, please let me know...
HI! I tested your plugin and it is not working with last blender 2.76 :(.
EDIT: it suddenly worked... don't know why. BUT i could not convert the resulting RSD to TMD :(, rsdlink keeps failing "could not find model.ply".

Are you still working on this?. Is there a way to load the models instead of converting them to a c array?

It is awesome there is still a forum about PSX development, I have a PSP and i'd like to make some homebrews to test with the PSX emulator inside PSP, I wonder if the 640x480 mode works with the tv out mode, i'll try to test later.

EDIT: Mmm My PSP didn't load a sample I compiled with psy q. Does anybody know how to make the iso properly for PSP?
First of, this plug-in produces an RSD file alongside PLY and MAT files which should be converted into a TMD with RSDLINK. You can find more info about this right here, just ignore the steps regarding DXF export and conversion.

To render a TMD model, see this example.

As for getting PSX ISOs working on a PSP, I remember doing that a couple of times a long time ago with a program that'll convert your PSX ISO into an EBOOT.PBP file but I forgot the name of that converter program I used. This should be of help for now.
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.

Mills
Curious PSXDEV User
Curious PSXDEV User
Posts: 16
Joined: May 03, 2016

Post by Mills » May 5th, 2016, 5:18 am

LameGuy64 wrote: To render a TMD model, see this example.
It is working great.
But i can't load textures, I UV map the object in blender, then I export to rsd... etc and the texture is not showing on the models. The ground object is showing the wrong texture as you see.

Image

Could you explain how to load an object with its textures for noobs? I think i forgot something in the process... :oops:

Thanks.

User avatar
gwald
Verified
Net Yaroze Enthusiast
Net Yaroze Enthusiast
Posts: 282
Joined: Sep 18, 2013
I am a: programmer/DBA
PlayStation Model: Net Yaroze
Contact:

Post by gwald » May 5th, 2016, 9:53 am

TMD doesn't store images.
Using timUtil, note the VRAM coords, then makes sure when rendering that TIM is in that same VRAM coord.
For TMD stuff, the Net Yaroze has it well documented, I don't know about psyq tho.

User avatar
LameGuy64
Verified
Psy-Q Enthusiast
Psy-Q Enthusiast
Posts: 388
Joined: Apr 10, 2013
I am a: Hobbyist Game Developer
Motto: Commercial or not, play it!
PlayStation Model: H2000/7000
Location: Philippines
Contact:

Post by LameGuy64 » May 5th, 2016, 5:01 pm

If you're dealing with a textured model, you must convert the texture image into a tim file (I recommend img2tim as it supports most image formats) and then position it to the appropriate VRAM offset (usually away from the display buffers) with TIMTOOL.

Once done, convert the RSD file to TMD with RSDLINK. Make sure your TIM file is placed in the same location as the RSD file you're converting.
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.

Mills
Curious PSXDEV User
Curious PSXDEV User
Posts: 16
Joined: May 03, 2016

Post by Mills » May 6th, 2016, 6:43 am

My first PS1 scene :)

Image

320x240. not bad...

User avatar
gwald
Verified
Net Yaroze Enthusiast
Net Yaroze Enthusiast
Posts: 282
Joined: Sep 18, 2013
I am a: programmer/DBA
PlayStation Model: Net Yaroze
Contact:

Post by gwald » May 6th, 2016, 9:46 am

Good work! :clap

User avatar
Shadow
Verified
Admin / PSXDEV
Admin / PSXDEV
Posts: 2670
Joined: Dec 31, 2012
PlayStation Model: H2000/5502
Discord: Shadow^PSXDEV

Post by Shadow » May 6th, 2016, 1:40 pm

Pretty cool! Nice work.
Development Console: SCPH-5502 with 8MB RAM, MM3 Modchip, PAL 60 Colour Modification (for NTSC), PSIO Switch Board, DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.

PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.

Mills
Curious PSXDEV User
Curious PSXDEV User
Posts: 16
Joined: May 03, 2016

Post by Mills » May 8th, 2016, 9:42 pm

LameGuy64 wrote:If you're dealing with a textured model...
I saw in your first image, you can render textured models, and they also have vertex colors.
My textured models are not showing the vertex colors when rendered on the ps1, what's missing?

More questions:

Is it possible for ps1 to scale the models in real time?
Can ps1 move texture coordinates to make a texture scroll over the object?
How could you render a multitexture model?
Is it possible to make enviroment mapped textures?

Thanks :)

I converted a scene from a game i'm making for PSP, I had to remake the planet, and convert the music to XM, the result is cool.

Image
You do not have the required permissions to view the files attached to this post.

User avatar
gwald
Verified
Net Yaroze Enthusiast
Net Yaroze Enthusiast
Posts: 282
Joined: Sep 18, 2013
I am a: programmer/DBA
PlayStation Model: Net Yaroze
Contact:

Post by gwald » May 9th, 2016, 9:57 am

My textured models are not showing the vertex colors when rendered on the ps1, what's missing?
Check the RSD in a text editor and see if it is a coloured vector.

Is it possible for ps1 to scale the models in real time?
Yes, just multiply the object by a matrix with your scale required, if your using TMD look at the GsDOBJ2 structure and scale/translate/rotate it there.

Can ps1 move texture coordinates to make a texture scroll over the object?
Yes, if your using TMD, you'ld have to study the format, and change the coords yourself in code, it that or swapping out TMD to display (you can do primitive animation this way).
Or the easier way, would be to just move the image using the very fast VRAM image GS lib MoveImage function.

How could you render a multitexture model?
I dont think it's possible, or can do it with the tricks above.

Is it possible to make enviroment mapped textures?
For reflections? I guess you'd have to sample the previous screen buffer (the one being displayed) and move it to your image coords

The PSX is pretty basic but it can do most things, within limits and if you can program them.
The TMD/Gs libs are pretty highlevel which means you'd be limited to what you can do, but it'll be a lot easier to program.

User avatar
Shadow
Verified
Admin / PSXDEV
Admin / PSXDEV
Posts: 2670
Joined: Dec 31, 2012
PlayStation Model: H2000/5502
Discord: Shadow^PSXDEV

Post by Shadow » May 9th, 2016, 4:25 pm

That is a very well done and detailed model. The texturing is impressive too. However, my only recommendation is to slow down the spinning of the planet and the background. It's spinning a little but too fast, and it's causing eye strain since I can't focus on an object placed on the planet for too long :)
Development Console: SCPH-5502 with 8MB RAM, MM3 Modchip, PAL 60 Colour Modification (for NTSC), PSIO Switch Board, DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.

PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.

Mills
Curious PSXDEV User
Curious PSXDEV User
Posts: 16
Joined: May 03, 2016

Post by Mills » May 10th, 2016, 12:58 am

gwald wrote: Check the RSD in a text editor and see if it is a coloured vector.
My RSD looks like this:

Code: Select all

# Created by Blender 2.76 (sub 0) - www.blender.org, source file: 'untitled.blend'
# Exported using PlayStation RSD plug-in by Jobert 'Lameguy' Villamor (Lameguy64/TheCodingBrony)

@RSD940102
PLY=title.ply
MAT=title.mat
NTEX=1
TEX[0]=t_tex.tim
Where is the coloured vector?.
gwald wrote: The PSX is pretty basic but it can do most things, within limits and if you can program them.
The TMD/Gs libs are pretty highlevel which means you'd be limited to what you can do, but it'll be a lot easier to program.
I want to use enviroment mapping to fake reflections, and the rest of the functions won't be very difficult to create using the sources from the TMD/Gs libs.
Shadow wrote: my only recommendation is to slow down the spinning of the planet and the background.
I'll do it :).

Thanks.

User avatar
LameGuy64
Verified
Psy-Q Enthusiast
Psy-Q Enthusiast
Posts: 388
Joined: Apr 10, 2013
I am a: Hobbyist Game Developer
Motto: Commercial or not, play it!
PlayStation Model: H2000/7000
Location: Philippines
Contact:

Post by LameGuy64 » May 10th, 2016, 1:25 am

Mills wrote: My textured models are not showing the vertex colors when rendered on the ps1, what's missing?
To get vertex colors working on textured polygons, you must check 'Colored Textured Faces' before exporting your model to RSD. However, light source calculation will be disabled on vertex colored textured polygons. This is because libgs does not support light source calculation on vertex colored textured faces if I remember correctly.
Mills wrote: Can ps1 move texture coordinates to make a texture scroll over the object?
Its possible but I myself don't really know how to do it with libgs... I'm not really familiar with how texture wrapping works on the PSX.
Mills wrote: How could you render a multitexture model?
You can specify multiple textures on a single TMD file which is done by specifying a different texture file on individual faces (as in, select the face you want to change texture and then set the texture file you want it to use). I know this in Blender 2.69 but I'm not sure about the newer versions.
Mills wrote: Is it possible to make enviroment mapped textures?
It can be done but it'll be very tricky and I have yet to explore on how to achieve such an effect. If I can do cel-shading on the PSX, environment mapping should be possible and some games even feature that effect.

Also, that's some really nice PSP to PSX homebrew conversion you got there btw!
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.

Mills
Curious PSXDEV User
Curious PSXDEV User
Posts: 16
Joined: May 03, 2016

Post by Mills » May 10th, 2016, 2:28 am

Thanks LameGuy64, Do you know if there is a function to read files from the cd in psy q?.
I mean, not converting the TMD with bin2h and including it in main.exe, but loading it from outside, like fread or fopen.

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests