occt-gltf-addon-linux-x64 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) hide show
  1. package/LICENSE_LGPL_21.txt +502 -0
  2. package/OCCT_LGPL_EXCEPTION.txt +10 -0
  3. package/README.md +2 -2
  4. package/index.js +63 -1
  5. package/lib/libTKBO.so.8.0.0 +0 -0
  6. package/lib/libTKBRep.so.8.0.0 +0 -0
  7. package/lib/libTKBin.so.8.0.0 +0 -0
  8. package/lib/libTKBinL.so.8.0.0 +0 -0
  9. package/lib/libTKBinTObj.so.8.0.0 +0 -0
  10. package/lib/libTKBinXCAF.so.8.0.0 +0 -0
  11. package/lib/libTKBool.so.8.0.0 +0 -0
  12. package/lib/libTKCAF.so.8.0.0 +0 -0
  13. package/lib/libTKCDF.so.8.0.0 +0 -0
  14. package/lib/libTKDE.so.8.0.0 +0 -0
  15. package/lib/libTKDECascade.so.8.0.0 +0 -0
  16. package/lib/libTKDEIGES.so.8.0.0 +0 -0
  17. package/lib/libTKDEOBJ.so.8.0.0 +0 -0
  18. package/lib/libTKDEPLY.so.8.0.0 +0 -0
  19. package/lib/libTKDESTEP.so.8.0.0 +0 -0
  20. package/lib/libTKDESTL.so.8.0.0 +0 -0
  21. package/lib/libTKDEVRML.so.8.0.0 +0 -0
  22. package/lib/libTKExpress.so.8.0.0 +0 -0
  23. package/lib/libTKFeat.so.8.0.0 +0 -0
  24. package/lib/libTKFillet.so.8.0.0 +0 -0
  25. package/lib/libTKG2d.so.8.0.0 +0 -0
  26. package/lib/libTKG3d.so.8.0.0 +0 -0
  27. package/lib/libTKGeomAlgo.so.8.0.0 +0 -0
  28. package/lib/libTKGeomBase.so.8.0.0 +0 -0
  29. package/lib/libTKHLR.so.8.0.0 +0 -0
  30. package/lib/libTKHelix.so.8.0.0 +0 -0
  31. package/lib/libTKLCAF.so.8.0.0 +0 -0
  32. package/lib/libTKMath.so.8.0.0 +0 -0
  33. package/lib/libTKMesh.so.8.0.0 +0 -0
  34. package/lib/libTKOffset.so.8.0.0 +0 -0
  35. package/lib/libTKPrim.so.8.0.0 +0 -0
  36. package/lib/libTKRWMesh.so.8.0.0 +0 -0
  37. package/lib/libTKService.so.8.0.0 +0 -0
  38. package/lib/libTKShHealing.so.8.0.0 +0 -0
  39. package/lib/libTKStd.so.8.0.0 +0 -0
  40. package/lib/libTKStdL.so.8.0.0 +0 -0
  41. package/lib/libTKTObj.so.8.0.0 +0 -0
  42. package/lib/libTKTopAlgo.so.8.0.0 +0 -0
  43. package/lib/libTKV3d.so.8.0.0 +0 -0
  44. package/lib/libTKVCAF.so.8.0.0 +0 -0
  45. package/lib/libTKXCAF.so.8.0.0 +0 -0
  46. package/lib/libTKXMesh.so.8.0.0 +0 -0
  47. package/lib/libTKXSBase.so.8.0.0 +0 -0
  48. package/lib/libTKXml.so.8.0.0 +0 -0
  49. package/lib/libTKXmlL.so.8.0.0 +0 -0
  50. package/lib/libTKXmlTObj.so.8.0.0 +0 -0
  51. package/lib/libTKXmlXCAF.so.8.0.0 +0 -0
  52. package/lib/libTKernel.so.8.0.0 +0 -0
  53. package/lib/libdraco.so.1 +0 -0
  54. package/lib/libtbb.so.2 +0 -0
  55. package/lib/libtbbmalloc.so.2 +0 -0
  56. package/lib/libtbbmalloc_proxy.so.2 +0 -0
  57. package/occt_gltf_addon.node +0 -0
  58. package/package.json +6 -2
  59. package/resources/BOPAlgo/BOPAlgo.msg +129 -0
  60. package/resources/BOPAlgo/FILES +1 -0
  61. package/resources/DrawResources/CURVES.tcl +38 -0
  62. package/resources/DrawResources/CheckCommands.tcl +1206 -0
  63. package/resources/DrawResources/DrawDefault +130 -0
  64. package/resources/DrawResources/DrawPlugin +64 -0
  65. package/resources/DrawResources/DrawTK.tcl +623 -0
  66. package/resources/DrawResources/FILES +16 -0
  67. package/resources/DrawResources/Geometry.tcl +96 -0
  68. package/resources/DrawResources/InitEnvironment.tcl +50 -0
  69. package/resources/DrawResources/Move.tcl +85 -0
  70. package/resources/DrawResources/OCC_logo.png +0 -0
  71. package/resources/DrawResources/PROFIL.tcl +726 -0
  72. package/resources/DrawResources/SCAN.tcl +192 -0
  73. package/resources/DrawResources/SURFACES.tcl +35 -0
  74. package/resources/DrawResources/StandardCommands.tcl +451 -0
  75. package/resources/DrawResources/StandardViews.tcl +284 -0
  76. package/resources/DrawResources/TKTopTest.tcl +27 -0
  77. package/resources/DrawResources/TestCommands.tcl +2969 -0
  78. package/resources/DrawResources/Vector.tcl +402 -0
  79. package/resources/DrawResources/dfb_attribns.gif +0 -0
  80. package/resources/DrawResources/dfb_attribute.gif +0 -0
  81. package/resources/DrawResources/dfb_folder.gif +0 -0
  82. package/resources/DrawResources/dftree.tcl +381 -0
  83. package/resources/DrawResources/lamp.ico +0 -0
  84. package/resources/SHMessage/FILES +2 -0
  85. package/resources/SHMessage/SHAPE.fr +267 -0
  86. package/resources/SHMessage/SHAPE.us +267 -0
  87. package/resources/Shaders/Declarations.glsl +276 -0
  88. package/resources/Shaders/DeclarationsImpl.glsl +121 -0
  89. package/resources/Shaders/Display.fs +157 -0
  90. package/resources/Shaders/FILES +27 -0
  91. package/resources/Shaders/LightShadow.glsl +48 -0
  92. package/resources/Shaders/PBRCookTorrance.glsl +20 -0
  93. package/resources/Shaders/PBRDirectionalLight.glsl +20 -0
  94. package/resources/Shaders/PBRDistribution.glsl +9 -0
  95. package/resources/Shaders/PBREnvBaking.fs +226 -0
  96. package/resources/Shaders/PBREnvBaking.vs +55 -0
  97. package/resources/Shaders/PBRFresnel.glsl +36 -0
  98. package/resources/Shaders/PBRGeometry.glsl +13 -0
  99. package/resources/Shaders/PBRIllumination.glsl +28 -0
  100. package/resources/Shaders/PBRPointLight.glsl +27 -0
  101. package/resources/Shaders/PBRSpotLight.glsl +45 -0
  102. package/resources/Shaders/PathtraceBase.fs +993 -0
  103. package/resources/Shaders/PhongDirectionalLight.glsl +29 -0
  104. package/resources/Shaders/PhongPointLight.glsl +36 -0
  105. package/resources/Shaders/PhongShading.fs +191 -0
  106. package/resources/Shaders/PhongShading.vs +43 -0
  107. package/resources/Shaders/PhongSpotLight.glsl +52 -0
  108. package/resources/Shaders/PointLightAttenuation.glsl +35 -0
  109. package/resources/Shaders/RaytraceBase.fs +1236 -0
  110. package/resources/Shaders/RaytraceBase.vs +12 -0
  111. package/resources/Shaders/RaytraceRender.fs +134 -0
  112. package/resources/Shaders/RaytraceSmooth.fs +80 -0
  113. package/resources/Shaders/SkydomBackground.fs +300 -0
  114. package/resources/Shaders/TangentSpaceNormal.glsl +17 -0
  115. package/resources/StdResource/FILES +6 -0
  116. package/resources/StdResource/MigrationSheet.txt +21 -0
  117. package/resources/StdResource/Plugin +52 -0
  118. package/resources/StdResource/Standard +25 -0
  119. package/resources/StdResource/StandardLite +22 -0
  120. package/resources/StdResource/TObj +17 -0
  121. package/resources/StdResource/XCAF +50 -0
  122. package/resources/TObj/FILES +1 -0
  123. package/resources/TObj/TObj.msg +85 -0
  124. package/resources/Textures/1d_elevation.rgb +0 -0
  125. package/resources/Textures/2d_MatraDatavision.rgb +0 -0
  126. package/resources/Textures/2d_alienskin.rgb +0 -0
  127. package/resources/Textures/2d_aluminum.rgb +0 -0
  128. package/resources/Textures/2d_blue_rock.rgb +0 -0
  129. package/resources/Textures/2d_bluewhite_paper.rgb +0 -0
  130. package/resources/Textures/2d_brushed.rgb +0 -0
  131. package/resources/Textures/2d_bubbles.rgb +0 -0
  132. package/resources/Textures/2d_bumps.rgb +0 -0
  133. package/resources/Textures/2d_cast.rgb +0 -0
  134. package/resources/Textures/2d_chess.rgba +0 -0
  135. package/resources/Textures/2d_chipbd.rgb +0 -0
  136. package/resources/Textures/2d_clouds.rgb +0 -0
  137. package/resources/Textures/2d_flesh.rgb +0 -0
  138. package/resources/Textures/2d_floor.rgb +0 -0
  139. package/resources/Textures/2d_galvnisd.rgb +0 -0
  140. package/resources/Textures/2d_grass.rgb +0 -0
  141. package/resources/Textures/2d_knurl.rgb +0 -0
  142. package/resources/Textures/2d_maple.rgb +0 -0
  143. package/resources/Textures/2d_marble.rgb +0 -0
  144. package/resources/Textures/2d_mottled.rgb +0 -0
  145. package/resources/Textures/2d_rain.rgb +0 -0
  146. package/resources/Textures/2d_rock.rgb +0 -0
  147. package/resources/Textures/FILES +31 -0
  148. package/resources/Textures/env_clouds.rgb +0 -0
  149. package/resources/Textures/env_cv.rgb +0 -0
  150. package/resources/Textures/env_lines.rgb +0 -0
  151. package/resources/Textures/env_medit.rgb +0 -0
  152. package/resources/Textures/env_pearl.rgb +0 -0
  153. package/resources/Textures/env_road.rgb +0 -0
  154. package/resources/Textures/env_sky1.rgb +0 -0
  155. package/resources/Textures/env_sky2.rgb +0 -0
  156. package/resources/UnitsAPI/CurrentUnits +74 -0
  157. package/resources/UnitsAPI/FILES +4 -0
  158. package/resources/UnitsAPI/MDTVBaseUnits +70 -0
  159. package/resources/UnitsAPI/MDTVCurrentUnits +74 -0
  160. package/resources/UnitsAPI/Units.dat +481 -0
  161. package/resources/XRResources/FILES +10 -0
  162. package/resources/XRResources/occtvr_actions.json +225 -0
  163. package/resources/XRResources/occtvr_bindings_generic.json +87 -0
  164. package/resources/XRResources/occtvr_bindings_holographic_hmd.json +18 -0
  165. package/resources/XRResources/occtvr_bindings_index_hmd.json +18 -0
  166. package/resources/XRResources/occtvr_bindings_rift.json +18 -0
  167. package/resources/XRResources/occtvr_bindings_touch.json +160 -0
  168. package/resources/XRResources/occtvr_bindings_vive.json +18 -0
  169. package/resources/XRResources/occtvr_bindings_vive_controller.json +139 -0
  170. package/resources/XRResources/occtvr_bindings_vive_cosmos.json +18 -0
  171. package/resources/XRResources/occtvr_bindings_vive_pro.json +18 -0
  172. package/resources/XSMessage/FILES +2 -0
  173. package/resources/XSMessage/XSTEP.fr +1026 -0
  174. package/resources/XSMessage/XSTEP.us +1023 -0
  175. package/resources/XSTEPResource/FILES +2 -0
  176. package/resources/XSTEPResource/IGES +65 -0
  177. package/resources/XSTEPResource/STEP +68 -0
  178. package/resources/XmlOcafResource/FILES +11 -0
  179. package/resources/XmlOcafResource/XmlOcaf.xsd +131 -0
  180. package/resources/XmlOcafResource/XmlOcaf_SmallTypes.xsd +217 -0
  181. package/resources/XmlOcafResource/XmlOcaf_TDF.xsd +33 -0
  182. package/resources/XmlOcafResource/XmlOcaf_TDataStd.xsd +230 -0
  183. package/resources/XmlOcafResource/XmlOcaf_TDataStd_Name.xsd +37 -0
  184. package/resources/XmlOcafResource/XmlOcaf_TDocStd.xsd +37 -0
  185. package/resources/XmlOcafResource/XmlOcaf_TFunction.xsd +38 -0
  186. package/resources/XmlOcafResource/XmlOcaf_TNaming.xsd +128 -0
  187. package/resources/XmlOcafResource/XmlOcaf_TNaming_NamedShape.xsd +97 -0
  188. package/resources/XmlOcafResource/XmlOcaf_TPrsStd.xsd +42 -0
  189. package/resources/XmlOcafResource/XmlXcaf.xsd +109 -0
  190. package/resources/samples/tcl/ANC101.tcl +282 -0
  191. package/resources/samples/tcl/DataExchangeDemo.tcl +85 -0
  192. package/resources/samples/tcl/MBBGehauseRohteil.tcl +268 -0
  193. package/resources/samples/tcl/ModelingDemo.tcl +120 -0
  194. package/resources/samples/tcl/Penrose.tcl +87 -0
  195. package/resources/samples/tcl/Readme.txt +4 -0
  196. package/resources/samples/tcl/VisualizationDemo.tcl +162 -0
  197. package/resources/samples/tcl/bottle.tcl +115 -0
  198. package/resources/samples/tcl/cad.tcl +63 -0
  199. package/resources/samples/tcl/cpu.tcl +327 -0
  200. package/resources/samples/tcl/cutter.tcl +91 -0
  201. package/resources/samples/tcl/dimensions.tcl +83 -0
  202. package/resources/samples/tcl/drill.tcl +147 -0
  203. package/resources/samples/tcl/logo2019.tcl +89 -0
  204. package/resources/samples/tcl/markers.tcl +76 -0
  205. package/resources/samples/tcl/materials.tcl +75 -0
  206. package/resources/samples/tcl/pathtrace_ball.tcl +79 -0
  207. package/resources/samples/tcl/pathtrace_cube.tcl +85 -0
  208. package/resources/samples/tcl/pathtrace_materials.tcl +229 -0
  209. package/resources/samples/tcl/pencil.tcl +64 -0
  210. package/resources/samples/tcl/raytrace.tcl +44 -0
  211. package/resources/samples/tcl/snowflake.tcl +161 -0
  212. package/resources/samples/tcl/spheres.tcl +148 -0
  213. package/resources/samples/tcl/vis_pbr_spheres.tcl +94 -0
  214. package/resources/samples/tcl/xde.tcl +47 -0
@@ -0,0 +1,267 @@
1
+
2
+ ! Message file for Shape Healing
3
+
4
+
5
+ ! ------------------------------------------------------------------------------
6
+ ! Messages for shape names
7
+ !
8
+ .Name.Shape.MSG0
9
+ !
10
+ .Name.Vertex.MSG0
11
+ !
12
+ .Name.Edge.MSG0
13
+ !
14
+ .Name.Wire.MSG0
15
+ !
16
+ .Name.Face.MSG0
17
+ !
18
+ .Name.Shell.MSG0
19
+ !
20
+ .Name.Solid.MSG0
21
+ !
22
+ .Name.CompSolid.MSG0
23
+ !
24
+ .Name.Compound.MSG0
25
+ !
26
+ ! ------------------------------------------------------------------------------
27
+ ! Messages for sequence of operators
28
+ !
29
+ .SP.Sequence.Info.Seq
30
+ Info: Shape Processing: Sequence of operators: %s
31
+ !
32
+ .SP.Sequence.Info.Operator
33
+ Info: Shape Processing: Operator %d/%d: %s
34
+ !
35
+ .SP.Sequence.Error.NoOp
36
+ Error: Shape Processing: Operator %s is not found
37
+ !
38
+ .SP.Sequence.Error.Except
39
+ Error: Shape Processing: Operator %s failed with exception %s
40
+ !
41
+ .SP.Sequence.Warn.NoSeq
42
+ Warning: Shape Processing: Sequence not defined for %s, nothing to do
43
+ !
44
+ ! ------------------------------------------------------------------------------
45
+ ! Messages for printing results of shape processing
46
+ !
47
+ .PrResult.Print.MSG50
48
+ Shells:
49
+ !
50
+ .PrResult.Print.MSG55
51
+ Faces:
52
+ !
53
+ .PrResult.Print.MSG100
54
+ Mapping:
55
+ !
56
+ .PrResult.Print.MSG110
57
+ Result is Shell : %d
58
+ !
59
+ .PrResult.Print.MSG115
60
+ Result is Face : %d
61
+ !
62
+ .PrResult.Print.MSG150
63
+ No Result : %d
64
+ !
65
+ .PrResult.Print.MSG200
66
+ Preparation ratio:
67
+ !
68
+ .PrResult.Print.MSG205
69
+ Shells: %d per cent
70
+ !
71
+ .PrResult.Print.MSG210
72
+ Faces : %d per cent
73
+ !
74
+ ! ==============================================================================
75
+ ! Messages for Shape Healing
76
+ !
77
+ ! ------------------------------------------------------------------------------
78
+ ! Messages for ShapeFix_Wire
79
+ !
80
+ .FixWire.FixDegenerated.MSG0
81
+ Degenerated edge(s) detected
82
+ !
83
+ .FixWire.FixDegenerated.MSG5
84
+ Degenerated edge %d detected
85
+ !
86
+ .FixWire.FixCurve3d.Removed
87
+ Incomplete edge (with no pcurves or 3d curve) removed
88
+ !
89
+ .FixAdvWire.FixSmall.MSG0
90
+ Small edge(s) removed
91
+ !
92
+ .FixAdvWire.FixSmall.MSG5
93
+ Edge %d was small, removed
94
+ !
95
+ .FixAdvWire.FixIntersection.MSG0
96
+ Self-intersection corrected
97
+ !
98
+ .FixAdvWire.FixIntersection.MSG5
99
+ Edge was self-intersecting, corrected
100
+ !
101
+ .FixAdvWire.FixIntersection.MSG10
102
+ Edges were intersecting, corrected
103
+ !
104
+ .FixAdvWire.FixLacking.MSG0
105
+ Lacking edge(s) inserted
106
+ !
107
+ .FixAdvWire.FixLacking.MSG5
108
+ Lacking edge %d inserted
109
+ !
110
+ .FixAdvWire..MSG0
111
+ !
112
+ .FixAdvWire..MSG5
113
+ !
114
+ .FixAdvWire..MSG10
115
+ !
116
+ ! ------------------------------------------------------------------------------
117
+ ! Messages for ShapeFix_Face
118
+ !
119
+ .FixAdvFace.FixMissingSeam.MSG0
120
+ Missing seam-edge added
121
+ !
122
+ .FixAdvFace.FixSmallAreaWire.MSG0
123
+ Null area wire detected, wire skipped
124
+ !
125
+ .FixAdvFace.FixOrientation.MSG0
126
+ Face created with natural bounds
127
+ !
128
+ .FixAdvFace.FixOrientation.MSG5
129
+ Wire on face was reversed
130
+ !
131
+ .FixAdvFace.FixOrientation.MSG11
132
+ Cannot orient wire
133
+ !
134
+ ! ------------------------------------------------------------------------------
135
+ ! Messages for ShapeFix_Wireframe
136
+ !
137
+ .FixWireframe.FixSmallEdges.MSG0
138
+ Small edge removed
139
+ !
140
+ .FixWireframe.FixSmallEdges.MSG1
141
+ Small wire removed
142
+ !
143
+ .FixWireframe.FixSmallEdges.MSG2
144
+ Small face removed
145
+ !
146
+ .FixWireframe.FixFixWireGaps.MSG0
147
+ Gaps in a wire fixed
148
+ !
149
+ !
150
+ .Fix.SplitCommonVertex.MSG0
151
+ Wires with common vertex fixed
152
+ !
153
+ !
154
+ .FixAdvShell.FixOrientation.MSG20
155
+ Impossible to orient faces in shell, several shells created
156
+ !
157
+ .FixAdvShell.FixOrientation.MSG30
158
+ Improperly connected shell split into parts
159
+ !
160
+ .FixAdvSolid.FixShell.MSG10
161
+ Solid cannot be created from an open shell
162
+ !
163
+ .FixAdvSolid.FixOrientation.MSG20
164
+ Orientation of shell(s) in solid was corrected
165
+ !
166
+ .FixAdvSolid.FixOrientation.MSG30
167
+ Improperly connected solid split into several parts
168
+ !
169
+ .FixAdvFace.FixLoopWire.MSG0
170
+ Wire was split on several wires
171
+ !
172
+ .FixAdvFace..MSG5
173
+ !
174
+ .FixAdvFace..MSG10
175
+ !
176
+ .FixEdge.SameParameter.MSG0
177
+ Not same parameter edge fixed
178
+ !
179
+ ! ------------------------------------------------------------------------------
180
+ ! Messages for ShapeFix_FixSmallFace
181
+ !
182
+ .FixAdvFace.FixSpotFace.MSG0
183
+ Spot face removed
184
+ !
185
+ .FixAdvFace.FixStripFace.MSG0
186
+ Strip face removed
187
+ !
188
+ ! ------------------------------------------------------------------------------
189
+ ! Messages for ShapeFix_FixSmallSolid
190
+ !
191
+ .ShapeFix.FixSmallSolid.MSG0
192
+ Small solid removed
193
+ !
194
+ .ShapeFix.FixSmallSolid.MSG1
195
+ Small solid merged with other
196
+ !
197
+ ! ------------------------------------------------------------------------------
198
+ ! Messages for ShapeFix_Shell
199
+ !
200
+ .FixAdvShell.FixOrientation.MSG0
201
+ Faces were incorrectly oriented in the shell, corrected
202
+ !
203
+ .FixAdvShell.FixOrientation.MSG5
204
+ Faces were incorrectly oriented in the shell, not corrected
205
+ !
206
+ .FixAdvShell.FixClosedFlag.MSG0
207
+ Shell has incorrect flag isClosed
208
+ !
209
+ .FixAdvShell..MSG5
210
+ !
211
+ .FixAdvShell..MSG10
212
+ !
213
+ ! ------------------------------------------------------------------------------
214
+ ! Messages for ShapeUpgrade
215
+ !
216
+ .ShapeDivide.FaceDivide.MSG0
217
+ Face divided
218
+ !
219
+ .ShapeDivide.WireDivide.MSG0
220
+ Wire divided
221
+ !
222
+ .ShapeDivide.EdgeDivide.MSG0
223
+ Edge divided
224
+ !
225
+ .ShapeDivide.FaceConvertToBezier.MSG0
226
+ Face converted to Bezier
227
+ !
228
+ .ShapeDivide.WireConvertToBezier.MSG0
229
+ Wire converted to Bezier
230
+ !
231
+ .ShapeDivide.EdgeConvertToBezier.MSG0
232
+ Edge converted to Bezier
233
+ !
234
+ ! ------------------------------------------------------------------------------
235
+ ! Messages for ShapeCustom
236
+ !
237
+ .BSplineRestriction.NewSurface.MSG0
238
+ Face converted to BSpline
239
+ !
240
+ .BSplineRestriction.NewSurface.MSG1
241
+ BSpline Face re-approximated
242
+ !
243
+ .BSplineRestriction.NewCurve.MSG0
244
+ Edge converted to BSpline
245
+ !
246
+ .BSplineRestriction.NewCurve.MSG1
247
+ BSpline Edge re-approximated
248
+ !
249
+ !
250
+ .ConvertToBSpline.NewSurface.MSG0
251
+ Face converted to BSpline
252
+ !
253
+ .ConvertToBSpline.NewCurve.MSG0
254
+ Edge converted to BSpline
255
+ !
256
+ !
257
+ .ConvertToRevolution.NewSurface.MSG0
258
+ Face converted to surface of revolution
259
+ !
260
+ !
261
+ .DirectModification.NewSurface.MSG0
262
+ Direction of Face of revolution corrected
263
+ !
264
+ !
265
+ .SweptToElementary.NewSurface.MSG0
266
+ Swept Face converted to elementary
267
+ !
@@ -0,0 +1,276 @@
1
+
2
+ //! @file Declarations.glsl includes definition of common uniform variables in OCCT GLSL programs
3
+ //! @def THE_MAX_LIGHTS
4
+ //! Specifies the length of array of lights, which is 8 by default. Defined by Shader Manager.
5
+ // #define THE_MAX_LIGHTS 8
6
+
7
+ //! @def THE_MAX_CLIP_PLANES
8
+ //! Specifies the length of array of clipping planes, which is 8 by default. Defined by Shader Manager.
9
+ // #define THE_MAX_CLIP_PLANES 8
10
+
11
+ //! @def THE_NB_FRAG_OUTPUTS
12
+ //! Specifies the length of array of Fragment Shader outputs, which is 1 by default. Defined by Shader Manager.
13
+ // #define THE_NB_FRAG_OUTPUTS 1
14
+
15
+ // compatibility macros
16
+ #if (__VERSION__ >= 130)
17
+ #define THE_ATTRIBUTE in
18
+ #define THE_SHADER_IN in
19
+ #define THE_SHADER_OUT out
20
+ #define THE_OUT out
21
+ #define occTexture1D texture
22
+ #define occTexture2D texture
23
+ #define occTexture3D texture
24
+ #define occTextureCube texture
25
+ #define occTextureCubeLod textureLod
26
+ #else
27
+ #define THE_ATTRIBUTE attribute
28
+ #define THE_SHADER_IN varying
29
+ #define THE_SHADER_OUT varying
30
+ #define THE_OUT
31
+ #define occTexture1D texture1D
32
+ #define occTexture2D texture2D
33
+ #define occTexture3D texture3D
34
+ #define occTextureCube textureCube
35
+ #if !defined(GL_ES) || defined(textureCubeLod)
36
+ #define occTextureCubeLod textureCubeLod
37
+ #else // fallback
38
+ #define occTextureCubeLod(theSampl,theCoord,theLod) textureCube(theSampl,theCoord)
39
+ #endif
40
+ #endif
41
+
42
+ #ifdef GL_ES
43
+ #if (__VERSION__ >= 300)
44
+ #define THE_PREC_ENUM highp // lowp should be enough for enums but triggers driver bugs
45
+ #else
46
+ #define THE_PREC_ENUM lowp
47
+ #endif
48
+ #else
49
+ #define THE_PREC_ENUM
50
+ #endif
51
+
52
+ // Vertex attributes
53
+ #ifdef VERTEX_SHADER
54
+ THE_ATTRIBUTE vec4 occVertex;
55
+ THE_ATTRIBUTE vec3 occNormal;
56
+ THE_ATTRIBUTE vec4 occTexCoord;
57
+ THE_ATTRIBUTE vec4 occVertColor;
58
+ #elif defined(FRAGMENT_SHADER)
59
+ #if (__VERSION__ >= 130)
60
+ #ifdef OCC_ENABLE_draw_buffers
61
+ out vec4 occFragColorArray[THE_NB_FRAG_OUTPUTS];
62
+ #define occFragColorArrayAlias occFragColorArray
63
+ #define occFragColor0 occFragColorArray[0]
64
+ #else
65
+ out vec4 occFragColor0;
66
+ #endif
67
+ #else
68
+ #ifdef OCC_ENABLE_draw_buffers
69
+ #define occFragColorArrayAlias gl_FragData
70
+ #define occFragColor0 gl_FragData[0]
71
+ #else
72
+ #define occFragColor0 gl_FragColor
73
+ #endif
74
+ #endif
75
+
76
+ #if (THE_NB_FRAG_OUTPUTS >= 2)
77
+ #define occFragColor1 occFragColorArrayAlias[1]
78
+ #else
79
+ vec4 occFragColor1;
80
+ #endif
81
+ #if (THE_NB_FRAG_OUTPUTS >= 3)
82
+ #define occFragColor2 occFragColorArrayAlias[2]
83
+ #else
84
+ vec4 occFragColor2;
85
+ #endif
86
+ #if (THE_NB_FRAG_OUTPUTS >= 4)
87
+ #define occFragColor3 occFragColorArrayAlias[3]
88
+ #else
89
+ vec4 occFragColor3;
90
+ #endif
91
+
92
+ // Built-in outputs notation
93
+ #define occFragColor occFragColor0
94
+ #define occFragCoverage occFragColor1
95
+
96
+ #define occPeelDepth occFragColor0
97
+ #define occPeelFrontColor occFragColor1
98
+ #define occPeelBackColor occFragColor2
99
+
100
+ //! Define the main Fragment Shader early return procedure.
101
+ bool occFragEarlyReturn();
102
+
103
+ //! Define the main Fragment Shader output - color value.
104
+ void occSetFragColor (in vec4 theColor);
105
+ #endif
106
+
107
+ // Pi number definitions
108
+ #define PI 3.141592654
109
+ #define PI_2 6.283185307
110
+ #define PI_DIV_2 1.570796327
111
+ #define PI_DIV_3 1.047197551
112
+ #define PI_DIV_4 0.785398163
113
+ #define INV_PI 0.318309886
114
+ #define INV_PI_2 0.159154943
115
+
116
+ // Matrix state
117
+ uniform mat4 occWorldViewMatrix; //!< World-view matrix
118
+ uniform mat4 occProjectionMatrix; //!< Projection matrix
119
+ uniform mat4 occModelWorldMatrix; //!< Model-world matrix
120
+
121
+ uniform mat4 occWorldViewMatrixInverse; //!< Inverse of the world-view matrix
122
+ uniform mat4 occProjectionMatrixInverse; //!< Inverse of the projection matrix
123
+ uniform mat4 occModelWorldMatrixInverse; //!< Inverse of the model-world matrix
124
+
125
+ uniform mat4 occWorldViewMatrixTranspose; //!< Transpose of the world-view matrix
126
+ uniform mat4 occProjectionMatrixTranspose; //!< Transpose of the projection matrix
127
+ uniform mat4 occModelWorldMatrixTranspose; //!< Transpose of the model-world matrix
128
+
129
+ uniform mat4 occWorldViewMatrixInverseTranspose; //!< Transpose of the inverse of the world-view matrix
130
+ uniform mat4 occProjectionMatrixInverseTranspose; //!< Transpose of the inverse of the projection matrix
131
+ uniform mat4 occModelWorldMatrixInverseTranspose; //!< Transpose of the inverse of the model-world matrix
132
+
133
+ #if defined(THE_IS_PBR)
134
+ uniform sampler2D occEnvLUT; //!< Environment Lookup Table
135
+ uniform sampler2D occDiffIBLMapSHCoeffs; //!< Packed diffuse (irradiance) IBL map's spherical harmonics coefficients
136
+ uniform samplerCube occSpecIBLMap; //!< Specular IBL map
137
+ uniform int occNbSpecIBLLevels; //!< Number of mipmap levels used in occSpecIBLMap to store different roughness values maps
138
+
139
+ vec3 occDiffIBLMap (in vec3 theNormal); //!< Unpacks spherical harmonics coefficients to diffuse IBL map's values
140
+ #endif
141
+
142
+ // light type enumeration (same as Graphic3d_TypeOfLightSource)
143
+ const int OccLightType_Direct = 1; //!< directional light source
144
+ const int OccLightType_Point = 2; //!< isotropic point light source
145
+ const int OccLightType_Spot = 3; //!< spot light source
146
+
147
+ // Light sources
148
+ uniform vec4 occLightAmbient; //!< Cumulative ambient color
149
+ #if defined(THE_MAX_LIGHTS) && (THE_MAX_LIGHTS > 0)
150
+ #if (THE_MAX_LIGHTS > 1)
151
+ #define occLight_Index(theId) theId
152
+ #else
153
+ #define occLight_Index(theId) 0
154
+ #endif
155
+ uniform THE_PREC_ENUM int occLightSourcesCount; //!< Total number of light sources
156
+
157
+ //! Type of light source, int (see OccLightType enum).
158
+ #define occLight_Type(theId) occLightSourcesTypes[occLight_Index(theId)]
159
+
160
+ //! Specular intensity (equals to diffuse), vec3.
161
+ #define occLight_Specular(theId) occLightSources[occLight_Index(theId) * 4 + 0].rgb
162
+
163
+ //! Intensity of light source (>= 0), float.
164
+ #define occLight_Intensity(theId) occLightSources[occLight_Index(theId) * 4 + 0].a
165
+
166
+ //! Is light a headlight, bool? DEPRECATED method.
167
+ #define occLight_IsHeadlight(theId) false
168
+
169
+ //! Position of specified light source or direction of directional light source, vec3.
170
+ #define occLight_Position(theId) occLightSources[occLight_Index(theId) * 4 + 1].xyz
171
+
172
+ //! Direction of specified spot light source, vec3.
173
+ #define occLight_SpotDirection(theId) occLightSources[occLight_Index(theId) * 4 + 2].xyz
174
+
175
+ //! Range on which point light source (positional or spot) can affect (>= 0), float.
176
+ #define occLight_Range(theId) occLightSources[occLight_Index(theId) * 4 + 2].w
177
+
178
+ //! Maximum spread angle of the spot light (in radians), float.
179
+ #define occLight_SpotCutOff(theId) occLightSources[occLight_Index(theId) * 4 + 3].z
180
+
181
+ //! Attenuation of the spot light intensity (from 0 to 1), float.
182
+ #define occLight_SpotExponent(theId) occLightSources[occLight_Index(theId) * 4 + 3].w
183
+
184
+ #if !defined(THE_IS_PBR)
185
+ //! Diffuse intensity (equals to Specular), vec3.
186
+ #define occLight_Diffuse(theId) occLightSources[occLight_Index(theId) * 4 + 0].rgb
187
+
188
+ //! Const attenuation factor of positional light source, float.
189
+ #define occLight_ConstAttenuation(theId) occLightSources[occLight_Index(theId) * 4 + 3].x
190
+
191
+ //! Linear attenuation factor of positional light source, float.
192
+ #define occLight_LinearAttenuation(theId) occLightSources[occLight_Index(theId) * 4 + 3].y
193
+ #endif
194
+ #endif
195
+
196
+ #if defined(THE_IS_PBR)
197
+ //! Converts roughness value from range [0, 1] to real value for calculations
198
+ float occRoughness (in float theNormalizedRoughness);
199
+
200
+ // Front/back material properties accessors
201
+ vec4 occPBRMaterial_Color(in bool theIsFront); //!< Base color of PBR material
202
+ float occPBRMaterial_Metallic(in bool theIsFront); //!< Metallic coefficient
203
+ float occPBRMaterial_NormalizedRoughness(in bool theIsFront); //!< Normalized roughness coefficient
204
+ vec3 occPBRMaterial_Emission(in bool theIsFront); //!< Light intensity emitted by material
205
+ float occPBRMaterial_IOR(in bool theIsFront); //!< Index of refraction
206
+ #define occMaterial_Emission occPBRMaterial_Emission
207
+ #define occMaterial_Color occPBRMaterial_Color
208
+ #else
209
+ vec4 occMaterial_Diffuse(in bool theIsFront); //!< Diffuse reflection
210
+ vec3 occMaterial_Specular(in bool theIsFront); //!< Specular reflection
211
+ float occMaterial_Shininess(in bool theIsFront); //!< Specular exponent
212
+ vec3 occMaterial_Ambient(in bool theIsFront); //!< Ambient reflection
213
+ vec3 occMaterial_Emission(in bool theIsFront); //!< Emission color
214
+ #define occMaterial_Color occMaterial_Diffuse
215
+ #endif
216
+
217
+ #ifdef THE_HAS_DEFAULT_SAMPLER
218
+ #define occActiveSampler occSampler0 //!< alias for backward compatibility
219
+ #define occSamplerBaseColor occSampler0 //!< alias to a base color texture
220
+ uniform sampler2D occSampler0; //!< current active sampler;
221
+ #endif //! occSampler1, occSampler2,... should be defined in GLSL program body for multitexturing
222
+
223
+ #if defined(THE_HAS_TEXTURE_COLOR) && defined(FRAGMENT_SHADER)
224
+ #define occMaterialBaseColor(theIsFront, theTexCoord) (occMaterial_Color(theIsFront) * occTexture2D(occSamplerBaseColor, theTexCoord))
225
+ #else
226
+ #define occMaterialBaseColor(theIsFront, theTexCoord) occMaterial_Color(theIsFront)
227
+ #endif
228
+
229
+ #if defined(THE_HAS_TEXTURE_OCCLUSION) && defined(FRAGMENT_SHADER)
230
+ uniform sampler2D occSamplerOcclusion; //!< R occlusion texture sampler
231
+ #define occMaterialOcclusion(theColor, theTexCoord) theColor *= occTexture2D(occSamplerOcclusion, theTexCoord).r;
232
+ #else
233
+ #define occMaterialOcclusion(theColor, theTexCoord)
234
+ #endif
235
+
236
+ #if defined(THE_HAS_TEXTURE_EMISSIVE) && defined(FRAGMENT_SHADER)
237
+ uniform sampler2D occSamplerEmissive; //!< RGB emissive texture sampler
238
+ #define occMaterialEmission(theIsFront, theTexCoord) (occMaterial_Emission(theIsFront) * occTexture2D(occSamplerEmissive, theTexCoord).rgb)
239
+ #else
240
+ #define occMaterialEmission(theIsFront, theTexCoord) occMaterial_Emission(theIsFront)
241
+ #endif
242
+
243
+ #if defined(THE_HAS_TEXTURE_NORMAL) && defined(FRAGMENT_SHADER)
244
+ uniform sampler2D occSamplerNormal; //!< XYZ normal texture sampler with W==0 indicating no texture
245
+ #define occTextureNormal(theTexCoord) occTexture2D(occSamplerNormal, theTexCoord)
246
+ #else
247
+ #define occTextureNormal(theTexCoord) vec4(0.0) // no normal map
248
+ #endif
249
+
250
+ #if defined(THE_HAS_TEXTURE_METALROUGHNESS) && defined(FRAGMENT_SHADER)
251
+ uniform sampler2D occSamplerMetallicRoughness; //!< BG metallic-roughness texture sampler
252
+ #define occMaterialRoughness(theIsFront, theTexCoord) (occPBRMaterial_NormalizedRoughness(theIsFront) * occTexture2D(occSamplerMetallicRoughness, theTexCoord).g)
253
+ #define occMaterialMetallic(theIsFront, theTexCoord) (occPBRMaterial_Metallic(theIsFront) * occTexture2D(occSamplerMetallicRoughness, theTexCoord).b)
254
+ #else
255
+ #define occMaterialRoughness(theIsFront, theTexCoord) occPBRMaterial_NormalizedRoughness(theIsFront)
256
+ #define occMaterialMetallic(theIsFront, theTexCoord) occPBRMaterial_Metallic(theIsFront)
257
+ #endif
258
+
259
+ uniform vec4 occColor; //!< color value (in case of disabled lighting)
260
+ uniform THE_PREC_ENUM int occDistinguishingMode; //!< Are front and back faces distinguished?
261
+ uniform THE_PREC_ENUM int occTextureEnable; //!< Is texture enabled?
262
+ uniform vec4 occTexTrsf2d[2]; //!< 2D texture transformation parameters
263
+ uniform float occPointSize; //!< point size
264
+
265
+ //! Parameters of blended order-independent transparency rendering algorithm
266
+ uniform int occOitOutput; //!< Enable bit for writing output color buffers for OIT (occFragColor, occFragCoverage)
267
+ uniform float occOitDepthFactor; //!< Influence of the depth component to the coverage of the accumulated fragment
268
+ uniform float occAlphaCutoff; //!< alpha test cutoff value
269
+
270
+ //! Parameters of clipping planes
271
+ #if defined(THE_MAX_CLIP_PLANES) && (THE_MAX_CLIP_PLANES > 0)
272
+ uniform vec4 occClipPlaneEquations[THE_MAX_CLIP_PLANES];
273
+ uniform THE_PREC_ENUM int occClipPlaneChains[THE_MAX_CLIP_PLANES]; //! Indicating the number of planes in the Chain
274
+ uniform THE_PREC_ENUM int occClipPlaneCount; //!< Total number of clip planes
275
+ #endif
276
+ //! @endfile Declarations.glsl
@@ -0,0 +1,121 @@
1
+
2
+ //! @file DeclarationsImpl.glsl includes implementation of common functions and properties accessors
3
+ #if defined(FRAGMENT_SHADER)
4
+
5
+ #if defined(OCC_DEPTH_PEEL_OIT)
6
+ uniform sampler2D occDepthPeelingDepth;
7
+ uniform sampler2D occDepthPeelingFrontColor;
8
+ int IsFrontPeelLayer = -1;
9
+ bool occFragEarlyReturn()
10
+ {
11
+ #define THE_DEPTH_CLEAR_VALUE -1e15f
12
+ ivec2 aFragCoord = ivec2 (gl_FragCoord.xy);
13
+ vec2 aLastDepth = texelFetch (occDepthPeelingDepth, aFragCoord, 0).rg;
14
+ occPeelFrontColor = texelFetch (occDepthPeelingFrontColor, aFragCoord, 0);
15
+ occPeelDepth.rg = vec2 (THE_DEPTH_CLEAR_VALUE); // depth value always increases, so that MAX blend equation can be used
16
+ occPeelBackColor = vec4 (0.0); // back color is blend after each peeling pass
17
+
18
+ float aNearDepth = -aLastDepth.x;
19
+ float aFarDepth = aLastDepth.y;
20
+ float aFragDepth = gl_FragCoord.z; // 0 - 1
21
+ if (aFragDepth < aNearDepth || aFragDepth > aFarDepth)
22
+ {
23
+ return true; // skip peeled depth
24
+ }
25
+ else if (aFragDepth > aNearDepth && aFragDepth < aFarDepth)
26
+ {
27
+ // to be rendered at next peeling pass
28
+ occPeelDepth.rg = vec2 (-aFragDepth, aFragDepth);
29
+ return true;
30
+ }
31
+
32
+ IsFrontPeelLayer = (gl_FragCoord.z == aNearDepth) ? 1 : 0;
33
+ return false;
34
+ }
35
+ #else
36
+ bool occFragEarlyReturn() { return false; }
37
+ #endif
38
+
39
+ void occSetFragColor (in vec4 theColor)
40
+ {
41
+ #if defined(OCC_ALPHA_TEST)
42
+ if (theColor.a < occAlphaCutoff) discard;
43
+ #endif
44
+ #if defined(OCC_WRITE_WEIGHT_OIT_COVERAGE)
45
+ float aWeight = theColor.a * clamp (1e+2 * pow (1.0 - gl_FragCoord.z * occOitDepthFactor, 3.0), 1e-2, 1e+2);
46
+ occFragCoverage.r = theColor.a * aWeight;
47
+ occFragColor = vec4 (theColor.rgb * theColor.a * aWeight, theColor.a);
48
+ #elif defined(OCC_DEPTH_PEEL_OIT)
49
+ if (IsFrontPeelLayer == 1) // front is blended directly
50
+ {
51
+ vec4 aLastColor = occPeelFrontColor;
52
+ float anAlphaMult = 1.0 - aLastColor.a;
53
+ occPeelFrontColor.rgb = aLastColor.rgb + theColor.rgb * theColor.a * anAlphaMult;
54
+ occPeelFrontColor.a = 1.0 - anAlphaMult * (1.0 - theColor.a);
55
+ }
56
+ else if (IsFrontPeelLayer == 0) // back is blended afterwards
57
+ {
58
+ occPeelBackColor = theColor;
59
+ }
60
+ #else
61
+ occFragColor = theColor;
62
+ #endif
63
+ }
64
+ #endif
65
+
66
+ #if defined(THE_MAX_LIGHTS) && (THE_MAX_LIGHTS > 0)
67
+ // arrays of light sources
68
+ uniform vec4 occLightSources[THE_MAX_LIGHTS * 4]; //!< packed light sources parameters
69
+ uniform THE_PREC_ENUM int occLightSourcesTypes[THE_MAX_LIGHTS]; //!< packed light sources types
70
+ #endif
71
+
72
+ #if defined(THE_IS_PBR)
73
+ vec3 occDiffIBLMap (in vec3 theNormal)
74
+ {
75
+ vec3 aSHCoeffs[9];
76
+ for (int i = 0; i < 9; ++i)
77
+ {
78
+ aSHCoeffs[i] = occTexture2D (occDiffIBLMapSHCoeffs, vec2 ((float(i) + 0.5) / 9.0, 0.0)).rgb;
79
+ }
80
+ return aSHCoeffs[0]
81
+
82
+ + aSHCoeffs[1] * theNormal.x
83
+ + aSHCoeffs[2] * theNormal.y
84
+ + aSHCoeffs[3] * theNormal.z
85
+
86
+ + aSHCoeffs[4] * theNormal.x * theNormal.z
87
+ + aSHCoeffs[5] * theNormal.y * theNormal.z
88
+ + aSHCoeffs[6] * theNormal.x * theNormal.y
89
+
90
+ + aSHCoeffs[7] * (3.0 * theNormal.z * theNormal.z - 1.0)
91
+ + aSHCoeffs[8] * (theNormal.x * theNormal.x - theNormal.y * theNormal.y);
92
+ }
93
+ #endif
94
+
95
+ // front and back material properties accessors
96
+ #if defined(THE_IS_PBR)
97
+ uniform vec4 occPbrMaterial[3 * 2];
98
+
99
+ #define MIN_ROUGHNESS 0.01
100
+ float occRoughness (in float theNormalizedRoughness) { return theNormalizedRoughness * (1.0 - MIN_ROUGHNESS) + MIN_ROUGHNESS; }
101
+ vec4 occPBRMaterial_Color(in bool theIsFront) { return theIsFront ? occPbrMaterial[0] : occPbrMaterial[3]; }
102
+ vec3 occPBRMaterial_Emission(in bool theIsFront) { return theIsFront ? occPbrMaterial[1].rgb : occPbrMaterial[4].rgb; }
103
+ float occPBRMaterial_IOR(in bool theIsFront) { return theIsFront ? occPbrMaterial[1].w : occPbrMaterial[4].w; }
104
+ float occPBRMaterial_Metallic(in bool theIsFront) { return theIsFront ? occPbrMaterial[2].b : occPbrMaterial[5].b; }
105
+ float occPBRMaterial_NormalizedRoughness(in bool theIsFront) { return theIsFront ? occPbrMaterial[2].g : occPbrMaterial[5].g; }
106
+ #else
107
+ uniform vec4 occCommonMaterial[4 * 2];
108
+
109
+ vec4 occMaterial_Diffuse(in bool theIsFront) { return theIsFront ? occCommonMaterial[0] : occCommonMaterial[4]; }
110
+ vec3 occMaterial_Emission(in bool theIsFront) { return theIsFront ? occCommonMaterial[1].rgb : occCommonMaterial[5].rgb; }
111
+ vec3 occMaterial_Specular(in bool theIsFront) { return theIsFront ? occCommonMaterial[2].rgb : occCommonMaterial[6].rgb; }
112
+ float occMaterial_Shininess(in bool theIsFront) { return theIsFront ? occCommonMaterial[2].a : occCommonMaterial[6].a; }
113
+ vec3 occMaterial_Ambient(in bool theIsFront) { return theIsFront ? occCommonMaterial[3].rgb : occCommonMaterial[7].rgb; }
114
+ #endif
115
+
116
+ // 2D texture coordinates transformation
117
+ vec2 occTextureTrsf_Translation(void) { return occTexTrsf2d[0].xy; }
118
+ vec2 occTextureTrsf_Scale(void) { return occTexTrsf2d[0].zw; }
119
+ float occTextureTrsf_RotationSin(void) { return occTexTrsf2d[1].x; }
120
+ float occTextureTrsf_RotationCos(void) { return occTexTrsf2d[1].y; }
121
+ //! @endfile DeclarationsImpl.glsl