Using 3D card functions in QB45

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
Digital Shadow
Coder
Posts: 23
Joined: Sun Oct 03, 2004 10:26 pm
Location: Prince George, BC, Canada

Using 3D card functions in QB45

Post by Digital Shadow »

Anyone know how to trottle that sweet little juice out of my nice PCI or AGP in everyones favorite language?
People laugh at me because I'm different, I laugh because there all the same... Soooo, if were all laughing, I fail to see the problem
Guest

Post by Guest »

You can't. :*)
Digital Shadow
Coder
Posts: 23
Joined: Sun Oct 03, 2004 10:26 pm
Location: Prince George, BC, Canada

Surrendur is not an option...

Post by Digital Shadow »

that never stopped me... there should be some way to call an inturrupt or send a value to a port... I have a 3D Engine 3 years in production using the UGL Library (not as useless as it seems). Current speed is 120 fps on a 233Mhz machine with 4000 textured faces. up to 6000fps non textured and no vertical retrace. Supports 12step, 9step, and matrix rotation, light mapping(lambert, gourad, and phong), potential MIP Mapping, Backface culling, Z-Sorting, 320x200x256 and higher (yay...1024x768 Res at 32bit color in QB, thanks ugl). The next major breakthrough will be transporting it to a paralell port network (running at a sync speed of over 480000bps, adaptive async). There will be primarily 6 machines running AMD 1.1Ghz.
Each machine will handle a specific job, and re-rout it to a centeral database machine. The purpose of this is to achive breakneck speeds(realisticly calculated at 240fps w/o flickering) of an almost unlimited world size. The purpose of this extreme measure is to accomodate an experimental VR bodysuit. I chose QB because I've had 10+ years experiance, and it can be made to run faster by far than VB, VC++, and even C++ when the compiled versions are toyed with(that means assembler!) It started as a hobby, but is now attracting the interest of a few individuals who seem to want to waste money on my behalf(hence the one 233 upgrade to 6 1.1G's)

I'll put it in a nutshell... Must.... have .... more..... speeeeeed

I dont expect results, but I have nothing to lose by asking besides my pride, and possibly rep(ah heck, dont think I have one anyway)

Enough verbal Diharrea, Digital Shadow Out


=-=-=-= Courdory Pillows...There Making Headlines =-=-=-=
People laugh at me because I'm different, I laugh because there all the same... Soooo, if were all laughing, I fail to see the problem
Z!re
Veteran
Posts: 887
Joined: Wed Aug 04, 2004 11:15 am

Post by Z!re »

3D gfx cards, store their offset and data at adress above 4gb, meaning QB can't access it, and even if you could, there's no way you could make it work without having the gfx card specs. Whivh are near impossible to get as the manufacturesrs guard them like treasures.

Making a wrapper, that uses DX or smething simillar woulnd't work either, as it would just be too slow.


And it isn't UGL, it's really ?GL (Micro GL)
I have left this dump.
Digital Shadow
Coder
Posts: 23
Joined: Sun Oct 03, 2004 10:26 pm
Location: Prince George, BC, Canada

Post by Digital Shadow »

Thanks Z!re, but just because its impossible dosn't mean it cant be done... Oh well... I'll probably end up either making an assembly routine to touch it, or (I dont know for sure if its possible, but worth looking into it) making some handle to the card. As for the specs, the internet may be helpful, but I'll most likely end up getting the microchip schematics and going from there...or just decompiling the drivers.

Ya gotta have that die-hard attitude to be a QBasic fan nowadays :D
(and here I thought is was "Useless Game Library")
People laugh at me because I'm different, I laugh because there all the same... Soooo, if were all laughing, I fail to see the problem
Guest

Post by Guest »

Digital Shadow wrote:Thanks Z!re, but just because its impossible dosn't mean it cant be done... Oh well... I'll probably end up either making an assembly routine to touch it, or (I dont know for sure if its possible, but worth looking into it) making some handle to the card. As for the specs, the internet may be helpful, but I'll most likely end up getting the microchip schematics and going from there...or just decompiling the drivers.

Ya gotta have that die-hard attitude to be a QBasic fan nowadays :D
(and here I thought is was "Useless Game Library")
Even with ASM, you're doing DOS and DX is native to 32 bit code and addresses. There.

Any demo of your suppossedly uber cool 3d engine?
Digital Shadow
Coder
Posts: 23
Joined: Sun Oct 03, 2004 10:26 pm
Location: Prince George, BC, Canada

Post by Digital Shadow »

Dont worry... I know all about DOS restrictions, and DX. Dont forget, I want to bypass DirectX, I'm trying to work outside the bounds of even DOS. What I'm coding now is somthing that works to the inturrupt adresses. Before anyone says anything and I make myself look stupid, I know this is either extremely difficult or plain impossible, and thats why I'm doing it...
I may have to build some custom hardware to use as a handle to my card, but that would be a last resort.
As for a demo... the files are being rewritten atm, and I hope to get some better memory management, so I will get a compiled version out there soon(sorry, too much work in it to throw out the source code now, I'll wait until I can make it as an asm library if I decide to)

btw Great Site Pete
People laugh at me because I'm different, I laugh because there all the same... Soooo, if were all laughing, I fail to see the problem
v3cz0r

Post by v3cz0r »

It's not impossible, but it would be so complex to do that nobody would attempt that.. not worth the trouble.

PCI registers are mapped in protected-memory, normally above 3GB (&hE0000000 linear address and such). Each card has its own set of registers and commands, so a driver would be needed for each supported card.. Linux kernel sources would help writing those drivers, but i'm not sure if ATI ones are open-source, for example.

To have direct access to mem above 1MB in QB a lib like B4G (http://www.geocities.com/av1ctor/files/b4g.zip) would be needed or you could run the app in raw DOS (no EMS) and enter in unreal/voodoo-modes, but programming each register from QB would be really slow as two mode switches are needed (from real-mode to pmode and then back to rmode), so you would end up having to code the driver in ASM, mixing 32-bit with 16-bit, what makes everything really hard to code (believe me, i coded that B4G lib, it was a nightmare :P).

I'm glad uGL is still being used, the initial idea was to call it "Useless Game/GFX Library" and at the end it became just that.. an useless piece of ~50K lines of optimized asm code.. btw, last version got flat/gouraud shaded texture-mapped triangles, both for affine and perspective-mapping, what would probably speed up your engine even more.. but Blitz have to release the last version yet, that lazy ****.. ask him for a copy or something if you want it..
Guest

Post by Guest »

That 3d engine for yours sounds neat, got a demo? :P
Blitz

Post by Blitz »

Opps, forgot to fill in username
Digital Shadow
Coder
Posts: 23
Joined: Sun Oct 03, 2004 10:26 pm
Location: Prince George, BC, Canada

Post by Digital Shadow »

I'll post a version up soon, the whole thing went through a rewrite, so I might be limited a few bells&whistles. I'll come out with the new version in about two weeks, and it should include a model editor. Hope to have numbered idexed shapes, and subroutines to controll them. ex.. MakeCube 1, 10 would make shape 1 a cube with points at (10,10,10), (10,10,-10) etc... and MakeSphere 1,10 would make a sphere with each point at a distance of 10 from the start. I have a sub:
RotateShape (ID,xRot,yRot,zRot) and a DrawShape(ID), but I'll make a sub that uses the original points, and rotates them and draws in one sub.
Hope to post it soon

thx for the help so far all

new uGL... Interested... come on now...
People laugh at me because I'm different, I laugh because there all the same... Soooo, if were all laughing, I fail to see the problem
Digital Shadow
Coder
Posts: 23
Joined: Sun Oct 03, 2004 10:26 pm
Location: Prince George, BC, Canada

Post by Digital Shadow »

another thing, if anyone has any info about Camera stuff(how to translate the coordinates accordingly and quickly) or some info on how to generate more shapes like hexahedrons (think thats what their called, on the assumption a cube is a tetrahedron) or anything fancy like stars, dynamic formulas/algorithms to generate 3d objects, Thx
People laugh at me because I'm different, I laugh because there all the same... Soooo, if were all laughing, I fail to see the problem
barok
Coder
Posts: 38
Joined: Sat Jul 24, 2004 4:32 pm
Location: Frozen bushlands of Saskatchewan

Post by barok »

you got us wanting to see your 3d engine digital shadow. it sounds promising statistic wise!

I'd know that guest that posted second anywhere! It be Relsoft! I'd recognize that :*) Anywhere! ;)
I have no sig.
Digital Shadow
Coder
Posts: 23
Joined: Sun Oct 03, 2004 10:26 pm
Location: Prince George, BC, Canada

Post by Digital Shadow »

part of the answser may be in windows itself. Right click on my comp>prefs>device manager>display adapter and pring up its prefs, then open up the rescource tab. On this machine(not mine) I'm seeing some memory ranges, I/O Ranges, and an inturrupt request. If anyone knows if this could help then be my guest
People laugh at me because I'm different, I laugh because there all the same... Soooo, if were all laughing, I fail to see the problem
Post Reply