@@ -90,9 +90,9 @@ func (u *OpUnion2D) AppendShaderBody(b []byte) []byte {
90
90
}
91
91
92
92
// AppendShaderObjects implements [glbuild.Shader]. This method returns the argument buffer with no modifications. See [glbuild.Shader] for more information.
93
- func (u * OpUnion2D ) AppendShaderObjects (ssbos []glbuild.ShaderObject ) []glbuild.ShaderObject {
93
+ func (u * OpUnion2D ) AppendShaderObjects (objects []glbuild.ShaderObject ) []glbuild.ShaderObject {
94
94
u .mustValidate ()
95
- return ssbos
95
+ return objects
96
96
}
97
97
98
98
func (u * OpUnion2D ) mustValidate () {
@@ -153,8 +153,8 @@ func (l *line2D) ForEach2DChild(userData any, fn func(userData any, s *glbuild.S
153
153
return nil
154
154
}
155
155
156
- func (u * line2D ) AppendShaderObjects (ssbos []glbuild.ShaderObject ) []glbuild.ShaderObject {
157
- return ssbos
156
+ func (u * line2D ) AppendShaderObjects (objects []glbuild.ShaderObject ) []glbuild.ShaderObject {
157
+ return objects
158
158
}
159
159
160
160
// NewLines2D creates sequential straight lines between the argument points.
@@ -225,12 +225,12 @@ func (l *lines2D) ForEach2DChild(userData any, fn func(userData any, s *glbuild.
225
225
return nil
226
226
}
227
227
228
- func (u * lines2D ) AppendShaderObjects (ssbos []glbuild.ShaderObject ) []glbuild.ShaderObject {
228
+ func (u * lines2D ) AppendShaderObjects (objects []glbuild.ShaderObject ) []glbuild.ShaderObject {
229
229
ssbo , err := glbuild .MakeShaderBufferReadOnly (u .bufName , u .points )
230
230
if err != nil {
231
231
panic (err )
232
232
}
233
- return append (ssbos , ssbo )
233
+ return append (objects , ssbo )
234
234
}
235
235
236
236
// NewArc returns a 2D arc centered at the origin (x,y)=(0,0) for a given radius and arc angle and thickness of the arc.
@@ -282,8 +282,8 @@ func (a *arc2D) ForEach2DChild(userData any, fn func(userData any, s *glbuild.Sh
282
282
return nil
283
283
}
284
284
285
- func (u * arc2D ) AppendShaderObjects (ssbos []glbuild.ShaderObject ) []glbuild.ShaderObject {
286
- return ssbos
285
+ func (u * arc2D ) AppendShaderObjects (objects []glbuild.ShaderObject ) []glbuild.ShaderObject {
286
+ return objects
287
287
}
288
288
289
289
type circle2D struct {
@@ -319,8 +319,8 @@ func (c *circle2D) ForEach2DChild(userData any, fn func(userData any, s *glbuild
319
319
return nil
320
320
}
321
321
322
- func (u * circle2D ) AppendShaderObjects (ssbos []glbuild.ShaderObject ) []glbuild.ShaderObject {
323
- return ssbos
322
+ func (u * circle2D ) AppendShaderObjects (objects []glbuild.ShaderObject ) []glbuild.ShaderObject {
323
+ return objects
324
324
}
325
325
326
326
type equilateralTri2d struct {
@@ -367,8 +367,8 @@ func (t *equilateralTri2d) ForEach2DChild(userData any, fn func(userData any, s
367
367
return nil
368
368
}
369
369
370
- func (u * equilateralTri2d ) AppendShaderObjects (ssbos []glbuild.ShaderObject ) []glbuild.ShaderObject {
371
- return ssbos
370
+ func (u * equilateralTri2d ) AppendShaderObjects (objects []glbuild.ShaderObject ) []glbuild.ShaderObject {
371
+ return objects
372
372
}
373
373
374
374
type rect2D struct {
@@ -410,8 +410,8 @@ func (c *rect2D) ForEach2DChild(userData any, fn func(userData any, s *glbuild.S
410
410
return nil
411
411
}
412
412
413
- func (u * rect2D ) AppendShaderObjects (ssbos []glbuild.ShaderObject ) []glbuild.ShaderObject {
414
- return ssbos
413
+ func (u * rect2D ) AppendShaderObjects (objects []glbuild.ShaderObject ) []glbuild.ShaderObject {
414
+ return objects
415
415
}
416
416
417
417
type hex2D struct {
@@ -451,8 +451,8 @@ func (c *hex2D) ForEach2DChild(userData any, fn func(userData any, s *glbuild.Sh
451
451
return nil
452
452
}
453
453
454
- func (u * hex2D ) AppendShaderObjects (ssbos []glbuild.ShaderObject ) []glbuild.ShaderObject {
455
- return ssbos
454
+ func (u * hex2D ) AppendShaderObjects (objects []glbuild.ShaderObject ) []glbuild.ShaderObject {
455
+ return objects
456
456
}
457
457
458
458
type ellipse2D struct {
@@ -522,8 +522,8 @@ func (c *ellipse2D) ForEach2DChild(userData any, fn func(userData any, s *glbuil
522
522
return nil
523
523
}
524
524
525
- func (u * ellipse2D ) AppendShaderObjects (ssbos []glbuild.ShaderObject ) []glbuild.ShaderObject {
526
- return ssbos
525
+ func (u * ellipse2D ) AppendShaderObjects (objects []glbuild.ShaderObject ) []glbuild.ShaderObject {
526
+ return objects
527
527
}
528
528
529
529
type poly2D struct {
@@ -599,8 +599,8 @@ func (c *poly2D) ForEach2DChild(userData any, fn func(userData any, s *glbuild.S
599
599
return nil
600
600
}
601
601
602
- func (u * poly2D ) AppendShaderObjects (ssbos []glbuild.ShaderObject ) []glbuild.ShaderObject {
603
- return ssbos // TODO: implement shader buffer storage here!
602
+ func (u * poly2D ) AppendShaderObjects (objects []glbuild.ShaderObject ) []glbuild.ShaderObject {
603
+ return objects // TODO: implement shader buffer storage here!
604
604
}
605
605
606
606
// Extrude converts a 2D SDF into a 3D extrusion. Extrudes in both positive and negative Z direction, half of h both ways.
@@ -633,8 +633,8 @@ func (e *extrusion) ForEach2DChild(userData any, fn func(userData any, s *glbuil
633
633
func (e * extrusion ) ForEachChild (userData any , fn func (userData any , s * glbuild.Shader3D ) error ) error {
634
634
return nil
635
635
}
636
- func (u * extrusion ) AppendShaderObjects (ssbos []glbuild.ShaderObject ) []glbuild.ShaderObject {
637
- return ssbos
636
+ func (u * extrusion ) AppendShaderObjects (objects []glbuild.ShaderObject ) []glbuild.ShaderObject {
637
+ return objects
638
638
}
639
639
640
640
func (e * extrusion ) AppendShaderName (b []byte ) []byte {
@@ -681,8 +681,8 @@ func (r *revolution) ForEach2DChild(userData any, fn func(userData any, s *glbui
681
681
func (r * revolution ) ForEachChild (userData any , fn func (userData any , s * glbuild.Shader3D ) error ) error {
682
682
return nil
683
683
}
684
- func (u * revolution ) AppendShaderObjects (ssbos []glbuild.ShaderObject ) []glbuild.ShaderObject {
685
- return ssbos
684
+ func (u * revolution ) AppendShaderObjects (objects []glbuild.ShaderObject ) []glbuild.ShaderObject {
685
+ return objects
686
686
}
687
687
688
688
func (r * revolution ) AppendShaderName (b []byte ) []byte {
@@ -739,8 +739,8 @@ func (s *diff2D) AppendShaderBody(b []byte) []byte {
739
739
b = append (b , "(p));" ... )
740
740
return b
741
741
}
742
- func (u * diff2D ) AppendShaderObjects (ssbos []glbuild.ShaderObject ) []glbuild.ShaderObject {
743
- return ssbos
742
+ func (u * diff2D ) AppendShaderObjects (objects []glbuild.ShaderObject ) []glbuild.ShaderObject {
743
+ return objects
744
744
}
745
745
746
746
// Intersection2D is the SDF intersection of a ^ b. Does not produce an exact SDF.
@@ -783,8 +783,8 @@ func (s *intersect2D) AppendShaderBody(b []byte) []byte {
783
783
b = append (b , "(p));" ... )
784
784
return b
785
785
}
786
- func (u * intersect2D ) AppendShaderObjects (ssbos []glbuild.ShaderObject ) []glbuild.ShaderObject {
787
- return ssbos
786
+ func (u * intersect2D ) AppendShaderObjects (objects []glbuild.ShaderObject ) []glbuild.ShaderObject {
787
+ return objects
788
788
}
789
789
790
790
// Xor2D is the mutually exclusive boolean operation and results in an exact SDF.
@@ -825,8 +825,8 @@ func (s *xor2D) AppendShaderBody(b []byte) []byte {
825
825
b = append (b , "return max(min(d1,d2),-max(d1,d2));" ... )
826
826
return b
827
827
}
828
- func (u * xor2D ) AppendShaderObjects (ssbos []glbuild.ShaderObject ) []glbuild.ShaderObject {
829
- return ssbos
828
+ func (u * xor2D ) AppendShaderObjects (objects []glbuild.ShaderObject ) []glbuild.ShaderObject {
829
+ return objects
830
830
}
831
831
832
832
// Array is the domain repetition operation. It repeats domain centered around (x,y)=(0,0).
@@ -904,8 +904,8 @@ return d;`, s.d.X, s.d.Y,
904
904
b = append (b , body ... )
905
905
return b
906
906
}
907
- func (u * array2D ) AppendShaderObjects (ssbos []glbuild.ShaderObject ) []glbuild.ShaderObject {
908
- return ssbos
907
+ func (u * array2D ) AppendShaderObjects (objects []glbuild.ShaderObject ) []glbuild.ShaderObject {
908
+ return objects
909
909
}
910
910
911
911
// Offset2D adds sdfAdd to the entire argument SDF. If sdfAdd is negative this will
@@ -953,8 +953,8 @@ func (s *offset2D) AppendShaderBody(b []byte) []byte {
953
953
b = append (b , ')' , ';' )
954
954
return b
955
955
}
956
- func (u * offset2D ) AppendShaderObjects (ssbos []glbuild.ShaderObject ) []glbuild.ShaderObject {
957
- return ssbos
956
+ func (u * offset2D ) AppendShaderObjects (objects []glbuild.ShaderObject ) []glbuild.ShaderObject {
957
+ return objects
958
958
}
959
959
960
960
// Translate2D moves the SDF s in the given direction.
@@ -991,8 +991,8 @@ func (s *translate2D) AppendShaderBody(b []byte) []byte {
991
991
b = append (b , "(p-t);" ... )
992
992
return b
993
993
}
994
- func (u * translate2D ) AppendShaderObjects (ssbos []glbuild.ShaderObject ) []glbuild.ShaderObject {
995
- return ssbos
994
+ func (u * translate2D ) AppendShaderObjects (objects []glbuild.ShaderObject ) []glbuild.ShaderObject {
995
+ return objects
996
996
}
997
997
998
998
// Rotate2D returns the argument shape rotated around the origin by theta (radians).
@@ -1051,8 +1051,8 @@ func (r *rotation2D) AppendShaderBody(b []byte) []byte {
1051
1051
return b
1052
1052
}
1053
1053
1054
- func (u * rotation2D ) AppendShaderObjects (ssbos []glbuild.ShaderObject ) []glbuild.ShaderObject {
1055
- return ssbos
1054
+ func (u * rotation2D ) AppendShaderObjects (objects []glbuild.ShaderObject ) []glbuild.ShaderObject {
1055
+ return objects
1056
1056
}
1057
1057
1058
1058
// Symmetry reflects the SDF around x or y (or both) axis.
@@ -1103,8 +1103,8 @@ func (s *symmetry2D) AppendShaderBody(b []byte) []byte {
1103
1103
return b
1104
1104
}
1105
1105
1106
- func (u * symmetry2D ) AppendShaderObjects (ssbos []glbuild.ShaderObject ) []glbuild.ShaderObject {
1107
- return ssbos
1106
+ func (u * symmetry2D ) AppendShaderObjects (objects []glbuild.ShaderObject ) []glbuild.ShaderObject {
1107
+ return objects
1108
1108
}
1109
1109
1110
1110
// Annulus makes a 2D shape annular by emptying it's center. It is the equivalent of the 3D Shell operation but in 2D.
@@ -1144,8 +1144,8 @@ func (s *annulus2D) AppendShaderBody(b []byte) []byte {
1144
1144
return b
1145
1145
}
1146
1146
1147
- func (u * annulus2D ) AppendShaderObjects (ssbos []glbuild.ShaderObject ) []glbuild.ShaderObject {
1148
- return ssbos
1147
+ func (u * annulus2D ) AppendShaderObjects (objects []glbuild.ShaderObject ) []glbuild.ShaderObject {
1148
+ return objects
1149
1149
}
1150
1150
1151
1151
// CircularArray2D is the circular domain repetition operation around the origin (x,y)=(0,0).
@@ -1225,6 +1225,6 @@ func (ca *circarray2D) AppendShaderBody(b []byte) []byte {
1225
1225
return b
1226
1226
}
1227
1227
1228
- func (u * circarray2D ) AppendShaderObjects (ssbos []glbuild.ShaderObject ) []glbuild.ShaderObject {
1229
- return ssbos
1228
+ func (u * circarray2D ) AppendShaderObjects (objects []glbuild.ShaderObject ) []glbuild.ShaderObject {
1229
+ return objects
1230
1230
}
0 commit comments