English Amiga Board


Go Back   English Amiga Board > Main > Amiga scene

 
 
Thread Tools
Old Yesterday, 09:37   #101
Karlos
Alien Bleed
 
Karlos's Avatar
 
Join Date: Aug 2022
Location: UK
Posts: 4,818
Quote:
Originally Posted by hammer View Post
Commodore's RTG promise would cause FUD on GVP's EGS.
The problem with CGX and P96 is that they didn't really provide any new accelerated ways of doing graphical operations. They just patch graphics.lbrary drawing functions. Which is necessary and great for existing applications, but doesn't do much to help you if you want to do anything new in a performant way. It is to Amiga what GDI was is to Windows. The only really useful things you can do is to use those to allow you to *ensure* a BitMap is allocated in VRAM, query the precise hardware attributes (depth, format, dimensions, spans, etc) of that BitMap, the ability to lock it so that you can do unaccelerated software drawing on it*. Also, trying to lock and pin bitmaps this way is something that's not even best practise, since as Thomas says, the RTG layer is supposed to manage all this and ensure what's in VRAM is only what is necessary.

This also produces the interesting side effect that, unless you use a friend BitMap to try and ensure your new allocation is in VRAM, it typically ends up in Fast, until you want it render on it. At which point it's either transferred to VRAM, which is a massive overhead, or in some cases the system simply uses a software version of the routine to draw on the BitMap while it's still in fast memory.

Also, using friend bitmaps means you lose control over the format, since it has to be in a format that can be directly blitted, which more often than not means, in exactly the same format as the friend. I can't tell you the lunacy this results in when working on 3D drivers that have to use these allocator routines for allocating texture buffers.

None of these behaviours are conducive to high performance graphics programming.

*This is why so many games end up just rendering to fast ram and then frame copying to the RTG card.

Last edited by Karlos; Yesterday at 09:43.
Karlos is offline  
Old Yesterday, 11:27   #102
Karlos
Alien Bleed
 
Karlos's Avatar
 
Join Date: Aug 2022
Location: UK
Posts: 4,818
Quote:
Quite frankly, this goes more in the direction of a 3D API which provides something in this area. This exists already. While I'm not against a "Direct Draw" like additional API for 2D, I doubt adding one will have much success. There is a lack of critical mass here that prevents it from getting successful.
Well, the 3D API is completely the wrong one for what I needed. Case in point. I had an abstract drawing class, that had three implementations in the end, selectable at runtime based on what was detected.

1. Pure software (locking bitmaps, direct software rendering)
2. Gfx/RTG (standard graphics.library)
3. Warp3D (direct screen space rasterization).

These were all required to render to RGB (15/16/32 bpp) targets, with colour information being passed as a 32-bit ARGB tuple, arbitrarily, per primitive. There are also shaded (basic vertical and horizontal gradients). Alpha was only used where supportable. The design worked on the concept I describe, in that you set up a number of primitives and then call a render operation. I did this because it was the only sensible way to do 1 and eventually 3, even if 2 didn't strictly need it.

In the end, 2 was by far the least capable and the only thing it could do better than 1 was basic rectangular fill/copy. It had to extend 1 anyway because the total graphics.librart routine overhead was so absurd for simple primitives that it was just faster to lock and draw in software. For example, one operation renders an array of point data, where each point has it's x,y,RGB data, discarding any outside either the bitmap dimension or any smaller rectangular clip area that could be defined. This is probably the worst possible case for 2, which was literally hundreds of times slower than 1. It's worth noting that 1 was also a lot faster than 3 for this.

In the end, 3 was the best of a bad bunch but demanded that you have an FPU, because it's intended to support the output of 3D transformation I wasn't using. There was also no way to blit in a manner that would allow the copied area to be refused for the draw fills because textures aren't bitmaps in the conventional sense, and even having pretty strong inside knowledge of my particular HW and drivers, there was no way I was going to hack that to work.

So the only one which ever worked fully was 1, which then was by far the slowest at any rectangle operations and 3 was the fastest by virtue of being able to reuse bits of 1 and 2 to support what the 3D driver API couldn't do or didn't do well.

What we really needed was for the system to provide a fast, efficient, easily HW mappable set of operations, but literally nothing existed. Today, you might get the majority of this with the compositor implementation in 4.1 and equivalent functionality in MOS.

As for more fully fledged API, I absolutely did not want the ludicrous indirection of GL and all that comes with it to do this, because every single 68K GL implementation utterly sucked at the time, having all the worst problems of the Warp3D implementation above with thr added overhead of GL abstraction on top. It also sucked if you didn't want to use GLUT for managing your display. GL was only useful for things written for GL and back then, very very little was written for GL that was expected to run well on a 68K.
Karlos is offline  
Old Yesterday, 12:27   #103
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 3,390
Quote:
Originally Posted by Karlos View Post
This also produces the interesting side effect that, unless you use a friend BitMap to try and ensure your new allocation is in VRAM, it typically ends up in Fast, until you want it render on it.
...or until it is being rendered. That does not make a difference for P96. However, typically you *should* allocate the bitmap as a friend to avoid that.


Quote:
Originally Posted by Karlos View Post
Also, using friend bitmaps means you lose control over the format, since it has to be in a format that can be directly blitted, which more often than not means, in exactly the same format as the friend. I can't tell you the lunacy this results in when working on 3D drivers that have to use these allocator routines for allocating texture buffers.
This is why P96APi has a function to allocate bitmap in a format you want. However, due to restrictions of contemporary graphics chips, you cannot really depend on bitmaps being blitable by hardware that have a format different than the format of the target bitmap, so software has to help out in many cases. Chunky can often be blitted to other formats, but things like hi-color to true-color are really the exception in terms of hardware support, and P96 has no abstraction for such a blit.


Quote:
Originally Posted by Karlos View Post
*This is why so many games end up just rendering to fast ram and then frame copying to the RTG card.
Which is really not necessary at all. After all, you *can* allocate bitmaps in VRAM as friends and let the chip do the work.
Thomas Richter is offline  
Old Yesterday, 12:32   #104
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 3,390
Quote:
Originally Posted by Karlos View Post
These were all required to render to RGB (15/16/32 bpp) targets, with colour information being passed as a 32-bit ARGB tuple, arbitrarily, per primitive.
Then you already start at the wrong end. Issue being that I have only seen one graphics chip so far that can actually do a downconversion from ARGB to high-color *and* is available as option to the Amiga, and that is the voodoo. All other graphic chips do not simply support this operation in hardware at all.


Thus, it makes little sense to add an abstraction for hardware support if you don't have any hardware that supports it.


Quote:
Originally Posted by Karlos View Post
What we really needed was for the system to provide a fast, efficient, easily HW mappable set of operations, but literally nothing existed. Today, you might get the majority of this with the compositor implementation in 4.1 and equivalent functionality in MOS.
The graphics cards you can plug into a 68K-based Amiga rarely have any idea about compositing. You are lucky if they have a blitter ("accelerator"). You can move rectangles around, implementing the 256 minterms (aka "ROP"s) M$ defined, and that's about it what graphic chips could do back them.



The P96 driver API is a relatively modest abstraction of what the chips could possibly offer, and that wasn't really much.
Thomas Richter is offline  
Old Yesterday, 12:52   #105
Karlos
Alien Bleed
 
Karlos's Avatar
 
Join Date: Aug 2022
Location: UK
Posts: 4,818
No, that is (was) my API and it abstracts the problem if of converting an ARGB 32-bit word to *any* hardware format for software rendering extremely efficiently. That is 100% not the issue.

Basically the OS routines, on RTG are fit for acceleration of blitting/filling rectangles that are large enough to absorb the setup costs. For everything else they are just too outmoded and too slow.

This is how I ended up with a "mostly accelerated" implementation of my API (in my library for my projects) provided you have a W3D capable system.

The problems are that you have 3 different API that don't even sum to what you need: graphics for basic rendering and blitter operations. CGX/P96 for allocation and soft manipulation of VRAM resident bitmaps and software rendering to them. And finally W3D for more advanced rendering, e.g. blending a "bitmap" (a texture) onto the display, drawing gradient filled primitives (with or without "bitmap"), arbitrary scaling and rotation of "bitmaps" (again, just the rectangle size/orientation) etc.

Last edited by Karlos; Yesterday at 12:58.
Karlos is offline  
Old Yesterday, 16:47   #106
Karlos
Alien Bleed
 
Karlos's Avatar
 
Join Date: Aug 2022
Location: UK
Posts: 4,818
Just to point out, this is not an axe to grind, it's just a statement of how things were at a time when I wanted to make stuff that ran well on graphics cards when my Amiga was my daily driver. I don't think much has changed on the 68K side in that respect.

It was frustrating that there wasn't something more performance oriented available when the humble 68K+RTG would be the biggest beneficiary of improved efficiency compared to the emerging PPC/NG stuff.
Karlos is offline  
Old Yesterday, 17:16   #107
Zak
ZapĀ“em
 
Zak's Avatar
 
Join Date: Aug 2012
Location: Germany
Posts: 639
I once got a book in the nineties, where it was postulated that when Apple was in trouble, they had talks with Microsoft about being taken over by them and use a Windows version as OS that would still be Windows but have an "Apple face" to it. It would just have the Apple main screen and Apple menus, but it would be all Windows under the hood. I don't think I got that book anymore and I'm so bad at remembering names. I think it was called "The Microsoft file". But is that what is being asked for?
Zak is offline  
Old Yesterday, 18:19   #108
haps
Rumpig
 
haps's Avatar
 
Join Date: Aug 2006
Location: The bottom of the bottle
Age: 93
Posts: 260
The Hammer and Abbot show is like a virus. Is there a thread it will not infect?
haps is offline  
Old Yesterday, 18:25   #109
Karlos
Alien Bleed
 
Karlos's Avatar
 
Join Date: Aug 2022
Location: UK
Posts: 4,818
Quote:
Originally Posted by haps View Post
The Hammer and Abbot show is like a virus. Is there a thread it will not infect?
I dunno but I think that some people may already be contemplating boycotting a certain well known brand of baking soda based whitening toothpaste over it.

They both make reasonable points amid the constant to and fro but part of me thinks it's all been said and on numerous occasions.

Last edited by Karlos; Today at 01:11.
Karlos is offline  
Old Today, 01:05   #110
swoslover
Registered User
 
Join Date: Jun 2024
Location: Scotland
Posts: 22
A true Amiga is 68k with a floppy disk. Maybe a hard drive. Anything else is a frankenamiga. Of course I'm a hypocrite with various add ons for mine but things like PPC aren't truly Amiga. Beyond Commodore we move into what if territory.
swoslover is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the best Amiga OS for PC(Amithlon or Amiga OS XL) spannernick support.Other 4 04 September 2012 16:07
PortablE r4 released (now runs on Windows) ChrisH Coders. General 1 30 May 2009 02:40
You know you're in trouble when a 1.4ghz PC runs Dizzy at 5fps... Echo Retrogaming General Discussion 11 28 January 2003 15:06
Windows API for Amiga OS? Pyromania Amiga scene 3 11 April 2002 13:02

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 04:12.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.11321 seconds with 15 queries