View Full Version : Software Rasterizer
06-11-2012, 07:01 AM
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!
06-11-2012, 08:14 AM
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 (http://www.opengl.org/sdk/docs/man/xhtml/glDrawPixels.xml).
06-11-2012, 09:11 AM
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.
06-11-2012, 02:48 PM
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).
06-11-2012, 10:39 PM
Thanks a lot for the suggestions. Since i'm planning to do everything from scratch, i'm guessing it would take quite some time.
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.