diff --git a/go.mod b/go.mod index 8a5153e..899f428 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/emer/emergent/v2 go 1.22 require ( - cogentcore.org/core v0.2.4-0.20240724010755-4f3adddb53a4 + cogentcore.org/core v0.3.2-0.20240808234819-3fb8d2cbe011 github.com/BurntSushi/toml v1.3.2 github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 github.com/iancoleman/strcase v0.3.0 @@ -19,10 +19,11 @@ require ( github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/aymerick/douceur v0.2.0 // indirect github.com/chewxy/math32 v1.10.1 // indirect + github.com/cogentcore/webgpu v0.0.0-20240808191559-eb41fd7f1eac // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dlclark/regexp2 v1.11.0 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect - github.com/go-gl/glfw/v3.3/glfw v0.0.0-20240307211618-a69d953ea142 // indirect + github.com/go-gl/glfw/v3.3/glfw v0.0.0-20240506104042-037f3cc74f2a // indirect github.com/goki/freetype v1.0.5 // indirect github.com/goki/vulkan v1.0.8 // indirect github.com/gorilla/css v1.0.1 // indirect @@ -41,14 +42,15 @@ require ( github.com/pelletier/go-toml/v2 v2.1.2-0.20240227203013-2b69615b5d55 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/rivo/uniseg v0.4.7 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/sergi/go-diff v1.3.1 // indirect golang.org/x/image v0.18.0 // indirect - golang.org/x/mod v0.18.0 // indirect - golang.org/x/net v0.26.0 // indirect + golang.org/x/mod v0.19.0 // indirect + golang.org/x/net v0.27.0 // indirect golang.org/x/sync v0.7.0 // indirect - golang.org/x/sys v0.21.0 // indirect + golang.org/x/sys v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect - golang.org/x/tools v0.22.0 // indirect + golang.org/x/tools v0.23.0 // indirect gonum.org/v1/gonum v0.15.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 189f519..b2a35f6 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -cogentcore.org/core v0.2.4-0.20240724010755-4f3adddb53a4 h1:3OHHiA0NCf+R1QpWq66i1ImaDYtud2xGunzlENN6dWs= -cogentcore.org/core v0.2.4-0.20240724010755-4f3adddb53a4/go.mod h1:Rs73REPCpU/Deh9HOrAwq5cbSSwLvtNEAZJZixSKpcs= +cogentcore.org/core v0.3.2-0.20240808234819-3fb8d2cbe011 h1:Zg1BELMsAL4mLdraAqRqrTx+7tqJYAMqngW92iyndqs= +cogentcore.org/core v0.3.2-0.20240808234819-3fb8d2cbe011/go.mod h1:3f1LPfTarLmmtfz8pJ6stWNIxj+I7NIxr4xwOXKLpfk= github.com/Bios-Marcel/wastebasket v0.0.4-0.20240213135800-f26f1ae0a7c4 h1:6lx9xzJAhdjq0LvVfbITeC3IH9Fzvo1aBahyPu2FuG8= github.com/Bios-Marcel/wastebasket v0.0.4-0.20240213135800-f26f1ae0a7c4/go.mod h1:FChzXi1izqzdPb6BiNZmcZLGyTYiT61iGx9Rxx9GNeI= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= @@ -24,6 +24,8 @@ github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuP github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= github.com/chewxy/math32 v1.10.1 h1:LFpeY0SLJXeaiej/eIp2L40VYfscTvKh/FSEZ68uMkU= github.com/chewxy/math32 v1.10.1/go.mod h1:dOB2rcuFrCn6UHrze36WSLVPKtzPMRAQvBvUwkSsLqs= +github.com/cogentcore/webgpu v0.0.0-20240808191559-eb41fd7f1eac h1:idqcxylMuWPmyQ3FIz2rtt7zYKlqxDLyEE8NQoCydgk= +github.com/cogentcore/webgpu v0.0.0-20240808191559-eb41fd7f1eac/go.mod h1:ciqaxChrmRRMU1SnI5OE12Cn3QWvOKO+e5nSy+N9S1o= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= @@ -38,8 +40,8 @@ github.com/dlclark/regexp2 v1.11.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cn github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20240307211618-a69d953ea142 h1:/4YI5K2b16JtP2cL4D2xDNvH/ESm2ZbGJ0VsudkHJ5s= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20240307211618-a69d953ea142/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20240506104042-037f3cc74f2a h1:vxnBhFDDT+xzxf1jTJKMKZw3H0swfWk9RpWbBbDK5+0= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20240506104042-037f3cc74f2a/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/goki/freetype v1.0.5 h1:yi2lQeUhXnBgSMqYd0vVmPw6RnnfIeTP3N4uvaJXd7A= github.com/goki/freetype v1.0.5/go.mod h1:wKmKxddbzKmeci9K96Wknn5kjTWLyfC8tKOqAFbEX8E= github.com/goki/vulkan v1.0.8 h1:yx7GPP3wZOFeJ25wEneHk08fOSlUz/wxHBBCiCB1G18= @@ -92,8 +94,8 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8= github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I= @@ -121,21 +123,21 @@ golang.org/x/exp v0.0.0-20231219180239-dc181d75b848/go.mod h1:iRJReGqOEeBhDZGkGb golang.org/x/image v0.0.0-20190703141733-d6a02ce849c9/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/image v0.18.0 h1:jGzIakQa/ZXI1I0Fxvaa9W7yP25TqT6cHIHn+6CqvSQ= golang.org/x/image v0.18.0/go.mod h1:4yyo5vMFQjVjUcVk4jEQcU9MGy/rulF5WvUILseCM2E= -golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= -golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= +golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= +golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= +golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= -golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= -golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= +golang.org/x/tools v0.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg= +golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI= gonum.org/v1/gonum v0.15.0 h1:2lYxjRbTYyxkJxlhC+LvJIx3SsANPdRybu1tGj9/OrQ= gonum.org/v1/gonum v0.15.0/go.mod h1:xzZVBJBtS+Mz4q0Yl2LJTk+OxOg4jiXZ7qBoM0uISGo= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/netview/laymesh.go b/netview/laymesh.go index 09d4c24..b0b5fab 100644 --- a/netview/laymesh.go +++ b/netview/laymesh.go @@ -36,13 +36,12 @@ func NewLayMesh(sc *xyz.Scene, nv *NetView, lay emer.Layer) *LayMesh { lm.View = nv lm.Lay = lay lm.Name = lay.Name() - sc.AddMesh(lm) + sc.SetMesh(lm) return lm } -func (lm *LayMesh) Sizes() (nVtx, nIndex int, hasColor bool) { +func (lm *LayMesh) MeshSize() (nVtx, nIndex int, hasColor bool) { lm.Transparent = true - lm.Dynamic = true lm.HasColor = true if lm.Lay == nil { return 0, 0, true @@ -90,72 +89,38 @@ func (lm *LayMesh) Size4D() (nVtx, nIndex int) { return } -func (lm *LayMesh) Set(sc *xyz.Scene, vtxAry, normAry, texAry, clrAry math32.ArrayF32, idxAry math32.ArrayU32) { +func (lm *LayMesh) Set(vtxAry, normAry, texAry, clrAry math32.ArrayF32, idxAry math32.ArrayU32) { if lm.Lay == nil || lm.Shape.NumDims() == 0 { return // nothing } - // true = init if lm.View.Params.Raster.On { if lm.View.Params.Raster.XAxis { if lm.Shape.NumDims() == 4 { - lm.RasterSet4DX(sc, true, vtxAry, normAry, texAry, clrAry, idxAry) + lm.RasterSet4DX(vtxAry, normAry, texAry, clrAry, idxAry) } else { - lm.RasterSet2DX(sc, true, vtxAry, normAry, texAry, clrAry, idxAry) + lm.RasterSet2DX(vtxAry, normAry, texAry, clrAry, idxAry) } } else { if lm.Shape.NumDims() == 4 { - lm.RasterSet4DZ(sc, true, vtxAry, normAry, texAry, clrAry, idxAry) + lm.RasterSet4DZ(vtxAry, normAry, texAry, clrAry, idxAry) } else { - lm.RasterSet2DZ(sc, true, vtxAry, normAry, texAry, clrAry, idxAry) + lm.RasterSet2DZ(vtxAry, normAry, texAry, clrAry, idxAry) } } } else { if lm.Shape.NumDims() == 4 { - lm.Set4D(sc, true, vtxAry, normAry, texAry, clrAry, idxAry) + lm.Set4D(vtxAry, normAry, texAry, clrAry, idxAry) } else { - lm.Set2D(sc, true, vtxAry, normAry, texAry, clrAry, idxAry) + lm.Set2D(vtxAry, normAry, texAry, clrAry, idxAry) } } - lm.SetMod(sc) - -} - -func (lm *LayMesh) Update(sc *xyz.Scene, vtxAry, normAry, texAry, clrAry math32.ArrayF32, idxAry math32.ArrayU32) { - if lm.Lay == nil || lm.Shape.NumDims() == 0 { - return // nothing - } - // false = not init - // todo: not using the init flag to save minor amount of index non-updating.. - - if lm.View.Params.Raster.On { - if lm.View.Params.Raster.XAxis { - if lm.Shape.NumDims() == 4 { - lm.RasterSet4DX(sc, false, vtxAry, normAry, texAry, clrAry, idxAry) - } else { - lm.RasterSet2DX(sc, false, vtxAry, normAry, texAry, clrAry, idxAry) - } - } else { - if lm.Shape.NumDims() == 4 { - lm.RasterSet4DZ(sc, false, vtxAry, normAry, texAry, clrAry, idxAry) - } else { - lm.RasterSet2DZ(sc, false, vtxAry, normAry, texAry, clrAry, idxAry) - } - } - } else { - if lm.Shape.NumDims() == 4 { - lm.Set4D(sc, false, vtxAry, normAry, texAry, clrAry, idxAry) - } else { - lm.Set2D(sc, false, vtxAry, normAry, texAry, clrAry, idxAry) - } - } - lm.SetMod(sc) } // MinUnitHeight ensures that there is always at least some dimensionality // to the unit cubes -- affects transparency rendering etc var MinUnitHeight = float32(1.0e-6) -func (lm *LayMesh) Set2D(sc *xyz.Scene, init bool, vtxAry, normAry, texAry, clrAry math32.ArrayF32, idxAry math32.ArrayU32) { +func (lm *LayMesh) Set2D(vtxAry, normAry, texAry, clrAry math32.ArrayF32, idxAry math32.ArrayU32) { nz := lm.Shape.DimSize(0) nx := lm.Shape.DimSize(1) @@ -205,7 +170,7 @@ func (lm *LayMesh) Set2D(sc *xyz.Scene, init bool, vtxAry, normAry, texAry, clrA lm.BBox.SetBounds(math32.Vec3(0, -0.5, -fnz), math32.Vec3(fnx, 0.5, 0)) } -func (lm *LayMesh) Set4D(sc *xyz.Scene, init bool, vtxAry, normAry, texAry, clrAry math32.ArrayF32, idxAry math32.ArrayU32) { +func (lm *LayMesh) Set4D(vtxAry, normAry, texAry, clrAry math32.ArrayF32, idxAry math32.ArrayU32) { npz := lm.Shape.DimSize(0) // p = pool npx := lm.Shape.DimSize(1) nuz := lm.Shape.DimSize(2) // u = unit diff --git a/netview/layraster.go b/netview/layraster.go index 928814c..7a3fbc7 100644 --- a/netview/layraster.go +++ b/netview/layraster.go @@ -7,7 +7,6 @@ package netview import ( "cogentcore.org/core/math32" "cogentcore.org/core/vgpu/vshape" - "cogentcore.org/core/xyz" ) func (lm *LayMesh) RasterSize2D() (nVtx, nIndex int) { @@ -42,7 +41,7 @@ func (lm *LayMesh) RasterSize4D() (nVtx, nIndex int) { return } -func (lm *LayMesh) RasterSet2DX(sc *xyz.Scene, init bool, vtxAry, normAry, texAry, clrAry math32.ArrayF32, idxAry math32.ArrayU32) { +func (lm *LayMesh) RasterSet2DX(vtxAry, normAry, texAry, clrAry math32.ArrayF32, idxAry math32.ArrayU32) { rs := lm.Lay.RepShape() nuz := rs.DimSize(0) nux := rs.DimSize(1) @@ -123,7 +122,7 @@ func (lm *LayMesh) RasterSet2DX(sc *xyz.Scene, init bool, vtxAry, normAry, texAr lm.BBox.SetBounds(math32.Vec3(0, -0.5, -fnz), math32.Vec3(fnx, 0.5, 0)) } -func (lm *LayMesh) RasterSet2DZ(sc *xyz.Scene, init bool, vtxAry, normAry, texAry, clrAry math32.ArrayF32, idxAry math32.ArrayU32) { +func (lm *LayMesh) RasterSet2DZ(vtxAry, normAry, texAry, clrAry math32.ArrayF32, idxAry math32.ArrayU32) { rs := lm.Lay.RepShape() nuz := rs.DimSize(0) nux := rs.DimSize(1) @@ -203,7 +202,7 @@ func (lm *LayMesh) RasterSet2DZ(sc *xyz.Scene, init bool, vtxAry, normAry, texAr lm.BBox.SetBounds(math32.Vec3(0, -0.5, -fnz), math32.Vec3(fnx, 0.5, 0)) } -func (lm *LayMesh) RasterSet4DX(sc *xyz.Scene, init bool, vtxAry, normAry, texAry, clrAry math32.ArrayF32, idxAry math32.ArrayU32) { +func (lm *LayMesh) RasterSet4DX(vtxAry, normAry, texAry, clrAry math32.ArrayF32, idxAry math32.ArrayU32) { rs := lm.Lay.RepShape() npz := rs.DimSize(0) // p = pool npx := rs.DimSize(1) @@ -304,7 +303,7 @@ func (lm *LayMesh) RasterSet4DX(sc *xyz.Scene, init bool, vtxAry, normAry, texAr lm.BBox.SetBounds(math32.Vec3(0, -0.5, -fnpoz*fnuz), math32.Vec3(fnpox*fnux, 0.5, 0)) } -func (lm *LayMesh) RasterSet4DZ(sc *xyz.Scene, init bool, vtxAry, normAry, texAry, clrAry math32.ArrayF32, idxAry math32.ArrayU32) { +func (lm *LayMesh) RasterSet4DZ(vtxAry, normAry, texAry, clrAry math32.ArrayF32, idxAry math32.ArrayU32) { rs := lm.Lay.RepShape() npz := rs.DimSize(0) // p = pool npx := rs.DimSize(1) diff --git a/netview/netview.go b/netview/netview.go index 25ddbaa..1db3fd2 100644 --- a/netview/netview.go +++ b/netview/netview.go @@ -305,11 +305,11 @@ func (nv *NetView) UpdateImpl() { nv.UpdateLayers() } -// ReconfigMeshes reconfigures the layer meshes -func (nv *NetView) ReconfigMeshes() { - se := nv.SceneXYZ() - se.ReconfigMeshes() -} +// // ReconfigMeshes reconfigures the layer meshes +// func (nv *NetView) ReconfigMeshes() { +// se := nv.SceneXYZ() +// se.ReconfigMeshes() +// } func (nv *NetView) Toolbar() *core.Toolbar { return nv.ChildByName("tbar", 0).(*core.Toolbar) @@ -546,7 +546,6 @@ func (nv *NetView) UpdateLayers() { } if nv.NeedsRebuild() { se.Background = colors.Scheme.Background - se.SetNeedsConfig() } nlay := nv.Net.NLayers() laysGp := se.ChildByName("Layers", 0).(*xyz.Group) @@ -558,7 +557,11 @@ func (nv *NetView) UpdateLayers() { } if !tree.Update(laysGp, layConfig) { - se.UpdateMeshes() + for li := range laysGp.Children { + ly := nv.Net.Layer(li) + lmesh := se.MeshByName(ly.Name()) + se.SetMesh(lmesh) // does update + } return } @@ -607,11 +610,12 @@ func (nv *NetView) UpdateLayers() { txt.NetView = nv txt.SetText(ly.Name()) txt.Pose.Scale = math32.Vector3Scalar(nv.Params.LayNmSize).Div(lg.Pose.Scale) + txt.Pose.RotateOnAxis(0, 1, 0, 180) txt.Styles.Background = colors.Uniform(colors.Transparent) txt.Styles.Text.Align = styles.Start txt.Styles.Text.AlignV = styles.Start } - sw.XYZ.SetNeedsConfig() + sw.XYZ.SetNeedsUpdate() sw.NeedsRender() } @@ -624,16 +628,9 @@ func (nv *NetView) ViewDefaults(se *xyz.Scene) { nv.Styler(func(s *styles.Style) { se.Background = colors.Scheme.Background }) - xyz.NewAmbientLight(se, "ambient", 0.1, xyz.DirectSun) - dir := xyz.NewDirLight(se, "dirUp", 0.3, xyz.DirectSun) - dir.Pos.Set(0, 1, 0) - dir = xyz.NewDirLight(se, "dirBack", 0.3, xyz.DirectSun) - dir.Pos.Set(0, 1, 2.5) - // point := xyz.NewPointLight(vs, "point", 1, xyz.DirectSun) - // point.Pos.Set(0, 2, 5) - // spot := xyz.NewSpotLight(vs, "spot", 1, xyz.DirectSun) - // spot.Pose.Pos.Set(0, 2, 5) - // spot.LookAtOrigin() + xyz.NewAmbient(se, "ambient", 0.1, xyz.DirectSun) + xyz.NewDirectional(se, "directional", 0.5, xyz.DirectSun).Pos.Set(0, 2, 5) + xyz.NewPoint(se, "point", .2, xyz.DirectSun).Pos.Set(0, 2, -5) } // ReadLock locks data for reading -- call ReadUnlock when done. @@ -758,7 +755,6 @@ func (nv *NetView) ConfigLabels(labs []string) bool { if tree.Update(lgp, lbConfig) { for i, ls := range labs { lb := lgp.ChildByName(ls, i).(*xyz.Text2D) - // lb.Defaults() lb.SetText(ls) // todo: // lb.SetProperty("text-align", styles.Start) @@ -859,7 +855,7 @@ func (nv *NetView) MakeToolbar(p *tree.Plan) { SetTooltip("Toggles raster plot mode -- displays values on one axis (Z by default) and raster counter (time) along the other (X by default)"). OnChange(func(e events.Event) { nv.Params.Raster.On = w.IsChecked() - nv.ReconfigMeshes() + // nv.ReconfigMeshes() nv.UpdateView() }) })