Looking at the code in your screenshot: Why don't you pass sprite to draw_raster()?
You already looked the sprite up in draw_sprite_raster(), now you repeat this work height times in draw_raster().
Suppose the sprite is number 50 in your sprite sheet and 32 pixels high, then you're doing 50*32=1600 string comparisons every frame when drawing that one sprite.
And you can change the palette by line? I didn't know that. I thought I had tested it in the past and it didn't work. I thought the palette persists through the whole frame?
Converting png/jpg to KMG - garbled output when pvr updates
- bogglez
- Moderator
- Posts: 578
- https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
- Joined: Sun Apr 20, 2014 9:45 am
- Has thanked: 0
- Been thanked: 0
Re: Converting png/jpg to KMG - garbled output when pvr upda
Wiki & tutorials: http://dcemulation.org/?title=Development
Wiki feedback: viewtopic.php?f=29&t=103940
My libgl playground (not for production): https://bitbucket.org/bogglez/libgl15
My lxdream fork (with small fixes): https://bitbucket.org/bogglez/lxdream
Wiki feedback: viewtopic.php?f=29&t=103940
My libgl playground (not for production): https://bitbucket.org/bogglez/libgl15
My lxdream fork (with small fixes): https://bitbucket.org/bogglez/lxdream
- ThePerfectK
- Insane DCEmu
- Posts: 147
- Joined: Thu Apr 27, 2006 10:15 am
- Has thanked: 27 times
- Been thanked: 35 times
Re: Converting png/jpg to KMG - garbled output when pvr upda
it was a dirty test to get it working, I've already cleaned up the codebogglez wrote:Looking at the code in your screenshot: Why don't you pass sprite to draw_raster()?
You already looked the sprite up in draw_sprite_raster(), now you repeat this work height times in draw_raster().
Suppose the sprite is number 50 in your sprite sheet and 32 pixels high, then you're doing 50*32=1600 string comparisons every frame when drawing that one sprite.
well, I can simulate changing the palette by line in any case. I'm drawing a bunch of thin polygons, and can switch which palette each polygon is drawn with. Part of the reason I wanted 64 16 color palettes instead of 4 256 color palettes was so I could sacrifice half of my palettes to underwater shades. I have my "underwater palette" set at 32 palette entries beyond the original, so if I want to switch between the two I just add 32 to the current palette number.And you can change the palette by line? I didn't know that. I thought I had tested it in the past and it didn't work. I thought the palette persists through the whole frame?
I'm working on drawing a rolling sin-wave patterned background at the moment, once I get that going, I'll show an example of the water trick I'm doing.
Still Thinking!~~
- ThePerfectK
- Insane DCEmu
- Posts: 147
- Joined: Thu Apr 27, 2006 10:15 am
- Has thanked: 27 times
- Been thanked: 35 times
Re: Converting png/jpg to KMG - garbled output when pvr upda
All sorts of effects in this frame lol:
In this case, I have the line scroll going on a transparent foreground texture that is displaying over a sprite that I'm rotating whose palette I've manually set. Next up, I'm going to show that palette swap mimic, maybe I'll package it all together in a small demo people can download. The foreground layer is also tiled in case it's not obvious
In this case, I have the line scroll going on a transparent foreground texture that is displaying over a sprite that I'm rotating whose palette I've manually set. Next up, I'm going to show that palette swap mimic, maybe I'll package it all together in a small demo people can download. The foreground layer is also tiled in case it's not obvious
Still Thinking!~~
-
- DC Developer
- Posts: 414
- Joined: Thu Aug 20, 2009 11:00 am
- Has thanked: 0
- Been thanked: 2 times
Re: Converting png/jpg to KMG - garbled output when pvr upda
That's pretty damn slick! Just shows that even without a special 2D coprocessor, you can still do some slick 2D stuff. Just takes more elbow-grease on the part of the programmer.
Re: Converting png/jpg to KMG - garbled output when pvr upda
For shear effects you can just use a simple rectangle and offset the bottom points on the x axis while leaving the texture coordinates alone btw
Wiki & tutorials: http://dcemulation.org/?title=Development
Wiki feedback: viewtopic.php?f=29&t=103940
My libgl playground (not for production): https://bitbucket.org/bogglez/libgl15
My lxdream fork (with small fixes): https://bitbucket.org/bogglez/lxdream
Wiki feedback: viewtopic.php?f=29&t=103940
My libgl playground (not for production): https://bitbucket.org/bogglez/libgl15
My lxdream fork (with small fixes): https://bitbucket.org/bogglez/lxdream
- ThePerfectK
- Insane DCEmu
- Posts: 147
- Joined: Thu Apr 27, 2006 10:15 am
- Has thanked: 27 times
- Been thanked: 35 times
Re: Converting png/jpg to KMG - garbled output when pvr upda
That's if I want linescroll to be uniform and every line, however. If I want a variable width line scroll, like the tricks they use in Axelay, I'd have to chop the quad up into several chunks per linescroll.bogglez wrote:For shear effects you can just use a simple rectangle and offset the bottom points on the x axis while leaving the texture coordinates alone btw
Still Thinking!~~
- ThePerfectK
- Insane DCEmu
- Posts: 147
- Joined: Thu Apr 27, 2006 10:15 am
- Has thanked: 27 times
- Been thanked: 35 times
Re: Converting png/jpg to KMG - garbled output when pvr upda
Still at it:
My first version of this effect ran at 15 fps. I've got it to a full 60 fps now.
It's going in steps in this picture, but I can make it go as smooth as the original pic, except 4 times as fast
My first version of this effect ran at 15 fps. I've got it to a full 60 fps now.
It's going in steps in this picture, but I can make it go as smooth as the original pic, except 4 times as fast
Still Thinking!~~