- For built-in fragment shader outputs, a new field
use_default_depth
is added (defaultFalse
) instead of relying on checking ifgl_FragDepth
isNaN
. - Change
ZBuffer
value meaning to OpenGL convention: all values are non-negative, and the smaller the value, the closer the point is to the camera. - Change default
Shader.mixer
behaviour: now it picks the fragment with minimum depth valuegl_FragDepth
. - Change
shadow.py::Shadow.render_shadow_map
according to the z-value definition change, to add into the shadow map instead of subtracting so to move shadow maps further away from the "camera" (light). - Change
shaders/phong_reflection_shadow
according to the z-value definition change. - Transform shadow coordinates in VS (world => NDC) and FS (NDC => screen) instead of transforming in FS (model's screen => world => screen) to avoid precision loss in inverse matrix computation.
- Fix issue of perspective-correction barycentric interpolation in
pipeline
. - Fix
shaders/phong*
so normals are correctly transformed into pre-projection eye coordinates, rather than being projected. - Rename
ModelView
=>View
,model_view
=>view
,model_view_matrix
=>view_matrix
as the matrix is actually view matrix that transforms from world to eye space, not model view matrix (model to eye space).
- Change the default behaviour of
renderer/utils.py::transpose_for_display
which will flip vertically as well by default, so the origin of the resultant matrix will be (height, width, channels) and with the origin located at the top-left corner. The previous behaviour can be achieved by settingflip_vertical=False
. Scene.add_cube
now accepts one number fortexture_scaling
to scale texture map equally in both x and y directions.- Fix some assert message issues (in
Scene.add_cube
). CameraParameters
now acceptsposition
,target
andup
in Python's tuples of floats as well, along withjnp.array
.Scene.set_object_orientation
andScene.set_object_local_scaling
supports tuple of floats as well as inputs, additional tojnp.array
.Model
now has a convenient methodcreate
to create a Model with same face indices shared byfaces
,faces_norm
andfaces_uv
, and a defaultspecular_map
. This is useful for creating a mesh where all vertices has its own normal and uv coordinate specified, under same order (thus same face indices).- Correctly support Python Sequence for
utils.build_texture_from_PyTinyrenderer
as texture. quaternion
function to create an orientation from axis and angle, andquaternion_mul
to composite quaternion.rotation_matrix
function to create a rotation matrix from axis and angle. Also allowsScene
to set object orientation directly using rotation matrix.- Move
Renderer.merge_objects
intogeometry.py
, and expose in__init__.py
. batch_models
andRenderer.create_buffers
convenient method to facilitate batch rendering of multiple models.