UnderwareDesign
June 28, 2017, 12:23:20 PM *
News: G2D - 2D OpenGL library V007 for PlayBASIC V1.64P - Including Programmable Particles   (Released 22nd,Nov 2014)
   Home    
Pages: 1 [2]
 
Author Topic: Building a basic 3D Engine  (Read 752 times)
Member
Development Team


WWW
« Reply #15 on: April 09, 2017, 12:20:36 AM »




 Steve,

     dragged some super old code out and made a version  for PB that supports Z buffered rendering at least..  if nothing more it might be handy as reference.  Actually runs OK in PBV1.65, but we are talking about plotting pixels here so it'll never be extreme in plain PB.. 

Logged

Member

« Reply #16 on: April 10, 2017, 09:08:52 AM »

cool kev, i would like to see the code for reference.

i have looked at a few videos about this, and it seems you need to be able to code in parallel for the graphics card, for this to work effectively, so that several pixels are calculated at the same time. has playbasic got commands to do this?

   thanks, stevmjon
Logged

re-starting my platform game from scratch...determined to release a demo!
...if i can stop playing 'Skyrim' that is. oh look, another game expansion. must download now.
Member
Development Team


WWW
« Reply #17 on: April 10, 2017, 09:47:11 AM »

Quote
i have looked at a few videos about this, and it seems you need to be able to code in parallel for the graphics card, for this to work effectively, so that several pixels are calculated at the same time. has playbasic got commands to do this?

  They're most likely talkings about shaders..  Old hardware renders are fixed function pipeline,  which is what it sounds like, the old device has a chunk of logic to render a triangle (or a DOT/LINE etc etc or each surface stype).   The issue with those is the more effects they need to jam in the bigger foot print of the GPU..

   So they move to the shaders about DX9..  These are user defined code code fragments that run on the GPU.  They used to be very limited in terms of size and speed..  but today high end GPU's are like like a rats nest of shader units..  So  shader code runs in parallel across as many many shader units at time as possible. So rather doing one texel at time they can do many.

  You could do shader via OpenGL ..    In other words do all your scene and just render meshes...  Which is how GL apps work anyway..  


  G2D - 2D OpenGL library for PlayBASIC V1.64P (login required)

  
Logged

Member
Development Team


WWW
« Reply #18 on: April 11, 2017, 09:32:08 PM »

 Z buffered gouraud shading in PB V1.65 runtime  :  get Source Code



PB165-Z buffered Gouraud Shading.jpg (79.57 KB, 816x639 - viewed 8 times.)

PB165-Z buffered Gouraud Shading-V002.jpg (69.92 KB, 813x639 - viewed 6 times.)
Logged

Member

« Reply #19 on: April 12, 2017, 02:47:50 AM »

that looks good kev.

can you post the code?

just a question, i am not too sure about part 3 in my pic. it seems you need to squish the frustum down the z to form a cube. that i understand, but the z values are too high and bunched up(0.8 to 1.0). only the points very close to the camera get lower values. not sure if you are supposed to center part 2 in the 3D world then do part 3?

NOTE: the formulas in the pic are only there as reference. i don't expect you to calculate them (i know you get busy). just wondering if my theory is correct.

thanks,  stevmjon








perspective grid_1.png (80.32 KB, 1440x1000 - viewed 9 times.)
Logged

re-starting my platform game from scratch...determined to release a demo!
...if i can stop playing 'Skyrim' that is. oh look, another game expansion. must download now.
Member
Development Team


WWW
« Reply #20 on: April 12, 2017, 04:50:58 AM »


  The code was posted to the source code board ..  Smiley
Logged

Pages: 1 [2]
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.13 | SMF © 2006-2009, Simple Machines LLC | Privacy Policy Valid XHTML 1.0! Valid CSS!