Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
88ead37
Adding missing stubs
isVoid Jan 12, 2022
eef4703
Merge branch 'grm-numba-triangle' of github.com:gmarkall/PyOptiX into…
isVoid Jan 12, 2022
9fd65c3
optix trace is working...?
isVoid Jan 12, 2022
ac4e52a
Implemented __miss_ms
isVoid Jan 18, 2022
3e19bf8
get_triangle_barycentrics
isVoid Jan 18, 2022
bf1f6bf
Rendered a black image
isVoid Jan 18, 2022
83524e7
minor cleanups and typo(bug) fixes
isVoid Jan 18, 2022
7332313
triangle!
isVoid Jan 19, 2022
cad88ef
Background!
isVoid Jan 19, 2022
7244cb9
First pass style format
isVoid Jan 19, 2022
52ec43c
Add style format config files
isVoid Jan 19, 2022
5418f8e
Add gitignore
isVoid Jan 19, 2022
289b9f7
Initial modularize numba supports
isVoid Jan 20, 2022
691270e
Getting pyramid example working
isVoid Jan 20, 2022
9c825c0
Consolidate triangle example to numba_support too
isVoid Jan 20, 2022
d69175a
Removing pre-commit files before syncing with upstream
isVoid Jan 20, 2022
74a30e2
Removing pyramid example
isVoid Jan 21, 2022
049937d
Use fast_powf and fast_math, 50% speedup.
isVoid Jan 24, 2022
4be3b25
Use automation to create vector types and factory functions.
isVoid Feb 4, 2022
4d16c3b
Automatically generate ops between primitve x vector_type, and vector…
isVoid Feb 4, 2022
0d377ad
docstrings
isVoid Feb 4, 2022
a2a6c89
A few minor notes
isVoid Feb 4, 2022
3f4a145
Get correct `fastmath` behavior based on dc73113981f919144b4e6efd87a7…
isVoid Feb 13, 2022
09295e4
Use IntEnum
isVoid Feb 25, 2022
117529f
Update readme with triangle example
isVoid Feb 25, 2022
4bbf284
Move vector maths to vec_math.py
isVoid Feb 25, 2022
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
31 changes: 17 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,32 +45,35 @@ pip3 install --global-option build --global-option --debug .
The example can be run from the examples directory with:

```
python examples/hello.py
python examples/<example_name>.py
```

If the example runs successfully, a square will be rendered:
If the example runs successfully, the example output will be rendered:

![Example output](example_output.png)
![Hello output](example_output.png)
![Triangle output](triangle.png)

Currently supported examples:
- hello.py
- triangle.py

## Explanation

The Python implementation of the OptiX kernel and Numba extensions consists of
three parts, all in [examples/hello.py](examples/hello.py):

- Generic OptiX extensions for Numba - these implement things like
`GetSbtDataPointer`, etc., and are a sort of equivalent of the implementations
in the headers in the OptiX SDK.
- The user's code, which I tried to write exactly as I'd expect a PyOptiX Python
user to write it - it contains declarations of the data structures as in
hello.h, and the kernel as in hello.cu - you can, in this example modify the
Python `__raygen__hello` function and see the changes reflected in the output
image.
three parts:

- Generic OptiX extention types for Numba. These include new types introduced in
the OptiX SDK. They can be vector math types such as `float3`, `uint4` etc. Or it
could be OptiX intrinsic methods such as `GetSbtDataPointer`. These are included in
examples/numba_support.py. We intend to build more examples by reusing these extensions.
- The second part are the user code. These are the ray tracing kernels that user
of PyOptiX will write. They are in each of the example files, such as `hello.py`,
`triangle.py`.
- Code that should be generated from the user's code - these tell Numba how to
support the data structures that the user declared, and how to create them
from the `SbtDataPointer`, etc. I've handwritten these for this example, to
understand what a code generator should generate, and because it would have
taken too long and been too risky to write something to generate this off the
bat. The correspondence between the user's code and the "hand-written
generated" code is mechanical - there is aclear path to write a generator for
generated" code is mechanical - there is a clear path to write a generator for
these based on the example code.
Loading