Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
P

pbr

> 编程语言
Open source

a Physically Based Renderer (PBR) in Go

1.2K stars0 likes0 views
WebsiteGitHub

About

a Physically Based Renderer (PBR) in Go

pbr: a golang 3D renderer

Package pbr implements Physically-Based Rendering via a unidirectional CPU-only Monte Carlo path tracer. pbr uses dep for dependency management.

bash
$ go get github.com/hunterloftis/pbr
$ dep ensure
$ make

More examples


Hello, World

go
func main() {
	floor := surface.UnitCube(material.Plastic(1, 1, 1, 0.05))
	floor.Shift(geom.Vec{0, -0.1, 0}).Scale(geom.Vec{10, 0.1, 10})
	ball := surface.UnitSphere(material.Gold(0.05, 1))
	ball.Scale(geom.Vec{0.1, 0.1, 0.1})

	c := camera.NewSLR().MoveTo(geom.Vec{0, 0, -0.5}).LookAt(geom.Vec{0, 0, 0})
	s := surface.NewList(ball, floor)
	e := env.NewGradient(rgb.Black, rgb.Energy{750, 750, 750}, 7)

	scene := render.NewScene(c, s, e)
	err := render.Iterative(scene, "hello.png", 898, 450, 8, true)
	if err != nil {
		fmt.Fprintf(os.Stderr, "\nError: %v\n", err)
	}
}

Features

  • Simple synchronous API, concurrent execution, 100% Go
  • A standalone CLI
  • .obj and .mtl meshes and materials (Wavefront)
  • .hdri environment maps (Radiance)
  • Physically-based materials (metalness/roughness workflow)
  • Texture maps (base, roughness, metalness)
  • Physically-based cameras (depth-of-field, f-stop, focal length, sensor size)
  • Direct, indirect, and image-based lighting
  • Progressive rendering

Related work

  • https://github.com/alexflint/go-arg
  • https://github.com/ftrvxmtrx/tga
  • https://github.com/Opioid/rgbe
  • https://github.com/fogleman/pt

CLI

…

Renders

All of these, and many more are in the Makefile. To render them yourself, you'll need the fixtures directory of 3D assets:

$ make fixtures

Note: the download is over a gigabyte!

Render Farm

The farm package provides a client and server for quickly spinning up a render farm. The client workers render a scene and POST samples to the server over HTTP. The server integrates the samples into a render which it returns at GET /.

To try out the 'toys' render farm example:

$ heroku create
$ heroku stack:set container
$ heroku labs:enable runtime-dyno-metadata
$ git push heroku master
$ heroku scale web=1:performance-l worker=10:performance-l
$ heroku open

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Go

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言