-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bump to 0.3.2: docs, add example, fix typing bug (#13)
* chore(.git-blame-ignore-revs): ignore formatting commits: adapting to isort, black, pyright * docs(readme): add badges, installation, usage, gallery * style(github-action): update CI names for better display in README badges * fix(geometry): type hinting bugs * fix(model): bug in merge specular maps * feat(examples): simple_cube: render a simple blue cube * build(pyproject): bump minimum jax, jaxlib version to 0.4.0 * docs(changelog): for 0.3.2 * ci(pyproject): bump to 0.3.2
- Loading branch information
Showing
13 changed files
with
190 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Migrate code style with isort | ||
ab8273d47c979b2a53d1e53908843f2055178686 | ||
# Migrate code style to Black | ||
a0e157decc3a729bdec493c9c432ad3a9a314175 | ||
# To pass Pyright type checks | ||
b77a15efc65f7750cefd89925feb855efe881fa0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import jax.numpy as jnp | ||
|
||
import renderer | ||
|
||
ImageWidth: int = 640 | ||
ImageHeight: int = 480 | ||
|
||
# Create a cube with texture map of pure blue | ||
cube = renderer.create_cube( | ||
half_extents=jnp.ones( # pyright: ignore[reportUnknownMemberType] | ||
3, dtype=jnp.single | ||
), | ||
texture_scaling=jnp.ones( # pyright: ignore[reportUnknownMemberType] | ||
2, dtype=jnp.single | ||
), | ||
diffuse_map=jnp.zeros( # pyright: ignore[reportUnknownMemberType] | ||
(2, 2, 3), dtype=jnp.single | ||
) | ||
.at[..., 2] | ||
.set(1), | ||
specular_map=jnp.ones( # pyright: ignore[reportUnknownMemberType] | ||
(2, 2), dtype=jnp.single | ||
) | ||
* 2.0, | ||
) | ||
|
||
# Render the cube | ||
image = renderer.Renderer.get_camera_image( | ||
objects=[renderer.ModelObject(model=cube)], | ||
# Simply use defaults | ||
camera=renderer.CameraParameters( | ||
viewWidth=ImageWidth, | ||
viewHeight=ImageHeight, | ||
position=jnp.array( # pyright: ignore[reportUnknownMemberType] | ||
[2.0, 4.0, 1.0], dtype=jnp.single | ||
), | ||
), | ||
# Simply use defaults | ||
light=renderer.LightParameters(), | ||
width=ImageWidth, | ||
height=ImageHeight, | ||
) | ||
|
||
import matplotlib.pyplot as plt | ||
|
||
fig, ax = plt.subplots() # pyright: ignore | ||
|
||
ax.imshow( # pyright: ignore[reportUnknownMemberType] | ||
renderer.transpose_for_display(image) | ||
) | ||
|
||
plt.show() # pyright: ignore[reportUnknownMemberType] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "jaxrenderer" | ||
version = "0.3.1" | ||
version = "0.3.2" | ||
description = "Jax implementation of rasterizer renderer." | ||
authors = ["Joey Teng <[email protected]>"] | ||
license = "Apache-2.0" | ||
|
@@ -33,9 +33,9 @@ include = [ | |
|
||
[tool.poetry.dependencies] | ||
python = "^3.8" | ||
jax = ">=0.3.25,<5.0.0" | ||
jax = "^0.4.0" | ||
numpy = "^1.22.0" | ||
jaxlib = {version = ">=0.3.25,<5.0.0", source = "jax"} | ||
jaxlib = {version = "^0.4.0", source = "jax"} | ||
jaxtyping = [ | ||
{version = ">=0.2.13,<0.2.20", python = ">=3.8,<3.9"}, | ||
{version = "^0.2.19", python = "^3.9"} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters