Add a -transparent-dim=percent flag to set the extra dimming of transparent materials each depth meter.

This commit is contained in:
Sascha L. Teichmann
2015-07-26 11:55:38 +02:00
parent 68bb1ee320
commit e1eb03813f
7 changed files with 81 additions and 37 deletions

View File

@ -27,6 +27,7 @@ func main() {
shaded bool
transparent bool
cpuProfile string
transparentDim float64
)
flag.IntVar(&port, "port", 6379, "port to of mtredisalize server")
@ -46,6 +47,9 @@ func main() {
flag.StringVar(&outfile, "o", "out.png", "image file of result (shorthand)")
flag.BoolVar(&shaded, "shaded", true, "draw relief")
flag.BoolVar(&transparent, "transparent", false, "render transparent blocks")
flag.Float64Var(
&transparentDim, "transparent-dim", common.DefaultTransparentDim*100,
"Extra dimming of transparent nodes every depth meter in percent (0-100).")
flag.StringVar(&cpuProfile, "cpuprofile", "", "write cpu profile to file")
flag.Parse()
@ -66,6 +70,9 @@ func main() {
log.Fatalf("Cannot open color file: %s", err)
}
colors.TransparentDim = common.Clamp32f(
float32(transparentDim/100.0), 0.0, 100.0)
address := fmt.Sprintf("%s:%d", host, port)
var client *common.RedisClient