Page 1 of 2

RSD Export Plug-in for Blender

Posted: March 18th, 2015, 12:05 am
by LameGuy64
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...

Re: RSD Export Plug-in for Blender

Posted: March 18th, 2015, 12:45 am
by Shadow
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

Re: RSD Export Plug-in for Blender

Posted: September 17th, 2015, 11:54 pm
by LameGuy64
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.

Re: RSD Export Plug-in for Blender

Posted: January 31st, 2016, 10:29 pm
by gwald
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/

Re: RSD Export Plug-in for Blender

Posted: February 2nd, 2016, 12:53 am
by LameGuy64
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.

Re: RSD Export Plug-in for Blender

Posted: February 4th, 2016, 11:11 pm
by sickle
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 ^^

Re: RSD Export Plug-in for Blender

Posted: May 3rd, 2016, 11:28 pm
by Mills
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?

Re: RSD Export Plug-in for Blender

Posted: May 4th, 2016, 6:36 pm
by LameGuy64
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.

Re: RSD Export Plug-in for Blender

Posted: May 5th, 2016, 5:18 am
by Mills
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.

Re: RSD Export Plug-in for Blender

Posted: May 5th, 2016, 9:53 am
by gwald
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.

Re: RSD Export Plug-in for Blender

Posted: May 5th, 2016, 5:01 pm
by LameGuy64
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.

Re: RSD Export Plug-in for Blender

Posted: May 6th, 2016, 6:43 am
by Mills
My first PS1 scene :)

Image

320x240. not bad...

Re: RSD Export Plug-in for Blender

Posted: May 6th, 2016, 9:46 am
by gwald
Good work! :clap

Re: RSD Export Plug-in for Blender

Posted: May 6th, 2016, 1:40 pm
by Shadow
Pretty cool! Nice work.

Re: RSD Export Plug-in for Blender

Posted: May 8th, 2016, 9:42 pm
by Mills
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

Re: RSD Export Plug-in for Blender

Posted: May 9th, 2016, 9:57 am
by gwald
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.

Re: RSD Export Plug-in for Blender

Posted: May 9th, 2016, 4:25 pm
by Shadow
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 :)

Re: RSD Export Plug-in for Blender

Posted: May 10th, 2016, 12:58 am
by Mills
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.

Re: RSD Export Plug-in for Blender

Posted: May 10th, 2016, 1:25 am
by LameGuy64
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!

Re: RSD Export Plug-in for Blender

Posted: May 10th, 2016, 2:28 am
by Mills
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.