Author Topic: Virtua Skimmer  (Read 243 times)

XL2

  • Full Member
  • ***
  • Posts: 210
  • Karma: +45/-0
    • View Profile
Re: Virtua Skimmer
« Reply #15 on: May 17, 2018, 09:35:28 pm »
You can easily put one light source per model, but not more.
SGL can only register one source.
The way around this would be to not use SGL, or maybe it's possible to use offsets, but I don't know.
I might compute lights offline for static lights, which should allow much better colors.
Maybe you could then use the SCU DSP to calculate the additions/substraction on top of static lights, but I think it would be slow.

I already tried with colors, it's super easy.
For this demo, I'm using "semi white", but you can put any color you want.

It's already using the 2 CPUs. As soon as you call slPutPolygon, it will look to see if the slave is busy, and if not it will transfer the command so that the slave handles everything.


ponut64

  • Newbie
  • *
  • Posts: 42
  • Karma: +6/-0
    • View Profile
Re: Virtua Skimmer
« Reply #16 on: May 18, 2018, 12:04:32 am »
I am just going to comment on how immensely forward-thinking Sega was with how intelligently ... multi-threaded? SGL was for the mid-90's.
I was keen to insist on the gouraud shading being done on the slave since I want the master free for my undoubtedly immensely sloppy game code, but I guess Sega was looking after lesser experienced 3rd party devs like me after all.

XL2

  • Full Member
  • ***
  • Posts: 210
  • Karma: +45/-0
    • View Profile
Re: Virtua Skimmer
« Reply #17 on: May 18, 2018, 12:08:25 am »
Yes, you don't need to worry too much about the slave CPU, you can use it for maybe one function as the main CPU retrieves controls and stuff like that, but otherwise it's mostly for 3D rendering.
But they didn't make use of the SCU DSP at all!
Most devs agreed that it was great for lightning calculations

SkimmingSanshiro

  • Newbie
  • *
  • Posts: 15
  • Karma: +2/-0
    • View Profile
Re: Virtua Skimmer
« Reply #18 on: May 18, 2018, 06:27:02 am »
So im getting along pretty well porting my game over the your engine. Turns out taking all the .h files out solved the problem. sltranslate doesn't seem to translate the mesh anywhere though? For example

slTranslate(100, 20, 50);

Is the same as any other combination

Code: [Select]
slPushMatrix();
    {
        slTranslate(100, 20, 50);
        slRotX(sonic_rot_x );
slRotY(sonic_rot_y );
slRotZ(sonic_rot_z );
        computeLight();

        display_model(&entities[0], 1);
       

    }
    slPopMatrix();

XL2

  • Full Member
  • ***
  • Posts: 210
  • Karma: +45/-0
    • View Profile
Re: Virtua Skimmer
« Reply #19 on: May 18, 2018, 11:57:16 am »
You forgot to do "toFIXED". You can also do something like (150 <<16). The Jo Engine function does it. But I recommand you only use fixed values for more precision (I'm not sure if the newer Jo engine versions -which uses fixed values - has sin/cos tables for them - if it does, you can use it also).
« Last Edit: May 18, 2018, 05:22:19 pm by XL2 »

ponut64

  • Newbie
  • *
  • Posts: 42
  • Karma: +6/-0
    • View Profile
Re: Virtua Skimmer
« Reply #20 on: May 18, 2018, 04:39:12 pm »
At some point a new thread in the "shared code" section should be made about this converter. Though I see there's a bit more activity on segaxtreme than there is here.

Regardless, how do you export your OBJs? I can use the model converter on your Sonic file errorless, even changing the textures (with new ones), and it converts and displays properly.
If I use my own model, it converts fine (no errors) but it does not display. I ask about how you export your OBJs (or handle the models?) because I can import your OBJ file into Blender and then re-export it, at which point if I use the model converter on it again (using either my settings or Blender default), it does not display. Using my demo or yours, and your demo polycount correctly reports with the non-displayed models that there's no polygons happening.

The textures DO load, to the best of my knowledge, as the converter gives information about them (size 8x1, depth around 2800, RLE 2) and states they are written into the file and your demo pauses and states loading textures from that. Must be about my OBJ file.

I'm using Blender 2.78a.

/e: One last thing. Any chance of loading the binary files from a BIN folder on the CD? Just to keep things neat. At present it seems they can't be anywhere but the root dir.
« Last Edit: May 18, 2018, 04:48:15 pm by ponut64 »

XL2

  • Full Member
  • ***
  • Posts: 210
  • Karma: +45/-0
    • View Profile
Re: Virtua Skimmer
« Reply #21 on: May 18, 2018, 05:03:09 pm »
Works fine here. Maybe your model was too big so what you saw was actualy inside it, so it did backface culling and you didn't see anything?
I just scaled it down 10% in Blender and then scaled it up 4 in the tool.

The only other thing it could be is that you use RLE compression, so it didn't actualy read the textures.
I'm also using Blender, so it shouldn't be an issue.
I just use the default values, see attached image.

About the subfolders, you can add the following functions to your code and call them (set the directory, then after set it back to root).
I suggest you first call ztCDsetDir, load everything you need to load, then call ztCDsetRoot to return one folder back.
 

Code: [Select]

void    ztCDsetDir(char * subDir)
{
    Sint32  fid;
    if (subDir != NULL)
    {
        fid = GFS_NameToId((Sint8 *)subDir);
        GFS_LoadDir(fid, &gfsDirTbl);
        GFS_SetDir(&gfsDirTbl);
    }

}

void    ztCDsetRoot()
{
    Sint32  fid;
    fid = GFS_NameToId((Sint8 *)"..");
    GFS_LoadDir(fid, &gfsDirTbl);
    GFS_SetDir(&gfsDirTbl);
}

« Last Edit: May 18, 2018, 05:21:01 pm by XL2 »

ponut64

  • Newbie
  • *
  • Posts: 42
  • Karma: +6/-0
    • View Profile
Re: Virtua Skimmer
« Reply #22 on: May 18, 2018, 05:41:50 pm »
It works now, and it would seem the only thing I had to do differently was to make a subfolder in the IN folder for the converter.
/e: Actually, I also put the file name in all-caps.

I don't know, my dude, that is the only thing I did differently. Thanks for sanity-checking my mesh!
« Last Edit: May 18, 2018, 05:44:15 pm by ponut64 »

XL2

  • Full Member
  • ***
  • Posts: 210
  • Karma: +45/-0
    • View Profile
Re: Virtua Skimmer
« Reply #23 on: May 18, 2018, 05:44:09 pm »
I just noticed Blender supports exporting animations.

I will play a bit more with that in the next few weeks and see what I can do with it.

ponut64

  • Newbie
  • *
  • Posts: 42
  • Karma: +6/-0
    • View Profile
Re: Virtua Skimmer
« Reply #24 on: May 18, 2018, 05:49:10 pm »
What that does is it exports each frame as a separate mesh according to the range of frames you put in the timeline and the desired frame-rate you put in the Blender render section ("Dimensions" tab).

I don't think you need an example of how that can be organized into a file but here it is. As you suggested, its converted header files and only the host mesh has complete mesh data. Each other frame has all but its vertices axed and structured as new meshes.

XL2

  • Full Member
  • ***
  • Posts: 210
  • Karma: +45/-0
    • View Profile
Re: Virtua Skimmer
« Reply #25 on: May 18, 2018, 05:57:41 pm »
I know next to nothing about animations in Blender, but if you can send me your model with some basic animations (like 2-3 different movements) I could see what I can do.
But doing vertex animation isn't cheap memory-wise, so it might be better to somehow compress the data.
I really don't know how I would handle it.
Maybe by going with 4 bytes per vertex instead of 12, but I'll have to think about it.

ponut64

  • Newbie
  • *
  • Posts: 42
  • Karma: +6/-0
    • View Profile
Re: Virtua Skimmer
« Reply #26 on: May 18, 2018, 06:40:13 pm »
Here you go.

My rig is terrible but this should serve well enough for examples.
If you want, I can poke around and try and get a blend file from someone more experienced. (Of course, you might guess by now what subject material it will be ...) These really are my first Blender / 3D animations.

Target 15 FPS (you can change that of course)
0 - 7 Start Walk
7 - 15 Walk Part 1
15 - 22 Walk Part 2
22 - 29 Stop Walk

29 - 34 Mime Part 1
34 - 36 Mime Part 2
36 - 44 End Mime

If it really is only 12KB per frame in memory, that's enough for me, so I understand if you feel its more important to work on something else.
« Last Edit: May 18, 2018, 06:44:18 pm by ponut64 »

XL2

  • Full Member
  • ***
  • Posts: 210
  • Karma: +45/-0
    • View Profile
Re: Virtua Skimmer
« Reply #27 on: May 18, 2018, 06:48:06 pm »
Thanks, I'll look it up.
I won't have time this week, but maybe I can get some work done next week.

I think I will just ask the user to enter : how many animations, how many frames per animation.
So, if you say : 4 (nb of animations), it will ask you how many frames for animation 1 (let's say 7), 7 for animation 2, etc.
And it would store the default vertices (your default obj file) and for each animation frame 4 bytes per vertices to store the offset.
It should be cheaper than storing all the vertices multiple times, but it would still be a little bit hard on the CPU.
Anyway, we'll see once we get there!

If you manage to make it work with your current implementation, make sure to show us with a small clip!

XL2

  • Full Member
  • ***
  • Posts: 210
  • Karma: +45/-0
    • View Profile
Re: Virtua Skimmer
« Reply #28 on: May 18, 2018, 07:53:47 pm »
Now that I think about it, it might not even work because of the normals.
SGL does backface culling depending on the normals, not the vertices AKAIK.

Can you try it to confirm it does indeed work?
The work around would be to also compress the normals, but that would double the amount of memory!
The other way to do would be to animate using meshes as bones, it would require less memory but it's still not that easy to implement since I will have to interpolate the movements.

ponut64

  • Newbie
  • *
  • Posts: 42
  • Karma: +6/-0
    • View Profile
Re: Virtua Skimmer
« Reply #29 on: May 18, 2018, 07:57:31 pm »
I had it working using header files as given, however I didn't circum-rotate the mesh much I just saw it working in a few perspectives.
It may be I just didn't move the mesh enough to see anything go wrong. This wasn't with the real-time gourad shading.

When you do have time, take a test of the header files in my previous post (specifically pony.h). Still needs XPDATA for every frame rather than PDATA ( jo engine mesh data ) but that shouldn't take long to do, just only change vertices data.
/e: Now I realize my test was without XPDATA, so I guess I wasn't really testing what we were talking about. With PDATA it did work.
I guess later today I am going to take a closer look at how it works with XPDATA / real time shading.
« Last Edit: May 18, 2018, 08:04:14 pm by ponut64 »

 

Sitemap 1 2 3 4 5 6 7 8 9 10 
SMF spam blocked by CleanTalk