Poor Mode7 Demo
Displaying 1-9 of 9 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
Omni

deprecated: http://www.verge-rpg.com/files/detail.php?id=641



Thanks to Interference for that font, yet again.

No, it's far from great...but I felt like trying to put it together. Perhaps next time it will be much, much better, but here was what I accomplished. Feel free to take a look-see if you're curious. Also check the readme.txt.

UPDATE: Fixed it. See post below...also, you could check...

http://webs.wofford.edu/craftjm/V3_LIB_ors_OmniRotatingScroll.zip

Don't think I'll post another download here just yet, though.

Posted on 2005-11-13 17:12:20 (last edited on 2005-11-13 19:29:35)

Omni

Two lines...not quite worth a whole new download, as I bet the parent ID still isn't set yet.

This fixes all distortion...I believe.

ors.vc
Incrementing across the X axis [inner loop]
Comment out/delete lines 82-83.

Before the SetPixel line, add:
if (srcX<0) srcX=width<<8+(srcX%(width<<8));
if (srcY<0) srcY=height<<8+(srcY%(height<<8));


Comment out lines 60-61.

Fixing distance divide by zero and integer truncation
At line 36 [compute distance], delete and add:

distance = Mode7_spaceY>>2*(Mode7_scaleY>>2)>>4 / (desty+Mode7_horizon);
if (distance == 0)
{
distance = Mode7_spaceY>>2*(Mode7_scaleY>>2)>>4 / (desty+Mode7_horizon+1);
}

Posted on 2005-11-13 19:04:19

rpgking

That looks very promising. It's probably the closest I've seen to a true rotation/scaling Mode7 demo.

Posted on 2005-11-15 10:25:20

Omni

I'm working on some improvements. I've fixed the centering of rotation, and I'm working on a type of mip-map system. I could possibly do Trilinear Mip-map Filtering like the N64, but I'm not sure if it would help the quality...At such a low resolution that I run the demo at, the mipmap isn't able to fix the very distant artifacts.

After I finish the mipmap/filtering thing, I'm going to try to remake it to use RotScale rather than SetPixel, which might be a bit faster...not yet sure.

I have an idea to create a full 3D sprite/object rotation library, but I can't quite integrate this demo into it [since I only partially understand the maths]. So I'm going to compromise and use the sample sprite functions given in the Allegro/Sin & Cos: Programmer's Pals tutorial. At that point, I'd probably release this and call it complete.

Posted on 2005-11-15 11:37:57

zaril

What FPS does it run at? *comparing size*

Posted on 2005-11-18 13:15:55

Omni

FPS = Crap

I'm working on an FPS counter, and after I get out for thanksgiving break, I'm going to recode it, now that I've got an idea what I'm doing, so I can improve the speed.

At this second though...

500x500 buffer = < 1 frame/sec
300x300 buffer = > 1 frame/sec [but not more than 5]
200x200 buffer = approx 10 frame/sec, I guess
100x100 buffer = maybe about 30 fps.

I really don't mind the low-res speed...I've got to work on improving the math a bit. For example, the GBA has only something like a ...200x140 pixel screen or somesuch, but we can all agree that Mario Kart GBA Mode7 is a lot cleaner than the same 200x140 buffer on this demo...it needs tweaking.

Posted on 2005-11-18 15:34:52

Code

That's looking really good! Much better than my attempt! *nervous laughter*
Awesome, Omni!

Posted on 2005-11-18 17:02:27

rpgking

Quote:
Originally posted by Omni

FPS = Crap
but we can all agree that Mario Kart GBA Mode7 is a lot cleaner than the same 200x140 buffer on this demo...it needs tweaking.



Aren't Mode7-type effects on the GBA done through hardware(probably not called "Mode 7" on the GBA), similar to how Mode 7 worked on the SNES? If that's the case, you really can't compare software-based Mode 7 to hardware-based. ;)

But I'm sure there's a way to do it in software at high speeds, so I hope my words aren't discouraging.

Posted on 2005-11-18 19:52:14

Omni

Thankie. I understand the math for it a lot better now...but not perfectly. I wish I did...

By the way...here's some more interesting Mode7 stuff I found...it's GBA specific, but I still find the discussion interesting, and the tidbits on the 3D math used could come in handy...

http://user.chem.tue.nl/jakvijn/tonc/mode7.htm

RPGKing: I'm not too worried about the speed, because I don't expect to make it as fast as hardware-based stuff. There are one or two optimizations that can be made, probably. What I want to try to do is make it look less...rough on the pixel edges. The really really jaggedy ness doesn't seem to be so bad in SNES or GBA Mode7. Then again, maybe I need to craft a landscape image rather than using a font sheet or something.

Posted on 2005-11-18 19:54:23 (last edited on 2005-11-18 19:56:36)


Displaying 1-9 of 9 total.
1
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.