Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 5 of 5

Thread: Software Rasterizer

  1. #1
    Intern Contributor
    Join Date
    Jan 2012
    Posts
    65

    Software Rasterizer

    Hello All!

    I am planning on writing a software rasterizer. I searched for some tips on the internet. i found people implementing it on SDL. I was wondering if i can use glut as my window toolkit to achieve the same. So, i would just need it as the rendering surface. (This is just for learning purpose). Everything else would come from the rasterizer. So, is it possible to somehow do this using glut?

    Thanks in advance!

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Dec 2007
    Location
    Hungary
    Posts
    941
    If performance doesn't matter that much for you, you can simply use glut or any other framework that provides you an OpenGL window and then simply blit your pixel array resulting from the software rasterizer using glDrawPixels.
    Disclaimer: This is my personal profile. Whatever I write here is my personal opinion and none of my statements or speculations are anyhow related to my employer and as such should not be treated as accurate or valid and in no case should those be considered to represent the opinions of my employer.
    Technical Blog: http://www.rastergrid.com/blog/

  3. #3
    Advanced Member Frequent Contributor
    Join Date
    Jan 2007
    Posts
    965
    Alternatively write from your system memory framebuffer into a texture (using glTexSubImage2D), then draw that to screen as a full-screen quad, which might give better performance. You could even get sexy and implement brightness controls, blurs or other post-processing in hardware.

  4. #4
    Member Regular Contributor
    Join Date
    Jan 2012
    Location
    Germany
    Posts
    302
    I would also suggest rendering it as a fullscreen quad texture (if performance isn't so important - on the other hand your software rasterize might still be the bottleneck, not GL).
    Rendering it as a texture would give you nearest filtered zoom, brightness control and other simple shader tricks that might help debugging your software rasterizer (also rendering the same geometry in GL and see if your software approach produces the same result - i one used a similar framework for my first simple ray-tracer to check that i got the transformations right... ah, memories).

  5. #5
    Intern Contributor
    Join Date
    Jan 2012
    Posts
    65
    @All:

    Thanks a lot for the suggestions. Since i'm planning to do everything from scratch, i'm guessing it would take quite some time.

    Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •