Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
â—‹CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
â—‹.zenodo.json file
-
â—‹DOI references
-
â—‹Academic publication links
-
â—‹Academic email domains
-
â—‹Institutional organization owner
-
â—‹JOSS paper metadata
-
â—‹Scientific vocabulary similarity
Low similarity (9.4%) to scientific vocabulary
Keywords
Repository
🎦 3D renderer in Go.
Statistics
- Stars: 19
- Watchers: 2
- Forks: 1
- Open Issues: 1
- Releases: 0
Topics
Metadata Files
readme.md
go-render
A simple renderer (rasterization-based) written in Go.
The OG tinyrenderer project helped me alot. It's amazing stuff, and I highly recommend everyone check it out.
Usage
The code is pretty self-contained. I only used a 3rd-party library imaging to flip images vertically.
To do your custom render:
go run render.go <path to .obj file> <path to texture file>
For example, see run.sh:
go run data/obj/bunny_2.obj data/textures/bunny_texture.jpg
Of course, you can first build render.go, and then run the executable:
go build render.go
./render <path to .obj file> <path to texture file>
Customization
You could also play with some other parameters (light direction, camera position, spectral lighting, and etc) in render.go.
- eye: The camera position. Default is (0, 0, 1).
- center: Position the camera is looking at Default is (0, 0, 0).
- up: The vertical axis of the camera. Default is (0, 1, 0), which is the y-axis.
- lightDir: Light ray direction. Default is (0, 0, -1), which means the light is parellel to user's eye.
- specCoeff: Weight of spectral lighting. (For the shiny dragon above, I used 20.0)
- imageHeight: Pixel height of output image.
- background: Whether to color output image background black. If not, then output image has transparent background.
- outFile: Render output file path.
- defaultFill: If no texture is specified, use this color.
Demo
Basics
|||
|--|--|
|Wireframe|Triangle rasterization|
|
|
|
Shading
|Flat shading|Gouraud shading|Phong shading|
|--|--|--|
|
|
|
|
|
|
|
|
Perspective
|||||
|--|--|--|--|
|
|
|
|
|
Textures
Kudos to the author of this article for providing custom Stanford bunny texture files.
|Colored|Terracotta|
|--|--|
|
|
|
Camera
|||||
|--|--|--|--|
|
|
|
|
|
|
|
|
|
|
Light
|||||
|--|--|--|--|
|
|
|
|
|
|
|
|
|
Specular lighting
The stronger specular lighting is, the more "glossy" the object surface becomes. I simply used uniform power for each pixel since specular intensity is not specified in my texture files.
|No specular|Some specular (used)|Intense specular|
|--|--|--|
|
|
|
|
.obj sources
- https://www.prinmath.com/csci5229/OBJ/index.html
- https://people.sc.fsu.edu/~jburkardt/data/obj/obj.html
- https://groups.csail.mit.edu/graphics/classes/6.837/F03/models/
- https://casual-effects.com/data/
- https://github.com/alecjacobson/common-3d-test-models
Owner
- Name: Brian Chao
- Login: bchao1
- Kind: user
- Location: Stanford, California
- Company: Stanford University
- Website: https://bchao1.github.io
- Twitter: BrianCChao
- Repositories: 14
- Profile: https://github.com/bchao1
Stanford Ph.D. student. Research in computational photography, displays, and computer graphics. Open source enthusiast.
GitHub Events
Total
Last Year
Issues and Pull Requests
Last synced: 10 months ago
All Time
- Total issues: 1
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 1
- Total pull request authors: 0
- Average comments per issue: 0.0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- exprez135 (1)
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
- Total downloads: unknown
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 1
proxy.golang.org: github.com/bchao1/go-render
- Homepage: https://github.com/bchao1/go-render
- Documentation: https://pkg.go.dev/github.com/bchao1/go-render#section-documentation
-
Latest release: v0.0.0-20200818094245-c9a30a3363b5
published over 5 years ago