A Powder GPU [ideas]

  • QuanTech
    27th Dec 2016 Member 1 Permalink

    Hello. Hi. Greetings. I've been thinking if it would be possible to implement a very simple programmable GPU in TPT. It would have its own interpreter to make life easier. I know mark2222 has already made a GPU, but this would be different. The GPU would utilize some stages of the Graphics Pipeline. Code lines are just examples of what the code for what the GPU code could look like. Let meh explain:

    The Graphics Pipeline

    The graphics pipeline is a bunch of steps that a computer takes to render 2d or 3d objects on your screen. Here are some of the steps that could be implemented in TPT:

    Vertex Data Input

    In this stage, the data (x,y coords) for the vertices (corners) of a shape enter the GPU.

    LoadVertexData(3,4);

    Primitives Creation

    Primitives are extremely basic shapes that can compose larger, more complex shapes. In this case, you'd probably just use triangles. You can make any 3d or 2d shape out of triangles. At this stage, the vertex coordinates are linked together as instructed by the programmer to form said primitives.

    CreatePrimitive((1,3)(2,7)(3,4));

    Coloring/Shading

    Shading would probably be insanely hard to implement, so we could stick with solid colors. So the programmer would enter a color for each primitive, and the GPU would color each primitive as instructed!

    Color(Primitive1,0xFF00FF);

    Transformations

    Oh boy. A transformation is basically a movement of a shape (e.g. rotation, sliding, flipping, etc.) This would probably require matrix multiplication, so idk. This stage is optional.

    Textures!(verrry optional)

    Ah. At this stage, a programmer could enter a filename for a 32x32 pixel* image in the interpeter, and the pixels in the image would be converted into FILT ctypes and placed on the FILT screen.


    I posted this because I thought it'd be great if people (including me) could work together and think up ways to implement this GPU. 

    Thanks in advance. -QuanTech

    Edited 4 times by QuanTech. Last: 28th Dec 2016
  • QuanTech
    28th Dec 2016 Member 0 Permalink

    Status update!

    Well, it seems nobody is interested so far, and I'm the only one working on it now :(. But for those who want to know how much has been done so far:

     

    Interpreter side:

     

      The opcodes for the very basic GPU instructions have been sorted out
      The interpreter can now write to a FRAM those opcodes (still some work needed)
      A program would look like this (I still need to make a parser):


    "LoadVertexData",3,4
    "CreatePrimitive",15,3,4,17,8,9
    "Color",3,2,4

    Yeah I know, too many commas.

     

    Hardware Side:


    Well, no hardware has been built yet, as I am working on the interpreter first. But the plan is to make a 50 by 31 pixel FRAM where the opcodes can be fetched and executed.

     

    Any help with this project would be much appreciated and would accelerate progress greatly.

    Edited 2 times by QuanTech. Last: 29th Dec 2016