xboxscene.org forums

Pages: 1 [2] 3

Author Topic: Pbkit  (Read 425 times)

openxdkman

  • Archived User
  • Hero Member
  • *
  • Posts: 550
Pbkit
« Reply #15 on: January 16, 2007, 10:54:00 AM »

Full screen Anti-Aliasing was my next planned feature addition, but I've found out that performing full screen anti aliasing is just drawing a huge triangle with a mapped texture which is the back buffer (with minification filters activated).

So... my next logical step is probably to draw a triangle list... then attach a mapped texture to it.
If I succeed, I will see the effect of replacing rectangle fill with triangles in Pong. Maybe issue will vanish.
Logged

openxdkman

  • Archived User
  • Hero Member
  • *
  • Posts: 550
Pbkit
« Reply #16 on: January 17, 2007, 04:47:00 AM »

Woot! It draws triangles!!! Passthru vertex shader initialization worked!

But... I don't feel confident about publishing a vertex shader code I'm not even able to disassemble or comment... I rather like understanding it and modify it a bit, just for the principle.

EDIT : No more help wanted about shaders. XB1 shaders knowledge gained!
Logged

openxdkman

  • Archived User
  • Hero Member
  • *
  • Posts: 550
Pbkit
« Reply #17 on: January 18, 2007, 03:14:00 AM »

HURRAY!!! Unstability issue has been understood and slaughtered!!! pbKit*.zip updated! You can now use Pong as a starter kit in order to design 2D ultra fast drawing code!!!

(I will check if there is a way to bitblt pixels areas without going through shaders. Otherwise you will have to wait until shaders encoding is understood in order to have textures drawing).
Logged

openxdkman

  • Archived User
  • Hero Member
  • *
  • Posts: 550
Pbkit
« Reply #18 on: January 18, 2007, 11:24:00 AM »

Temporarily, triangle experimental code is written at the bottom of changelog.
Feel free to try it. I will start some serious research about shaders encoding now.
Feel free to create benchmarks too. The top speed is available. Just miss some colored textures...
Logged

openxdkman

  • Archived User
  • Hero Member
  • *
  • Posts: 550
Pbkit
« Reply #19 on: January 20, 2007, 10:07:00 AM »

Woot!
Texture mapping still resists me (in pixel shader), but I fully understand vertex shader now.
(see bottom of changelog)
Logged

openxdkman

  • Archived User
  • Hero Member
  • *
  • Posts: 550
Pbkit
« Reply #20 on: January 21, 2007, 01:34:00 AM »

What I've understood so far :
- CG toolkit is great for creating vertex shaders (in NVidia SDK 9.5, for free)
- The result of compilation/assembly is a binary called "pseudo-code" (.vso).
- It can be a .h with the .vso data declared as a DWORD array. Include it.
- In pbKit, function pb_pcode2mcode() will convert it into gpu "micro-code".
- You upload the micro-code into inner registers (see cursors in inner.txt).
- "Vertex feed configuration" registers are like dcl_* (what goes where).
- "Fixed function pipeline" is just a default VS set by official libraries. Useless.
- Pixel shader in xbox is just a few values targetting a few inner registers.

In pbKit, when a VS is used, you will have in comments everything you need to know in order to recreate your own vertex shader with CG toolkit. PS will be just a sequence of inner registers initialization.

Official libraries lose a lots (really a lots) of time, saving previous values, VS, etc... then executing your calls, then restoring stuff to keep on going complex and necessary preriodic tasks such as full screen AntiAliasing. I won't do the same mistake. It will be up to you to know that a periodic useful call needs prepared values in specific inner registers. If you know you didn't change any of them then there won't be any time lost in saving/restoring them. You will be in control of everything and free to optimize speed madly.

I will post here a warning when "Demo 02 - Antialiased Pong" is published (need to create pb_pcode2mcode and master pixel shader related inner registers to have that damn texture mapping work finally). It will demonstrate when and how to call functions in order to do full screen antialiasing once per frame. It won't be automatic code hidden inside pbKit but commented inner registers handling in the game source itself (so you know what inner registers values are needed and need to be preserved or saved/restored if you upload your own VS or change the PS related inner registers between two full screen Antialiasing updates.
Logged

openxdkman

  • Archived User
  • Hero Member
  • *
  • Posts: 550
Pbkit
« Reply #21 on: January 29, 2007, 01:56:00 PM »

Demo 02-AntiAliased Pong released!!! (see changelog)

pb_pcode2mcode is finished and fully supports vertex shaders created with Cg toolkit. Pixel shaders partially (but it's not important because of the way it's encoded. Many things can be encoded manually on pixel shader side in a few registers).

Beside 2D rectangle fills you can now draw 2D triangles with mapped textures inside with or without filtering.
Now that vertex shader is easy to create and use, possibilities are infinite... Dunno yet what will be next demo. Maybe some 2D game with transparency for sprites... A colorful game for sure. No more black&white!

Other thing to do is to try to integrate pbKit in SDL or to integrate SDL in pbKit... Many possibilities...

Also, 3D and lighting won't be hard with NVidia Cg toolkit ready to use...

I won't push pbKit towards complex and numerous APIs. I wish it remains simple and small.
Other developers have to use it and build up other things like mesa, opengl, xorg, whatever...

Numeric constants have been replaced with constants coming from "Nouveau" project (see wiki), with permission of project leader. Headers in pbKit and "Renouveau" directory will be kept identical over time. That will make possible future ports of pbKit to other NVidia chips easier.

Stay tuned for Demo 03... whatever it is!
Logged

openxdkman

  • Archived User
  • Hero Member
  • *
  • Posts: 550
Pbkit
« Reply #22 on: February 01, 2007, 05:59:00 AM »

Good news. I've finally found out what is damn DMA channel 11 for...
(9 is used by GPU to draw in back buffer, 10 is used by GPU to draw in depth stencil buffer).
11 is used by GPU to copy rectangle regions from anywhere to anywhere.
Probably interesting for video and hardware bitblt (fast copy of a window contents when you move it).
Surely faster than drawing with a mapped texture... I guess next Demo-03 will demonstrate it.

Logged

openxdkman

  • Archived User
  • Hero Member
  • *
  • Posts: 550
Pbkit
« Reply #23 on: February 03, 2007, 08:42:00 AM »

I've updated "core" and "Demo 02-AntiAliased Pong" in order to demonstrate hardware image bitblt.
Just press X/B in menu or while playing to swap between AntiAliased texture copy and image bitblt
(image bitblt is an ultra ultra fast identical copy so you will see that way the antialiasing effect)
Logged

openxdkman

  • Archived User
  • Hero Member
  • *
  • Posts: 550
Pbkit
« Reply #24 on: February 17, 2007, 11:46:00 AM »

Demo 03 - Q*bert released! (Demonstrates 2D sprites with transparentcy -3 different methods-)
A to start game during demo or pause game during play
Y to quit
X/B to swap AA/Bitblt
Move analog right stick into diagonals to actually make Q*bert jump

Demo 04 will be real 3D... finally!
Logged

openxdkman

  • Archived User
  • Hero Member
  • *
  • Posts: 550
Pbkit
« Reply #25 on: February 19, 2007, 02:30:00 AM »

Demo 03 updated (Lives decrement fixed)
Logged

fghjj

  • Archived User
  • Sr. Member
  • *
  • Posts: 288
Pbkit
« Reply #26 on: February 26, 2007, 01:20:00 PM »

Demo03 - very impressive!

I noticed this:
http://digg.com/linu...uxBIOS_Released

First modern motherboard with a GPL-licensed BIOS: GigaByte GA-M57SLI-S4
 - Socket AM2 / Nforce 570 chipset
 - SATA2
 - Sound/NIC
 - 4 Mbit Flash

Might be interesting for your pc0 project? I think there is great demand for a useful (HTPC-like) device that:
 - Powers on and off "instantly", like a regular dvd-player or console
 - Has a strong CPU to decode H.264 / HDTV material
 - No noisy HDD, boot direct in OS from FlashROM and a supporting CompactFlash card
 - Has a slick bootanimation like the Xbox, no crappy AWARD BiOS messages
Logged

openxdkman

  • Archived User
  • Hero Member
  • *
  • Posts: 550
Pbkit
« Reply #27 on: March 14, 2007, 09:38:00 AM »

I've updated pbKit_demos.zip.
You will find there a very early preview of Demo 04-Initial Fantasy
It will become a little RPG, but for now, it's only a preview of the 3D engine.

Feel free to try it. It's full of mistakes (I've troubles with projection, culling and clipping).
But something shows up (read from .3ds & .bmp files) with correct texture mapping, at least.

Y: Quit
X/B: raise/lower vertices
Right stick : Up/Down (go close, go away, witout projections no change) Left/Right (rotate)

Logged

openxdkman

  • Archived User
  • Hero Member
  • *
  • Posts: 550
Pbkit
« Reply #28 on: March 16, 2007, 07:48:00 AM »

pbKit_demos.zip updated.
Speed optimization done (either by vertex batches or index batches) :
330000 vertices/frame (or indices/frame)
On ps2 I've obtained 250000 vertices/frame (no way to do index batches)
(ps2 demo is named "gsKit+vulib starter kit" in ps2dev development forum)

Hint: Phong can be done easily by customizing ps and obtaining the normal from vs. (but normals are indenticals for a same triangle at the moment, so, you will have to improve the way normals are calculated so they become different and thus become interesting to use either in gouraud or phong technic)

That's all folks.

I will now work on many other things...
 (my kids oriented OS for pc0+nv40/ps2/xb1, but also ps3 & 360 homebrew)

Keep a backup of pbKit nv2A archives and use them well.

I will finish Demo 04 much later, once I secure some business with my OS (can't work for free forever!).
Logged

sakir2000

  • Archived User
  • Jr. Member
  • *
  • Posts: 58
Pbkit
« Reply #29 on: March 20, 2007, 07:15:00 AM »

nice work man keep it up

hope that some body will be able to add C++ support to the openxdk.Then it will be a full
XDK with 3D ,2d and C++ support

Logged
Pages: 1 [2] 3