Sets user-defined shaders (programs written in GLSL) for customized display of RGL objects. Currently only supported in WebGL displays, as the regular displays do not support GLSL.
setUserShaders(ids, vertexShader = NULL, fragmentShader = NULL, attributes = NULL, uniforms = NULL, scene = scene3d(minimal), minimal = TRUE)
Which objects should receive the shaders.
The vertex and fragment shader source code. If
A named list of “attributes” to attach to each vertex.
A named list of “uniforms”.
Modern versions of OpenGL work with “shaders”, programs written to run on the graphics processor. The vertex shader does the calculations to move vertices and set their intrinsic colours. The fragment shader computes how each pixel in the display will be shown, taking into account lighting, material properties, etc. (More precisely, it does the computation for each “fragment”; a fragment is a pixel within an object to display. There may be many objects at a particular location, and each will result in a fragment calculation unless culled by z-buffering or being discarded in some other way.)
A modified version of the
rglwidget for display of the scene in WebGL.