Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to define a glass/gold/metal Texture? #257

Open
laikee99 opened this issue Jun 8, 2023 · 0 comments
Open

How to define a glass/gold/metal Texture? #257

laikee99 opened this issue Jun 8, 2023 · 0 comments

Comments

@laikee99
Copy link

laikee99 commented Jun 8, 2023

Hi, I was wandering how to define such texture in pyrender,
In hunterloftis/pbr, use such code to define:

func Glass(roughness float64) *Uniform {
	return &Uniform{
		Color:        rgb.Energy{1, 1, 1},
		Roughness:    roughness,
		Specularity:  0.042,
		Transmission: 0.91339,
	}
}

func ColoredGlass(r, g, b, roughness float64) *Uniform {
	return &Uniform{
		Color:        rgb.Energy{r, g, b},
		Roughness:    roughness,
		Specularity:  0.042,
		Transmission: 0.91339, // https://www.shimadzu.com/an/industry/electronicselectronic/chem0501005.htm
	}
}

func Gold(roughness, metalness float64) *Uniform {
	return &Uniform{
		Color:     rgb.Energy{1, 0.86, 0.57},
		Metalness: metalness,
		Roughness: roughness,
	}
}

func Mirror(roughness float64) *Uniform {
	return &Uniform{
		Color:     rgb.Energy{0.8, 0.8, 0.8},
		Metalness: 1,
		Roughness: roughness,
	}
}

func Copper(roughness, metalness float64) *Uniform {
	return &Uniform{
		Color:     rgb.Energy{0.98, 0.82, 0.76},
		Metalness: metalness,
		Roughness: roughness,
	}
}

In pyrender, I am confused about the param I should pass, can anyone give me a hint about that? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant