Javascript Ray Marcher v0.14
◆
So many new usability features. The best is that there is now a "Go" button below, that you can use to start the render. When you click "Go", the contents of the configuration box will be parsed and turned into a scene. The raymarcher is now usable without having to edit a code file.
Fixed camera perspective, added a floodfill renderer option that doesn't work.
DebugDivxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Some big experiments in this version, like flood fill rendering. This attempts to speed up rendering by rendering out of order, and following the pixels that are close to the same depth. The idea being that this reduces the number of checks, by skipping the journey from the camera to the surface, and instead looking for a surface at the same depth as nearby pixels.
This does provide a nice speedup, but it caused graphical glitches. If one object was in front of another, the algorithm sometimes locked onto the background object, and failed to render the foreground object.
So ultimately I had to drop it.
To support flood fill, I also added extra controls for the rays, giving options on where the ray starts, finishes, and the step size.
It is now possible to specify the scene in the text box, using the shapes listed below.
I did a few internal changes like fix the camera to the Z-axis and rotate the scene, so rather than having a proper general solution, I could special case many of the vector and surface finding routines to work the best in one direction.
Primitives
These are the shapes available to use in the scene. Almost all shapes work the same way:
Primitive (x,y,z,scale,Red,Green,Blue)
Red, Green and Blue must be between 0.0 and 1.0. So to draw a blue sphere of radius 3, use:
Sphere(0,0,0, 3, 0.0,0.0,1.0)
The shapes available are:
- Sphere
- BlobCylinder
- Cylinder( x1, y1, z1, x2,y2,z2, x3,y3,z3,radius, red, blue, green)
- Lsystem
- PointCloud
- Triangle ( x1, y1, z1, x2,y2,z2, x3,y3,z3,thickness, red, blue, green)
- Tetrahedron ( x1, y1, z1, x2,y2,z2, x3,y3,z3,thickness, green, blue, green)
- Terrain - everything y<0
- Square - actually a cube, radius is from centre to face of cube.