Hiya, sorry for the newbie question, but I couldn’t find a good answer for this anywhere.
Basically I want to try to experiment a bit with building my own tiny (realtime) 3D rendering engine in java. I’d like to have a screen, then want to calculate a color for every pixel, and drop them on the screen.
It’s the last part, just putting the pixels on screen, that’s giving me some trouble. Methods like .drawRect() or .drawLine() on graphics objects for one pixel just feel way to slow. Even just iterating over all pixels and setting them to one color is way too slow. I’m looking for the fastest way of doing it, with as low of a level as necessary. Manipulating a large byte array representing colors for example would be great if that’s the fastest way of doing it. The only requirement besides speed is that it must allow me to calculate the pixels myself (so no libraries that have you send models/polygons over)
I don’t particularly care what the pixels are drawn on, as long as whoever is using the program can actually see what I’m drawing in real time. Small bonus points are given if it also works on Android (with minor modifications), but it’s really speed that’s most important to me here.
Of course the speed would be much higher if I can offload calculations to the GPU, so ideally this method allows me to use one.
What are my options here?