pyrender icon indicating copy to clipboard operation
pyrender copied to clipboard

How to define a glass/gold/metal Texture?

Open laikee99 opened this issue 2 years ago • 0 comments

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

laikee99 avatar Jun 08 '23 04:06 laikee99