Recent

Author Topic: Just checked out the 3D demo: WOW!  (Read 2791 times)

Leledumbo

  • Hero Member
  • *****
  • Posts: 8114
  • Programming + Glam Metal + Tae Kwon Do = Me
Just checked out the 3D demo: WOW!
« on: June 04, 2012, 11:00:07 am »
At first I thought it uses OpenGL / something else backend, but after looking at the source, it seems like everything is self drawn! It's quite fast despite the software level rendering used, but is there any plan on using hardware acceleration? There's almost never enough "fast" for programmers :-[

circular

  • Hero Member
  • *****
  • Posts: 3058
    • Personal webpage
Re: Just checked out the 3D demo: WOW!
« Reply #1 on: June 04, 2012, 02:12:50 pm »
Thanks. Well no there is no plan to use hardware acceleration. At least by me.  :)

In fact my philosophy is to do everything with Pascal, and possibly assembler. So I implemented everything I found useful : lighting effect, gouraud, transparency, Z buffer.

There could be some enhancements of course, notably shadow casting. But this is a very complex issue. Bump mapping too could be added, but it could be too slow. So basically I think you can find everything that is at the same time necessary/useful, and fast enough to be rendered without hardware acceleration.

I would like to add more support for 3D files. It can read obj files, but very basic ones. It could be useful to read material definitions (mtl) of obj files. And read other 3D formats. Maybe code from Asphyre Sphinx library for this could be inserted in some way.

As far as assembler optimization is concerned, I've added SSE3, which is a little faster, but not so much. Maybe some optimization can be done, or other special instructions used like SSE4 or AVX. But I feel lazy about it (and in fact, I don't have so much free time).

Apparently there is a problem of compilation under MacOS. But this is kind of mysterious. I guess this is rather a compiler issue. It's in the following topic:
http://www.lazarus.freepascal.org/index.php/topic,16584.0.html
Conscience is the debugger of the mind