bobzhang/p5/webgl does not have a README file
pub struct Camera {
width : Double
height : Double
camera_type_default : Bool
use_line_perspective : Bool
camera_matrix : Matrix
proj_matrix : Matrix
y_scale : Double
eye_x : Double
eye_y : Double
eye_z : Double
center_x : Double
center_y : Double
center_z : Double
up_x : Double
up_y : Double
up_z : Double
camera_fov : Double
aspect_ratio : Double
camera_near : Double
camera_far : Double
default_aspect_ratio : Double
default_eye_z : Double
default_camera_fov : Double
default_camera_near : Double
default_camera_far : Double
}pub(all) enum DrawMode {
Triangles
TriangleStrip
TriangleFan
}pub struct Filter2D {
// private fields
}fn Filter2D::pass(self : Filter2D, op : String, param : Double?, direction : (Double, Double), src : ImageElement, w : Double, h : Double, density : Double, user? : Shader) -> ImageElement?pub struct Framebuffer {
width : Double
height : Double
density : Double
antialias : Bool
default_camera : Camera
// private fields
}pub(all) struct FramebufferOptions {
width : Double?
height : Double?
density : Double?
antialias : Int?
depth : Bool
stencil : Bool
depth_float : Bool
alpha : Bool?
linear : Bool
}pub struct GLState {
model : Matrix
view : Matrix
proj : Matrix
camera : Camera
normal_material : Bool
enable_lighting : Bool
ambient_light_colors : Array[Double]
specular_colors : Array[Double]
directional_directions : Array[Double]
directional_diffuse : Array[Double]
directional_specular : Array[Double]
point_positions : Array[Double]
point_diffuse : Array[Double]
point_specular : Array[Double]
spot_positions : Array[Double]
spot_directions : Array[Double]
spot_diffuse : Array[Double]
spot_specular : Array[Double]
spot_angle : Array[Double]
spot_conc : Array[Double]
constant_attenuation : Double
linear_attenuation : Double
quadratic_attenuation : Double
ambient_color : FixedArray[Double]
specular_color : FixedArray[Double]
emissive_color : FixedArray[Double]
has_set_ambient : Bool
use_specular : Bool
use_emissive : Bool
shininess : Double
metalness : Double
tint : FixedArray[Double]
fill_shader : Shader?
stroke_shader : Shader?
tex : TexSource?
image_shader : Shader?
texture_mode_normal : Bool
wrap_x : String
wrap_y : String
image_light : TexSource?
specular_tex : TexSource?
ambient_tex : TexSource?
shininess_tex : TexSource?
normal_tex : TexSource?
normal_scale : Double
normal_map_mode : Int
}pub struct Geometry {
gid : String
detail_x : Int
detail_y : Int
vertices : Array[Vec3]
vertex_normals : Array[Vec3]
uvs : Array[Double]
faces : Array[(Int, Int, Int)]
edges : Array[(Int, Int)]
vertex_colors : Array[Double]
vertex_stroke_colors : Array[Double]
line_vertices : Array[Double]
line_tangents_in : Array[Double]
line_tangents_out : Array[Double]
line_sides : Array[Double]
line_vertex_colors : Array[Double]
vertex_tangents : Array[Double]
user_props : Array[VertexProperty]
parts : Array[Geometry]
part_state : PartState?
// private fields
}fn Geometry::compute_normals(self : Geometry, mode? : NormalMode, round_to_precision? : Int) -> Geometrypub struct Material {
diffuse : (Double, Double, Double)?
ambient : (Double, Double, Double)?
specular : (Double, Double, Double)?
shininess : Double?
opacity : Double?
illumination : Int?
texture_path : String?
ambient_texture_path : String?
specular_texture_path : String?
shininess_texture_path : String?
bump_texture_path : String?
normal_texture_path : String?
bump_scale : Double?
texture : TexSource?
ambient_texture : TexSource?
specular_texture : TexSource?
shininess_texture : TexSource?
bump_texture : TexSource?
normal_texture : TexSource?
}pub(all) enum NormalMode {
KeepConnections
Smooth
}pub struct PartState {
fill : FixedArray[Double]?
ambient : FixedArray[Double]?
specular : FixedArray[Double]?
shininess : Double?
texture : TexSource?
specular_texture : TexSource?
ambient_texture : TexSource?
shininess_texture : TexSource?
normal_texture : TexSource?
normal_scale : Double
normal_map_mode : Int
}pub struct Renderer3D {
gl : GL
width : Double
height : Double
density : Double
state : GLState
main_camera : Camera
canvas : ImageElement
antialias : Bool
curve_detail : Double
simple_lines : Bool
instance_count : Int
// private fields
}fn Renderer3D::camera(self : Renderer3D, eye? : (Double, Double, Double), center? : (Double, Double, Double), up? : (Double, Double, Double)) -> Unitfn Renderer3D::create_framebuffer(self : Renderer3D, options : FramebufferOptions, default_antialias : Bool) -> Framebufferfn Renderer3D::directional_light(self : Renderer3D, r : Double, g : Double, b : Double, x : Double, y : Double, z : Double) -> Unitfn Renderer3D::draw_geometry(self : Renderer3D, g : Geometry, style : Style, mode? : DrawMode, count? : Int, skip_fill? : Bool) -> Unitfn Renderer3D::draw_scaled(self : Renderer3D, g : Geometry, sx : Double, sy : Double, sz : Double, style : Style) -> Unitfn Renderer3D::draw_shape(self : Renderer3D, kind : ShapeKind, contours : Array[Array[Pt]], style : Style, count? : Int, user_layout? : Array[(String, Int)]) -> Unitfn Renderer3D::filter(self : Renderer3D, op : String, param : Double?, style : Style, user : Shader?) -> Unitfn Renderer3D::frustum(self : Renderer3D, left? : Double, right? : Double, bottom? : Double, top? : Double, near? : Double, far? : Double) -> Unitfn Renderer3D::image(self : Renderer3D, src : TexSource, sx : Double, sy : Double, sw : Double, sh : Double, dx : Double, dy : Double, dw : Double, dh : Double, style : Style) -> Unitfn Renderer3D::light_falloff(self : Renderer3D, constant : Double, linear : Double, quadratic : Double) -> Unitfn Renderer3D::new(gl : GL, canvas : ImageElement, antialias : Bool, width : Double, height : Double, density : Double) -> Renderer3Dfn Renderer3D::ortho(self : Renderer3D, left? : Double, right? : Double, bottom? : Double, top? : Double, near? : Double, far? : Double) -> Unitfn Renderer3D::perspective(self : Renderer3D, fovy? : Double, aspect? : Double, near? : Double, far? : Double) -> Unitfn Renderer3D::point_light(self : Renderer3D, r : Double, g : Double, b : Double, x : Double, y : Double, z : Double) -> Unitfn Renderer3D::read_pixels(self : Renderer3D, x : Int, y : Int, w : Int, h : Int) -> FixedArray[Byte]fn Renderer3D::render_text(self : Renderer3D, font_key : String, data : FontData, line : String, x : Double, y : Double, size : Double, fill : FixedArray[Double], style : Style) -> Unitfn Renderer3D::rotate(self : Renderer3D, angle : Double, x : Double, y : Double, z : Double) -> Unitfn Renderer3D::spot_light(self : Renderer3D, r : Double, g : Double, b : Double, position : (Double, Double, Double), direction : (Double, Double, Double), angle? : Double, concentration? : Double) -> Unitfn Renderer3D::texture_filter(self : Renderer3D, src : TexSource, downscale : String, upscale : String) -> Unitfn Renderer3D::texture_map(self : Renderer3D, which : TextureMap, src : TexSource?, scale? : Double) -> Unitpub(all) enum ShapeMode {
PathMode
PointsMode
LinesMode
TrianglesMode
TriangleFanMode
TriangleStripMode
QuadsMode
QuadStripMode
}pub(all) struct Style {
fill : FixedArray[Double]?
stroke : FixedArray[Double]?
stroke_weight : Double
stroke_cap : Int
stroke_join : Int
blend_mode : String
erasing : Bool
}pub(all) enum TextureMap {
SpecularMap
AmbientMap
ShininessMap
NormalMap
BumpMap
}fn filter_vertex_source(frag : String) -> Stringfn js_string(x : Double) -> Stringfn quad_geometry(p1 : (Double, Double, Double), p2 : (Double, Double, Double), p3 : (Double, Double, Double), p4 : (Double, Double, Double), detail_x : Int, detail_y : Int) -> GeometryInstall
Download zipA port of p5.js 2.x to MoonBit (JS backend): 2D canvas and WEBGL, fonts, SVG, GIF, shaders; pixel-identical with p5.js on its parity suite.