Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/cmake/testing.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@ macro (osl_add_all_tests)
render-mx-medium-vdf
render-mx-medium-vdf-glass
render-microfacet render-oren-nayar
render-shaderball
render-spi-thinlayer
render-uv render-veachmis render-ward
render-raytypes
Expand Down
73 changes: 73 additions & 0 deletions testsuite/common/models/shaderball/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<!-- Copyright Contributors to the Open Shading Language project. -->
<!-- SPDX-License-Identifier: CC-BY-4.0 -->

Standard Shader Ball
====================

The geometry in this directory is derived from the **StandardShaderBall**
asset published by the USD Working Group:

https://github.com/usd-wg/assets/tree/main/full_assets/StandardShaderBall

The matching textures live in `testsuite/render-shaderball/maps` and come
from the same asset.


Credits
-------

* Chris Rydalch — geometry and textures
* André Mazzone — specification and validation
* Thomas Anagnostou — original scene, inspiration, and consultation

Per the upstream README, the asset descends from the "Simball" / "Material
Preview" scene created by Thomas Anagnostou, which was originally released
under a Creative Commons Attribution-ShareAlike license. The USD Working
Group asset is released under Creative Commons Attribution 4.0.


License
-------

This material is licensed under the Creative Commons Attribution 4.0
International License (`SPDX-License-Identifier: CC-BY-4.0`).

To view a copy of this license, visit
https://creativecommons.org/licenses/by/4.0/ or send a letter to
Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.

The upstream license file is at:
https://github.com/usd-wg/assets/blob/main/full_assets/StandardShaderBall/LICENCE

Note that this is a different license from the BSD-3-Clause license that
covers OSL's own source code. See the repository's `THIRD-PARTY.md`.
Comment on lines +42 to +43

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The OSL project uses 2 standard licenses: BSD-3-Clause for code, and CC-BY-4.0 for docs and other non-code things. We mention this and link to the CC pages in the main README.md of this project. So you aren't adding any new or different kinds of licenses here, and I think you can just minimally note that the original data the shaderball file is derived from was also CC-BY-4.0 and give a link to the usd-wg repo where it lives.



Modifications
-------------

`shaderball.obj` and `shaderball.mtl` are **modified** from the upstream
asset. The upstream asset is distributed as USD with MaterialX shading
networks; OSL's `testrender` reads Wavefront OBJ, so the scene was imported
into Blender 3.4.1 and re-exported as OBJ + MTL. The changes are:

* **Format conversion**, USD to Wavefront OBJ. The USD stage is flattened
into a single file, with each mesh written as an OBJ group.

* **Triangulation.** All faces in the exported mesh are triangles.
UVs and normals are preserved.

* **Shading networks removed.** The upstream MaterialX networks are not
carried over. The exported `.mtl` retains the upstream *material names*,
which `testrender` uses to bind OSL shader groups.

* **Emissive geometry added.** The upstream asset lights its scene with
USD area lights, which are analytic and are not representable
in Wavefront OBJ. `testrender` has no area lights either, instead it
illuminates a scene with emissive geometry. Light-emitting planes
were added in their place, positioned to match the upstream light
transforms. These are the `emitterTop0`--`emitterTop3` and
`emitterLeft0` groups.

Apart from the added emissive planes, no changes were made to the shape of
the modeled geometry beyond the triangulation performed by the exporter.
129 changes: 129 additions & 0 deletions testsuite/common/models/shaderball/shaderball.mtl
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# StandardShaderBall, Copyright (c) Chris Rydalch, André Mazzone,
# and Thomas Anagnostou.
# https://github.com/usd-wg/assets/tree/main/full_assets/StandardShaderBall
# Licensed under CC BY 4.0: https://creativecommons.org/licenses/by/4.0/
# SPDX-License-Identifier: CC-BY-4.0
# Modified from the upstream USD asset: converted to Wavefront OBJ via
# Blender. See README.md in this directory for details.
# Blender 3.4.1 MTL File: 'shaderball-light-geo.blend'
# www.blender.org

newmtl back
Ns 0.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2

newmtl backplane
Ns 360.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2

newmtl emitterLeft
Ns 360.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2

newmtl emitterTop
Ns 360.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2

newmtl front
Ns 0.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2

newmtl ground
Ns 0.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2

newmtl left
Ns 0.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2

newmtl material_surface
Ns 360.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2

newmtl neutral
Ns 0.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2

newmtl right
Ns 0.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2

newmtl sss_bars
Ns 0.000000
Ka 1.000000 1.000000 1.000000
Kd 1.000000 1.000000 1.000000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2

newmtl top
Ns 0.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
Loading
Loading