diff --git a/README.md b/README.md index cad1abd..3be7127 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,121 @@ CUDA Rasterizer + =============== +**University of Pennsylvania, CIS 565: GPU Programming and Architecture, Project 4** -[CLICK ME FOR INSTRUCTION OF THIS PROJECT](./INSTRUCTION.md) +* Jiawei Wang +* Tested on: Windows 10, i7-6700 @ 2.60GHz 16.0GB, GTX 970M 3072MB (Personal) +## Overview +___ +* Implemented a simplified **rasterized graphics pipeline**, similar to the OpenGL pipeline using CUDA. -**University of Pennsylvania, CIS 565: GPU Programming and Architecture, Project 4** +| **K-Buffer Results(Depth = 4)** | +|---| +|| + +| **Duck Wireframe/Points Toggle** | **CesiumMilkTruck K-Buffer**| +|---|---| +||| + +* Basic Pipeline: + * Vertex shading + * Primitive assembly with support for triangles read from buffers of index and vertex data + * Rasterization + * Fragment shading + * A depth buffer for storing and depth testing fragments + * Fragment-to-depth-buffer writing (with atomics for race avoidance) + * (Fragment shader) simple lighting scheme, such as Lambert or Blinn-Phong +* Additional Features: + * BackFace Culling(optimized using stream compaction) + * UV texture mapping with bilinear texture filtering and perspective correct texture coordinates + * Support for rasterizing additional primitives: + * Wireframes + * Points + * For rasterizing lines and points, you may start with a toggle mode that switches your pipeline from displaying triangles to displaying a wireframe or a point cloud + * **Order-independent translucency using a k-buffer** + +## Feature Details +___ +### Perspective Correct Texture Coordinates +* Simply interpolate the 2D-coordinates on screen space will cause an unrealistic effect like the left image during the render. Because z-coordinates cannot be taken into account in simple screen space interpolation. +* Perspective correct mapping interpolates after dividing by depth, then uses its interpolated reciprocal to recover the correct coordinate will fixed this problem.

+ +| **Without Perspective Correct Texutre** | **With Perspective Correct Texutre**| +|---|---| +|| + +### Wireframes and Points +* In this project, I still keep only one type of *Primitive Assembly* --- 'Triangle', but I created 2 other rasterizers for lines and points.
+ +| **cow.gltf** | **CesiumMilkTruck.gltf** | +|---|---| +||| + +### Order-independent translucency using a k-buffer + +* Commonly, 3D geometry with transparency is rendered by blending (using alpha compositing) all surfaces into a single buffer (think of this as a canvas). Each surface occludes existing color and adds some of its own color depending on its alpha value, a ratio of light transmittance. The order in which surfaces are blended affects the total occlusion or visibility of each surface. For a correct result, surfaces must be blended from farthest to nearest or nearest to farthest, depending on the alpha compositing operation, over or under. Ordering may be achieved by rendering the geometry in sorted order, for example sorting triangles by depth, but can take a significant amount of time, not always produce a solution (in the case of intersecting or circularly overlapping geometry) and the implementation is complex. Instead, **order-independent transparency** sorts geometry per-pixel, after rasterisation. For exact results this requires storing all fragments before sorting and compositing. [From https://en.wikipedia.org/wiki/Order-independent_transparency] +* In this project, I created a **K-buffer** for each fragmentbuffer. Each **K-buffer** contains 4 layers, each layer contains 4 channels, **RGBZ**. +* During the rasterization, instead of assigning a color to the fragmentbuffer, I assign the color to the K-buffer, and then sort it according to the depth(Z). +* Finally, we can do the correct alpha blend easily using the sorted K-buffer.
+ +| **K-Buffer Off** | **K-buffer On**| +|---|---| +| | | + +| **Without Texture** | **With Texture**| +|---|---| +| | | + +### Backface Culling +* In most cases, back faces are meaningless during the render, also it will increase the rendering time or even create some wrong visual effects. +* We can easily use the `face_normal` and `eyePos` to determine whether a face is a 'backface', and then use the `thrust::romove` to do the *Stream Compaction*
+ +| **Backface Culling Off** | **Backface Culling On**| +|---|---| +| || + +| **Backface Culling Off** | **Backface Culling On**| +|---|---| +| || +* You can see that without backface culling, there can be some artifacts during the transparency rendering. -* (TODO) YOUR NAME HERE -* Tested on: (TODO) Windows 22, i7-2222 @ 2.22GHz 22GB, GTX 222 222MB (Moore 2222 Lab) +### Performance Analysis +___ +* Pipeline Time Distribution: -### (TODO: Your README) +|**Camera.z = -3.5**|**Camera.z = -5.5**| +|---|---| +||| -*DO NOT* leave the README to the last minute! It is a crucial part of the -project, and we will not be able to grade you without a good README. +* According to the plot above, we can find out that ***Rasterization*** > ***Render*** > ***Vertex Process & primitive Assembly*** > ***Send To PBO***. + +* Besides, when the camera zoom out, which means camera is further away from the object, the time of *Rasterization* decrease remarkably, while others are still the same. Also the *Rasterization* is the most time-comsuming part. This is because in each thread of the rasterization, it has to iterate through all pixels that this primitive covers, when camera is closer to the object, each primitive of the objects will also be larger than before, this means more pixels have to be iterated for each thread. In the worst case, one primitive can cover all of the pixels in the screen, this means one thread has to scan all screen pixels, and it will extremely slow or even crash. +* There are 5 toggles as following: + * Perspective_Correct_Toggle + * BackFaceCulling_Toggle + * K_Buffer_Toggle + * Bilinear_Color_Filter_Toggle + * Naive_Sort_Toggle: a naive sort function for K-Buffer written by myself. If it's off, the project will use thrust::sort instead. + +| **CesiumMilkTruck.gltf & Camera.z = -15.0** | +|---| +|| +|| +* BackFaceCulling: According to the form and plot, we can find that the backface culling reduce the FPS of the renderer. After backface culling, we do reduce the number of the faces to render, but we still spend many time on backface determining and stream compaction. +* Bilinear_Color_Filter_Texture: According to the results, we can find out that only turn on the *Bilinear_Color_Filter* doesn't affect too much on the efficiency. +* Perspective_Correct: We can see that the FPS drop down from 180 to 84 when the *Perspective Correct* turns on. It's because each pixel during the rasterization has to call the `correct` function, which has lots of floating number calculations and divisions. +* K_Buffer: The FPS drop down to 10 ~ 12 when we turn on the *K_Buffer*. Compare with the K-Buffer-off situation, we have to some additional operations as following: + * Comparing and Writting to dev_K_buffers during the rasterization + * Writting to K-Buffers of the fragmentbuffer during the rasterization. + * Sorting the K-Buffers according to their depth values during the rasterization. + * Computing the Alpha Blending results during the render. +* Naive_Sort: I just use a naive *insertion Sort* method to replace the `thrust::sort_by_keys` and the FPS increases a lot. This is amazing but also confusing. I don't know how exactly the `thrust::sort_by_keys` works, but it should be similar to *Radix Sort* we implemented before. And in this case, the K-buffer only has 4 elements, so the *insertion Sort* will be definitely faster than *Radix Sort*, especially the sequence is sorted before the insertion. But the *Radix Sort* should not be such slow. ### Credits +* [Bilinear Filter](https://en.wikipedia.org/wiki/Bilinear_filtering) by WIKI +* [Order-independent-transparency](https://en.wikipedia.org/wiki/Order-independent_transparency) by WIKI +* [K-buffer](http://on-demand.gputechconf.com/gtc/2014/presentations/S4385-order-independent-transparency-opengl.pdf) by NVIDIA * [tinygltfloader](https://github.com/syoyo/tinygltfloader) by [@soyoyo](https://github.com/syoyo) * [glTF Sample Models](https://github.com/KhronosGroup/glTF/blob/master/sampleModels/README.md) diff --git a/gltfs/GearboxAssy/GearboxAssy.bin b/gltfs/GearboxAssy/GearboxAssy.bin new file mode 100644 index 0000000..92cdd86 --- /dev/null +++ b/gltfs/GearboxAssy/GearboxAssy.bin @@ -0,0 +1,799 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + glTF-Sample-Models/GearboxAssy.bin at master · KhronosGroup/glTF-Sample-Models + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Skip to content +
+ + + + + + + + + + + + + +
+ +
+ +
+
+ + + +
+
+
+ + + + + + + + +
+
+ +
    +
  • +
    + +
    + + + +
    +
    +
    + + Notifications +
    + + + +
    +
    +
    +
    +
  • + +
  • + +
    +
    + + + +
    +
    + + + +
    + +
  • + +
  • +
    + +
    + +
  • +
+ +

+ + /glTF-Sample-Models + +

+ +
+ + + + +
+ +
+
+ + + Permalink + + + +
+ +
+ + +
+ +
+
+ + Switch branches/tags +
+ +
+
+ +
+
+ +
+
+ + + +
+
+ + +
+ +
Nothing to show
+
+ +
+
+
+ +
+ + Find file + + +
+ +
+ + + +
+ + + 1643ed0 + + Apr 25, 2016 + + + +
+ + +
+ + +
+ + +
+
+
+ + + + + + + +
+ +
+ +
+ 4.71 MB +
+
+ + + +
+
+ View Raw +

(Sorry about that, but we can’t show files that are this big right now.)

+
+
+ +
+ + + + +
+ +
+ +
+
+ +
+ + + + + + +
+ + + You can't perform that action at this time. +
+ + + + + + + + + + +
+ + You signed in with another tab or window. Reload to refresh your session. + You signed out in another tab or window. Reload to refresh your session. +
+ + + + + + diff --git a/gltfs/GearboxAssy/GearboxAssy.gltf b/gltfs/GearboxAssy/GearboxAssy.gltf new file mode 100644 index 0000000..50eb0ef --- /dev/null +++ b/gltfs/GearboxAssy/GearboxAssy.gltf @@ -0,0 +1,22143 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + glTF-Sample-Models/GearboxAssy.gltf at master · KhronosGroup/glTF-Sample-Models + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Skip to content +
+ + + + + + + + + + + + + +
+ +
+ +
+
+ + + +
+
+
+ + + + + + + + +
+
+ +
    +
  • +
    + +
    + + + +
    +
    +
    + + Notifications +
    + + + +
    +
    +
    +
    +
  • + +
  • + +
    +
    + + + +
    +
    + + + +
    + +
  • + +
  • +
    + +
    + +
  • +
+ +

+ + /glTF-Sample-Models + +

+ +
+ + + + +
+ +
+
+ + + Permalink + + + +
+ +
+ + +
+ +
+
+ + Switch branches/tags +
+ +
+
+ +
+
+ +
+
+ + + +
+
+ + +
+ +
Nothing to show
+
+ +
+
+
+ +
+ + Find file + + +
+ +
+ + + +
+ Fetching contributors… +
+ +
+ + Cannot retrieve contributors at this time +
+
+ +
+
+
+ +
+ Raw + Blame + History +
+ + + + + +
+ +
+ +
+ +
+ 5346 lines (5346 sloc) + + 127 KB +
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{
"accessors": {
"accessor_100": {
"bufferView": "bufferView_652",
"byteOffset": 2452584,
"byteStride": 12,
"componentType": 5126,
"count": 7742,
"max": [
1,
0.999957,
1
],
"min": [
-1,
-1,
-1
],
"type": "VEC3"
},
"accessor_116": {
"bufferView": "bufferView_651",
"byteOffset": 1093344,
"byteStride": 0,
"componentType": 5123,
"count": 103728,
"type": "SCALAR"
},
"accessor_118": {
"bufferView": "bufferView_652",
"byteOffset": 2545488,
"byteStride": 12,
"componentType": 5126,
"count": 17968,
"max": [
1.02875,
1.03,
0.6
],
"min": [
-1.02875,
-1.03,
0
],
"type": "VEC3"
},
"accessor_120": {
"bufferView": "bufferView_652",
"byteOffset": 2761104,
"byteStride": 12,
"componentType": 5126,
"count": 17968,
"max": [
0.998781,
1,
1
],
"min": [
-0.998781,
-1,
-1
],
"type": "VEC3"
},
"accessor_136": {
"bufferView": "bufferView_651",
"byteOffset": 1300800,
"byteStride": 0,
"componentType": 5123,
"count": 7650,
"type": "SCALAR"
},
"accessor_138": {
"bufferView": "bufferView_652",
"byteOffset": 2976720,
"byteStride": 12,
"componentType": 5126,
"count": 2582,
"max": [
3.0696,
1.58,
2.3
],
"min": [
-3.0696,
-2.10945,
-0.18
],
"type": "VEC3"
},
"accessor_140": {
"bufferView": "bufferView_652",
"byteOffset": 3007704,
"byteStride": 12,
"componentType": 5126,
"count": 2582,
"max": [
1,
1,
1
],
"min": [
-1,
-1,
-1
],
"type": "VEC3"
},
"accessor_156": {
"bufferView": "bufferView_651",
"byteOffset": 1316100,
"byteStride": 0,
"componentType": 5123,
"count": 91770,
"type": "SCALAR"
},
"accessor_158": {
"bufferView": "bufferView_652",
"byteOffset": 3038688,
"byteStride": 12,
"componentType": 5126,
"count": 15754,
"max": [
1.5,
0.52,
1.5
],
"min": [
-1.5,
-0.256569,
-1.5
],
"type": "VEC3"
},
"accessor_16": {
"bufferView": "bufferView_651",
"byteOffset": 0,
"byteStride": 0,
"componentType": 5123,
"count": 19548,
"type": "SCALAR"
},
"accessor_160": {
"bufferView": "bufferView_652",
"byteOffset": 3227736,
"byteStride": 12,
"componentType": 5126,
"count": 15754,
"max": [
1,
1,
1
],
"min": [
-1,
-0.999835,
-1
],
"type": "VEC3"
},
"accessor_176": {
"bufferView": "bufferView_651",
"byteOffset": 1499640,
"byteStride": 0,
"componentType": 5123,
"count": 1104,
"type": "SCALAR"
},
"accessor_178": {
"bufferView": "bufferView_652",
"byteOffset": 3416784,
"byteStride": 12,
"componentType": 5126,
"count": 368,
"max": [
0.75,
0.75,
1.25
],
"min": [
-0.75,
-0.75,
0
],
"type": "VEC3"
},
"accessor_18": {
"bufferView": "bufferView_652",
"byteOffset": 0,
"byteStride": 12,
"componentType": 5126,
"count": 3300,
"max": [
0.9,
0.9,
1.82447
],
"min": [
-0.9,
-0.9,
-0.074471
],
"type": "VEC3"
},
"accessor_180": {
"bufferView": "bufferView_652",
"byteOffset": 3421200,
"byteStride": 12,
"componentType": 5126,
"count": 368,
"max": [
1,
1,
1
],
"min": [
-1,
-1,
-1
],
"type": "VEC3"
},
"accessor_196": {
"bufferView": "bufferView_651",
"byteOffset": 1501848,
"byteStride": 0,
"componentType": 5123,
"count": 804,
"type": "SCALAR"
},
"accessor_198": {
"bufferView": "bufferView_652",
"byteOffset": 3425616,
"byteStride": 12,
"componentType": 5126,
"count": 276,
"max": [
0.6805,
0.6805,
0
],
"min": [
-0.6805,
-0.6805,
-3.81
],
"type": "VEC3"
},
"accessor_20": {
"bufferView": "bufferView_652",
"byteOffset": 39600,
"byteStride": 12,
"componentType": 5126,
"count": 3300,
"max": [
1,
1,
0.994491
],
"min": [
-1,
-1,
-0.994499
],
"type": "VEC3"
},
"accessor_200": {
"bufferView": "bufferView_652",
"byteOffset": 3428928,
"byteStride": 12,
"componentType": 5126,
"count": 276,
"max": [
1,
1,
1
],
"min": [
-1,
-1,
-1
],
"type": "VEC3"
},
"accessor_216": {
"bufferView": "bufferView_651",
"byteOffset": 50328,
"byteStride": 0,
"componentType": 5123,
"count": 6384,
"type": "SCALAR"
},
"accessor_218": {
"bufferView": "bufferView_652",
"byteOffset": 109152,
"byteStride": 12,
"componentType": 5126,
"count": 2524,
"max": [
4.54916,
4.54988,
0.56
],
"min": [
-4.54885,
-4.54458,
-0.5
],
"type": "VEC3"
},
"accessor_220": {
"bufferView": "bufferView_652",
"byteOffset": 139440,
"byteStride": 12,
"componentType": 5126,
"count": 2524,
"max": [
1,
1,
1
],
"min": [
-1,
-1,
-1
],
"type": "VEC3"
},
"accessor_236": {
"bufferView": "bufferView_651",
"byteOffset": 63096,
"byteStride": 0,
"componentType": 5123,
"count": 14046,
"type": "SCALAR"
},
"accessor_238": {
"bufferView": "bufferView_652",
"byteOffset": 169728,
"byteStride": 12,
"componentType": 5126,
"count": 3200,
"max": [
0.5,
5.15,
0.577325
],
"min": [
-0.5,
-1.29,
-0.577375
],
"type": "VEC3"
},
"accessor_240": {
"bufferView": "bufferView_652",
"byteOffset": 208128,
"byteStride": 12,
"componentType": 5126,
"count": 3200,
"max": [
1,
1,
1
],
"min": [
-1,
-1,
-1
],
"type": "VEC3"
},
"accessor_256": {
"bufferView": "bufferView_651",
"byteOffset": 91188,
"byteStride": 0,
"componentType": 5123,
"count": 5556,
"type": "SCALAR"
},
"accessor_258": {
"bufferView": "bufferView_652",
"byteOffset": 246528,
"byteStride": 12,
"componentType": 5126,
"count": 1292,
"max": [
1.1486,
5.5,
1.15
],
"min": [
-1.1486,
-5,
-1.15
],
"type": "VEC3"
},
"accessor_260": {
"bufferView": "bufferView_652",
"byteOffset": 262032,
"byteStride": 12,
"componentType": 5126,
"count": 1292,
"max": [
1,
1,
1
],
"min": [
-1,
-1,
-1
],
"type": "VEC3"
},
"accessor_276": {
"bufferView": "bufferView_651",
"byteOffset": 102300,
"byteStride": 0,
"componentType": 5123,
"count": 11628,
"type": "SCALAR"
},
"accessor_278": {
"bufferView": "bufferView_652",
"byteOffset": 277536,
"byteStride": 12,
"componentType": 5126,
"count": 1980,
"max": [
1.1,
1.09819,
1.99912
],
"min": [
-1.1,
-1.09968,
-1.92412
],
"type": "VEC3"
},
"accessor_280": {
"bufferView": "bufferView_652",
"byteOffset": 301296,
"byteStride": 12,
"componentType": 5126,
"count": 1980,
"max": [
1,
0.999818,
0.987208
],
"min": [
-1,
-1,
-0.987594
],
"type": "VEC3"
},
"accessor_296": {
"bufferView": "bufferView_651",
"byteOffset": 125556,
"byteStride": 0,
"componentType": 5123,
"count": 5040,
"type": "SCALAR"
},
"accessor_298": {
"bufferView": "bufferView_652",
"byteOffset": 325056,
"byteStride": 12,
"componentType": 5126,
"count": 1664,
"max": [
1.7,
0,
1.69793
],
"min": [
-1.7,
-2.75,
-1.69793
],
"type": "VEC3"
},
"accessor_300": {
"bufferView": "bufferView_652",
"byteOffset": 345024,
"byteStride": 12,
"componentType": 5126,
"count": 1664,
"max": [
1,
1,
1
],
"min": [
-1,
-1,
-1
],
"type": "VEC3"
},
"accessor_316": {
"bufferView": "bufferView_651",
"byteOffset": 135636,
"byteStride": 0,
"componentType": 5123,
"count": 91770,
"type": "SCALAR"
},
"accessor_318": {
"bufferView": "bufferView_652",
"byteOffset": 364992,
"byteStride": 12,
"componentType": 5126,
"count": 15754,
"max": [
1.5,
0.52,
1.5
],
"min": [
-1.5,
-0.256569,
-1.5
],
"type": "VEC3"
},
"accessor_320": {
"bufferView": "bufferView_652",
"byteOffset": 554040,
"byteStride": 12,
"componentType": 5126,
"count": 15754,
"max": [
1,
1,
1
],
"min": [
-1,
-0.999835,
-1
],
"type": "VEC3"
},
"accessor_336": {
"bufferView": "bufferView_651",
"byteOffset": 319176,
"byteStride": 0,
"componentType": 5123,
"count": 1740,
"type": "SCALAR"
},
"accessor_338": {
"bufferView": "bufferView_652",
"byteOffset": 743088,
"byteStride": 12,
"componentType": 5126,
"count": 796,
"max": [
1.5,
1.49634,
-0.008437
],
"min": [
-1.5,
-1.49634,
-0.8
],
"type": "VEC3"
},
"accessor_340": {
"bufferView": "bufferView_652",
"byteOffset": 752640,
"byteStride": 12,
"componentType": 5126,
"count": 796,
"max": [
1,
1,
1
],
"min": [
-1,
-1,
-1
],
"type": "VEC3"
},
"accessor_356": {
"bufferView": "bufferView_651",
"byteOffset": 322656,
"byteStride": 0,
"componentType": 5123,
"count": 636,
"type": "SCALAR"
},
"accessor_358": {
"bufferView": "bufferView_652",
"byteOffset": 762192,
"byteStride": 12,
"componentType": 5126,
"count": 224,
"max": [
6.906,
0.623992,
0.624769
],
"min": [
0,
-0.74,
-0.624622
],
"type": "VEC3"
},
"accessor_36": {
"bufferView": "bufferView_651",
"byteOffset": 39096,
"byteStride": 0,
"componentType": 5123,
"count": 5616,
"type": "SCALAR"
},
"accessor_360": {
"bufferView": "bufferView_652",
"byteOffset": 764880,
"byteStride": 12,
"componentType": 5126,
"count": 224,
"max": [
1,
0.998387,
1
],
"min": [
-1,
-1,
-1
],
"type": "VEC3"
},
"accessor_376": {
"bufferView": "bufferView_651",
"byteOffset": 323928,
"byteStride": 0,
"componentType": 5123,
"count": 276,
"type": "SCALAR"
},
"accessor_378": {
"bufferView": "bufferView_652",
"byteOffset": 767568,
"byteStride": 12,
"componentType": 5126,
"count": 104,
"max": [
3,
0.625,
0.622984
],
"min": [
0,
-0.74,
-0.622984
],
"type": "VEC3"
},
"accessor_38": {
"bufferView": "bufferView_652",
"byteOffset": 79200,
"byteStride": 12,
"componentType": 5126,
"count": 1248,
"max": [
0.918879,
0.92,
0.22
],
"min": [
-0.918879,
-0.92,
0
],
"type": "VEC3"
},
"accessor_380": {
"bufferView": "bufferView_652",
"byteOffset": 768816,
"byteStride": 12,
"componentType": 5126,
"count": 104,
"max": [
1,
1,
1
],
"min": [
-1,
-1,
-1
],
"type": "VEC3"
},
"accessor_396": {
"bufferView": "bufferView_651",
"byteOffset": 324480,
"byteStride": 0,
"componentType": 5123,
"count": 69348,
"type": "SCALAR"
},
"accessor_398": {
"bufferView": "bufferView_652",
"byteOffset": 770064,
"byteStride": 12,
"componentType": 5126,
"count": 13240,
"max": [
2.5,
2.5,
1.68
],
"min": [
-2.5,
-2.5,
0
],
"type": "VEC3"
},
"accessor_40": {
"bufferView": "bufferView_652",
"byteOffset": 94176,
"byteStride": 12,
"componentType": 5126,
"count": 1248,
"max": [
0.998781,
1,
1
],
"min": [
-0.998781,
-1,
-1
],
"type": "VEC3"
},
"accessor_400": {
"bufferView": "bufferView_652",
"byteOffset": 928944,
"byteStride": 12,
"componentType": 5126,
"count": 13240,
"max": [
1,
1,
1
],
"min": [
-1,
-1,
-1
],
"type": "VEC3"
},
"accessor_416": {
"bufferView": "bufferView_651",
"byteOffset": 467904,
"byteStride": 0,
"componentType": 5123,
"count": 300,
"type": "SCALAR"
},
"accessor_418": {
"bufferView": "bufferView_652",
"byteOffset": 1100016,
"byteStride": 12,
"componentType": 5126,
"count": 116,
"max": [
0.275,
0.317543,
1.3
],
"min": [
-0.275,
-0.317543,
-0.2
],
"type": "VEC3"
},
"accessor_420": {
"bufferView": "bufferView_652",
"byteOffset": 1101408,
"byteStride": 12,
"componentType": 5126,
"count": 116,
"max": [
1,
1,
1
],
"min": [
-1,
-1,
-1
],
"type": "VEC3"
},
"accessor_436": {
"bufferView": "bufferView_651",
"byteOffset": 468504,
"byteStride": 0,
"componentType": 5123,
"count": 408,
"type": "SCALAR"
},
"accessor_438": {
"bufferView": "bufferView_652",
"byteOffset": 1102800,
"byteStride": 12,
"componentType": 5126,
"count": 148,
"max": [
0.275,
0.317543,
0.2
],
"min": [
-0.275,
-0.317543,
0
],
"type": "VEC3"
},
"accessor_440": {
"bufferView": "bufferView_652",
"byteOffset": 1104576,
"byteStride": 12,
"componentType": 5126,
"count": 148,
"max": [
1,
1,
1
],
"min": [
-1,
-1,
-1
],
"type": "VEC3"
},
"accessor_456": {
"bufferView": "bufferView_651",
"byteOffset": 469320,
"byteStride": 0,
"componentType": 5123,
"count": 126228,
"type": "SCALAR"
},
"accessor_458": {
"bufferView": "bufferView_652",
"byteOffset": 1106352,
"byteStride": 12,
"componentType": 5126,
"count": 21722,
"max": [
1.22071,
1.2222,
0.55
],
"min": [
-1.22071,
-1.2222,
0
],
"type": "VEC3"
},
"accessor_460": {
"bufferView": "bufferView_652",
"byteOffset": 1367016,
"byteStride": 12,
"componentType": 5126,
"count": 21722,
"max": [
0.998781,
1,
1
],
"min": [
-0.998781,
-1,
-1
],
"type": "VEC3"
},
"accessor_476": {
"bufferView": "bufferView_651",
"byteOffset": 721776,
"byteStride": 0,
"componentType": 5123,
"count": 2952,
"type": "SCALAR"
},
"accessor_478": {
"bufferView": "bufferView_652",
"byteOffset": 1627680,
"byteStride": 12,
"componentType": 5126,
"count": 792,
"max": [
1.1875,
1.1875,
0.33
],
"min": [
-1.1875,
-1.1875,
0
],
"type": "VEC3"
},
"accessor_480": {
"bufferView": "bufferView_652",
"byteOffset": 1637184,
"byteStride": 12,
"componentType": 5126,
"count": 792,
"max": [
1,
1,
1
],
"min": [
-1,
-1,
-1
],
"type": "VEC3"
},
"accessor_496": {
"bufferView": "bufferView_651",
"byteOffset": 727680,
"byteStride": 0,
"componentType": 5123,
"count": 2922,
"type": "SCALAR"
},
"accessor_498": {
"bufferView": "bufferView_652",
"byteOffset": 1646688,
"byteStride": 12,
"componentType": 5126,
"count": 974,
"max": [
2.13,
2.24684,
0.156
],
"min": [
-2.13,
-2.13,
0
],
"type": "VEC3"
},
"accessor_500": {
"bufferView": "bufferView_652",
"byteOffset": 1658376,
"byteStride": 12,
"componentType": 5126,
"count": 974,
"max": [
1,
0.998781,
1
],
"min": [
-1,
-1,
-1
],
"type": "VEC3"
},
"accessor_516": {
"bufferView": "bufferView_651",
"byteOffset": 733524,
"byteStride": 0,
"componentType": 5123,
"count": 4440,
"type": "SCALAR"
},
"accessor_518": {
"bufferView": "bufferView_652",
"byteOffset": 1670064,
"byteStride": 12,
"componentType": 5126,
"count": 1876,
"max": [
3.10798,
3.09998,
0.219
],
"min": [
-3.10798,
-3.09998,
-0.219
],
"type": "VEC3"
},
"accessor_520": {
"bufferView": "bufferView_652",
"byteOffset": 1692576,
"byteStride": 12,
"componentType": 5126,
"count": 1876,
"max": [
1,
1,
1
],
"min": [
-1,
-1,
-1
],
"type": "VEC3"
},
"accessor_536": {
"bufferView": "bufferView_651",
"byteOffset": 742404,
"byteStride": 0,
"componentType": 5123,
"count": 11016,
"type": "SCALAR"
},
"accessor_538": {
"bufferView": "bufferView_652",
"byteOffset": 1715088,
"byteStride": 12,
"componentType": 5126,
"count": 2070,
"max": [
2.25,
2.25,
0.31
],
"min": [
-2.25,
-2.25,
-0.31
],
"type": "VEC3"
},
"accessor_540": {
"bufferView": "bufferView_652",
"byteOffset": 1739928,
"byteStride": 12,
"componentType": 5126,
"count": 2070,
"max": [
1,
1,
1
],
"min": [
-1,
-1,
-1
],
"type": "VEC3"
},
"accessor_556": {
"bufferView": "bufferView_651",
"byteOffset": 764436,
"byteStride": 0,
"componentType": 5123,
"count": 2424,
"type": "SCALAR"
},
"accessor_558": {
"bufferView": "bufferView_652",
"byteOffset": 1764768,
"byteStride": 12,
"componentType": 5126,
"count": 808,
"max": [
0.8125,
0.81151,
2.2555
],
"min": [
-0.8125,
-0.81151,
-2.2555
],
"type": "VEC3"
},
"accessor_56": {
"bufferView": "bufferView_651",
"byteOffset": 463176,
"byteStride": 0,
"componentType": 5123,
"count": 2364,
"type": "SCALAR"
},
"accessor_560": {
"bufferView": "bufferView_652",
"byteOffset": 1774464,
"byteStride": 12,
"componentType": 5126,
"count": 808,
"max": [
1,
0.998781,
1
],
"min": [
-1,
-0.998781,
-1
],
"type": "VEC3"
},
"accessor_576": {
"bufferView": "bufferView_651",
"byteOffset": 769284,
"byteStride": 0,
"componentType": 5123,
"count": 2868,
"type": "SCALAR"
},
"accessor_578": {
"bufferView": "bufferView_652",
"byteOffset": 1784160,
"byteStride": 12,
"componentType": 5126,
"count": 956,
"max": [
2.13,
2.24684,
0.06
],
"min": [
-2.13,
-2.13,
0
],
"type": "VEC3"
},
"accessor_58": {
"bufferView": "bufferView_652",
"byteOffset": 1087824,
"byteStride": 12,
"componentType": 5126,
"count": 508,
"max": [
0.59,
0.681273,
0.405
],
"min": [
-0.59,
-0.681273,
0
],
"type": "VEC3"
},
"accessor_580": {
"bufferView": "bufferView_652",
"byteOffset": 1795632,
"byteStride": 12,
"componentType": 5126,
"count": 956,
"max": [
1,
0.998781,
1
],
"min": [
-1,
-1,
-1
],
"type": "VEC3"
},
"accessor_596": {
"bufferView": "bufferView_651",
"byteOffset": 775020,
"byteStride": 0,
"componentType": 5123,
"count": 300,
"type": "SCALAR"
},
"accessor_598": {
"bufferView": "bufferView_652",
"byteOffset": 1807104,
"byteStride": 12,
"componentType": 5126,
"count": 116,
"max": [
0.275,
0.317543,
2
],
"min": [
-0.275,
-0.317543,
-0.2
],
"type": "VEC3"
},
"accessor_60": {
"bufferView": "bufferView_652",
"byteOffset": 1093920,
"byteStride": 12,
"componentType": 5126,
"count": 508,
"max": [
1,
1,
1
],
"min": [
-1,
-1,
-1
],
"type": "VEC3"
},
"accessor_600": {
"bufferView": "bufferView_652",
"byteOffset": 1808496,
"byteStride": 12,
"componentType": 5126,
"count": 116,
"max": [
1,
1,
1
],
"min": [
-1,
-1,
-1
],
"type": "VEC3"
},
"accessor_616": {
"bufferView": "bufferView_651",
"byteOffset": 980580,
"byteStride": 0,
"componentType": 5123,
"count": 14796,
"type": "SCALAR"
},
"accessor_618": {
"bufferView": "bufferView_652",
"byteOffset": 2236080,
"byteStride": 12,
"componentType": 5126,
"count": 5034,
"max": [
0.685305,
0.686,
14.85
],
"min": [
-0.685992,
-0.686,
0
],
"type": "VEC3"
},
"accessor_620": {
"bufferView": "bufferView_652",
"byteOffset": 2296488,
"byteStride": 12,
"componentType": 5126,
"count": 5034,
"max": [
1,
1,
1
],
"min": [
-1,
-1,
-1
],
"type": "VEC3"
},
"accessor_636": {
"bufferView": "bufferView_651",
"byteOffset": 1010172,
"byteStride": 0,
"componentType": 5123,
"count": 300,
"type": "SCALAR"
},
"accessor_638": {
"bufferView": "bufferView_652",
"byteOffset": 2356896,
"byteStride": 12,
"componentType": 5126,
"count": 116,
"max": [
0.275,
0.317543,
1
],
"min": [
-0.275,
-0.317543,
-0.2
],
"type": "VEC3"
},
"accessor_640": {
"bufferView": "bufferView_652",
"byteOffset": 2358288,
"byteStride": 12,
"componentType": 5126,
"count": 116,
"max": [
1,
1,
1
],
"min": [
-1,
-1,
-1
],
"type": "VEC3"
},
"accessor_76": {
"bufferView": "bufferView_651",
"byteOffset": 775620,
"byteStride": 0,
"componentType": 5123,
"count": 102480,
"type": "SCALAR"
},
"accessor_78": {
"bufferView": "bufferView_652",
"byteOffset": 1809888,
"byteStride": 12,
"componentType": 5126,
"count": 17758,
"max": [
1.22035,
1.21886,
1.406
],
"min": [
-1.22035,
-1.21886,
0.656
],
"type": "VEC3"
},
"accessor_80": {
"bufferView": "bufferView_652",
"byteOffset": 2022984,
"byteStride": 12,
"componentType": 5126,
"count": 17758,
"max": [
1,
0.998781,
1
],
"min": [
-1,
-0.998781,
-1
],
"type": "VEC3"
},
"accessor_96": {
"bufferView": "bufferView_651",
"byteOffset": 1010772,
"byteStride": 0,
"componentType": 5123,
"count": 41286,
"type": "SCALAR"
},
"accessor_98": {
"bufferView": "bufferView_652",
"byteOffset": 2359680,
"byteStride": 12,
"componentType": 5126,
"count": 7742,
"max": [
2.06255,
2.89699,
1.23
],
"min": [
-2.06255,
-1.42,
-0.12
],
"type": "VEC3"
}
},
"animations": {},
"asset": {
"generator": "collada2gltf@027f74366341d569dea42e9a68b7104cc3892054",
"premultipliedAlpha": true,
"profile": {
"api": "WebGL",
"version": "1.0.2"
},
"version": "1.0"
},
"bufferViews": {
"bufferView_651": {
"buffer": "GearboxAssy",
"byteLength": 1503456,
"byteOffset": 0,
"target": 34963
},
"bufferView_652": {
"buffer": "GearboxAssy",
"byteLength": 3432240,
"byteOffset": 1503456,
"target": 34962
}
},
"buffers": {
"GearboxAssy": {
"byteLength": 4935696,
"type": "arraybuffer",
"uri": "GearboxAssy.bin"
}
},
"cameras": {
"default-camera": {
"name": "default_3",
"perspective": {
"aspectRatio": 1,
"yfov": 0.263245,
"zfar": 1e+006,
"znear": 0.05
},
"type": "perspective"
}
},
"materials": {
"Material-fx": {
"name": "Material_1",
"technique": "technique0",
"values": {
"ambient": [
0,
0,
0,
1
],
"diffuse": [
0,
0.262745,
0,
1
],
"emission": [
0,
0,
0,
1
],
"shininess": 16,
"specular": [
0.64,
0.64,
0.64,
1
]
}
},
"Material-fx_1": {
"name": "Material_3",
"technique": "technique0",
"values": {
"ambient": [
0.2,
0.2,
0.2,
1
],
"diffuse": [
0.6,
0.6,
0.6,
1
],
"emission": [
0,
0,
0,
1
],
"shininess": 16,
"specular": [
1,
1,
1,
1
]
}
},
"Material-fx_2": {
"name": "Material_5",
"technique": "technique0",
"values": {
"ambient": [
0.2,
0.2,
0.2,
1
],
"diffuse": [
0.616541,
0.620301,
0.571429,
1
],
"emission": [
0,
0,
0,
1
],
"shininess": 16,
"specular": [
1,
1,
1,
1
]
}
},
"Material-fx_3": {
"name": "Material_7",
"technique": "technique0",
"values": {
"ambient": [
0.2,
0.2,
0.2,
1
],
"diffuse": [
0.654135,
0.657895,
0.503759,
1
],
"emission": [
0,
0,
0,
1
],
"shininess": 16,
"specular": [
1,
1,
1,
1
]
}
},
"Material-fx_4": {
"name": "Material_9",
"technique": "technique0",
"values": {
"ambient": [
0.2,
0.2,
0.2,
1
],
"diffuse": [
0.714286,
0.620301,
0.304511,
1
],
"emission": [
0,
0,
0,
1
],
"shininess": 16,
"specular": [
1,
1,
1,
1
]
}
},
"Material-fx_5": {
"name": "Material_11",
"technique": "technique0",
"values": {
"ambient": [
0,
0,
0,
1
],
"diffuse": [
0.576471,
0.576471,
0.576471,
1
],
"emission": [
0,
0,
0,
1
],
"shininess": 16,
"specular": [
0.64,
0.64,
0.64,
1
]
}
},
"default-fx": {
"name": "default_1",
"technique": "technique0",
"values": {
"ambient": [
0.3,
0.3,
0.3,
1
],
"diffuse": [
0.4,
0.4,
0.4,
1
],
"emission": [
0,
0,
0,
1
],
"shininess": 16,
"specular": [
0.7,
0.7,
0.7,
1
]
}
}
},
"meshes": {
"body-mesh": {
"name": "body",
"primitives": [
{
"attributes": {
"NORMAL": "accessor_20",
"POSITION": "accessor_18"
},
"indices": "accessor_16",
"material": "Material-fx_5",
"mode": 4
}
]
},
"body-mesh_1": {
"name": "body_1",
"primitives": [
{
"attributes": {
"NORMAL": "accessor_40",
"POSITION": "accessor_38"
},
"indices": "accessor_36",
"material": "default-fx",
"mode": 4
}
]
},
"body-mesh_10": {
"name": "body_10",
"primitives": [
{
"attributes": {
"NORMAL": "accessor_220",
"POSITION": "accessor_218"
},
"indices": "accessor_216",
"material": "Material-fx_2",
"mode": 4
}
]
},
"body-mesh_11": {
"name": "body_11",
"primitives": [
{
"attributes": {
"NORMAL": "accessor_240",
"POSITION": "accessor_238"
},
"indices": "accessor_236",
"material": "default-fx",
"mode": 4
}
]
},
"body-mesh_12": {
"name": "body_12",
"primitives": [
{
"attributes": {
"NORMAL": "accessor_260",
"POSITION": "accessor_258"
},
"indices": "accessor_256",
"material": "default-fx",
"mode": 4
}
]
},
"body-mesh_13": {
"name": "body_13",
"primitives": [
{
"attributes": {
"NORMAL": "accessor_280",
"POSITION": "accessor_278"
},
"indices": "accessor_276",
"material": "Material-fx_3",
"mode": 4
}
]
},
"body-mesh_14": {
"name": "body_14",
"primitives": [
{
"attributes": {
"NORMAL": "accessor_300",
"POSITION": "accessor_298"
},
"indices": "accessor_296",
"material": "default-fx",
"mode": 4
}
]
},
"body-mesh_15": {
"name": "body_15",
"primitives": [
{
"attributes": {
"NORMAL": "accessor_320",
"POSITION": "accessor_318"
},
"indices": "accessor_316",
"material": "default-fx",
"mode": 4
}
]
},
"body-mesh_16": {
"name": "body_16",
"primitives": [
{
"attributes": {
"NORMAL": "accessor_340",
"POSITION": "accessor_338"
},
"indices": "accessor_336",
"material": "Material-fx_2",
"mode": 4
}
]
},
"body-mesh_17": {
"name": "body_17",
"primitives": [
{
"attributes": {
"NORMAL": "accessor_360",
"POSITION": "accessor_358"
},
"indices": "accessor_356",
"material": "default-fx",
"mode": 4
}
]
},
"body-mesh_18": {
"name": "body_18",
"primitives": [
{
"attributes": {
"NORMAL": "accessor_380",
"POSITION": "accessor_378"
},
"indices": "accessor_376",
"material": "Material-fx_3",
"mode": 4
}
]
},
"body-mesh_19": {
"name": "body_19",
"primitives": [
{
"attributes": {
"NORMAL": "accessor_400",
"POSITION": "accessor_398"
},
"indices": "accessor_396",
"material": "Material-fx",
"mode": 4
}
]
},
"body-mesh_2": {
"name": "body_2",
"primitives": [
{
"attributes": {
"NORMAL": "accessor_60",
"POSITION": "accessor_58"
},
"indices": "accessor_56",
"material": "Material-fx",
"mode": 4
}
]
},
"body-mesh_20": {
"name": "body_20",
"primitives": [
{
"attributes": {
"NORMAL": "accessor_420",
"POSITION": "accessor_418"
},
"indices": "accessor_416",
"material": "Material-fx",
"mode": 4
}
]
},
"body-mesh_21": {
"name": "body_21",
"primitives": [
{
"attributes": {
"NORMAL": "accessor_440",
"POSITION": "accessor_438"
},
"indices": "accessor_436",
"material": "Material-fx",
"mode": 4
}
]
},
"body-mesh_22": {
"name": "body_22",
"primitives": [
{
"attributes": {
"NORMAL": "accessor_460",
"POSITION": "accessor_458"
},
"indices": "accessor_456",
"material": "default-fx",
"mode": 4
}
]
},
"body-mesh_23": {
"name": "body_23",
"primitives": [
{
"attributes": {
"NORMAL": "accessor_480",
"POSITION": "accessor_478"
},
"indices": "accessor_476",
"material": "Material-fx",
"mode": 4
}
]
},
"body-mesh_24": {
"name": "body_24",
"primitives": [
{
"attributes": {
"NORMAL": "accessor_500",
"POSITION": "accessor_498"
},
"indices": "accessor_496",
"material": "Material-fx_1",
"mode": 4
}
]
},
"body-mesh_25": {
"name": "body_25",
"primitives": [
{
"attributes": {
"NORMAL": "accessor_520",
"POSITION": "accessor_518"
},
"indices": "accessor_516",
"material": "Material-fx_2",
"mode": 4
}
]
},
"body-mesh_26": {
"name": "body_26",
"primitives": [
{
"attributes": {
"NORMAL": "accessor_540",
"POSITION": "accessor_538"
},
"indices": "accessor_536",
"material": "Material-fx",
"mode": 4
}
]
},
"body-mesh_27": {
"name": "body_27",
"primitives": [
{
"attributes": {
"NORMAL": "accessor_560",
"POSITION": "accessor_558"
},
"indices": "accessor_556",
"material": "default-fx",
"mode": 4
}
]
},
"body-mesh_28": {
"name": "body_28",
"primitives": [
{
"attributes": {
"NORMAL": "accessor_580",
"POSITION": "accessor_578"
},
"indices": "accessor_576",
"material": "default-fx",
"mode": 4
}
]
},
"body-mesh_29": {
"name": "body_29",
"primitives": [
{
"attributes": {
"NORMAL": "accessor_600",
"POSITION": "accessor_598"
},
"indices": "accessor_596",
"material": "Material-fx",
"mode": 4
}
]
},
"body-mesh_3": {
"name": "body_3",
"primitives": [
{
"attributes": {
"NORMAL": "accessor_80",
"POSITION": "accessor_78"
},
"indices": "accessor_76",
"material": "default-fx",
"mode": 4
}
]
},
"body-mesh_30": {
"name": "body_30",
"primitives": [
{
"attributes": {
"NORMAL": "accessor_620",
"POSITION": "accessor_618"
},
"indices": "accessor_616",
"material": "default-fx",
"mode": 4
}
]
},
"body-mesh_31": {
"name": "body_31",
"primitives": [
{
"attributes": {
"NORMAL": "accessor_640",
"POSITION": "accessor_638"
},
"indices": "accessor_636",
"material": "Material-fx",
"mode": 4
}
]
},
"body-mesh_4": {
"name": "body_4",
"primitives": [
{
"attributes": {
"NORMAL": "accessor_100",
"POSITION": "accessor_98"
},
"indices": "accessor_96",
"material": "default-fx",
"mode": 4
}
]
},
"body-mesh_5": {
"name": "body_5",
"primitives": [
{
"attributes": {
"NORMAL": "accessor_120",
"POSITION": "accessor_118"
},
"indices": "accessor_116",
"material": "default-fx",
"mode": 4
}
]
},
"body-mesh_6": {
"name": "body_6",
"primitives": [
{
"attributes": {
"NORMAL": "accessor_140",
"POSITION": "accessor_138"
},
"indices": "accessor_136",
"material": "default-fx",
"mode": 4
}
]
},
"body-mesh_7": {
"name": "body_7",
"primitives": [
{
"attributes": {
"NORMAL": "accessor_160",
"POSITION": "accessor_158"
},
"indices": "accessor_156",
"material": "default-fx",
"mode": 4
}
]
},
"body-mesh_8": {
"name": "body_8",
"primitives": [
{
"attributes": {
"NORMAL": "accessor_180",
"POSITION": "accessor_178"
},
"indices": "accessor_176",
"material": "Material-fx_4",
"mode": 4
}
]
},
"body-mesh_9": {
"name": "body_9",
"primitives": [
{
"attributes": {
"NORMAL": "accessor_200",
"POSITION": "accessor_198"
},
"indices": "accessor_196",
"material": "Material-fx_3",
"mode": 4
}
]
}
},
"nodes": {
"Sunlight__Front-Upper-Left-node": {
"children": [],
"matrix": [
0.816496,
0.408248,
0.408248,
0,
5.09173e-010,
0.707107,
-0.707107,
0,
-0.57735,
0.57735,
0.57735,
0,
-1,
1,
1,
1
],
"name": "Sunlight__Front-Upper-Left"
},
"Sunlight__Front-Upper-Right-node": {
"children": [],
"matrix": [
0.816496,
-0.408248,
-0.408248,
0,
-5.09173e-010,
0.707107,
-0.707107,
0,
0.57735,
0.57735,
0.57735,
0,
1,
1,
1,
1
],
"name": "Sunlight__Front-Upper-Right"
},
"a_120-14_main-node": {
"children": [
"n131738_spring-node",
"n274015_washer-node",
"n275033_nut-node",
"base_lower_sub-node",
"base_upper_sub-node",
"clutch_upper_sub-node",
"shaft_sub-node"
],
"matrix": [
-0.5,
0.866025,
0,
0,
-0.866025,
-0.5,
0,
0,
0,
0,
1,
0,
-2.45003,
9.4025,
38.3914,
1
],
"name": "a_120-14_main"
},
"a_120-14_main-node_1": {
"children": [
"n131738_spring-node_1",
"n274015_washer-node_1",
"n275033_nut-node_1",
"base_lower_sub-node_1",
"base_upper_sub-node_1",
"clutch_upper_sub-node_1",
"shaft_sub-node_1"
],
"matrix": [
-0.5,
-0.866025,
0,
0,
0.866025,
-0.5,
0,
0,
0,
0,
1,
0,
8.44002,
9.4025,
38.3914,
1
],
"name": "a_120-14_main_1"
},
"a_19m8374_cap_screw-node": {
"children": [],
"matrix": [
-1,
0,
-8.97932e-011,
0,
0,
1,
0,
0,
8.97932e-011,
0,
-1,
0,
1.54239,
-0.890495,
1.247,
1
],
"meshes": [
"body-mesh_31"
],
"name": "a_19m8374_cap_screw"
},
"a_19m8374_cap_screw-node_1": {
"children": [],
"matrix": [
-1,
0,
-8.97932e-011,
0,
0,
1,
0,
0,
8.97932e-011,
0,
-1,
0,
0,
1.781,
1.247,
1
],
"meshes": [
"body-mesh_31"
],
"name": "a_19m8374_cap_screw_1"
},
"a_19m8374_cap_screw-node_2": {
"children": [],
"matrix": [
-1,
0,
-8.97932e-011,
0,
0,
1,
0,
0,
8.97932e-011,
0,
-1,
0,
-1.5424,
-0.890503,
1.247,
1
],
"meshes": [
"body-mesh_31"
],
"name": "a_19m8374_cap_screw_2"
},
"a_19m8374_cap_screw-node_3": {
"children": [],
"matrix": [
-1,
0,
-8.97932e-011,
0,
0,
1,
0,
0,
8.97932e-011,
0,
-1,
0,
1.54239,
-0.890503,
1.247,
1
],
"meshes": [
"body-mesh_31"
],
"name": "a_19m8374_cap_screw_3"
},
"a_19m8374_cap_screw-node_4": {
"children": [],
"matrix": [
-1,
0,
-8.97932e-011,
0,
0,
1,
0,
0,
8.97932e-011,
0,
-1,
0,
-1.5e-005,
1.781,
1.247,
1
],
"meshes": [
"body-mesh_31"
],
"name": "a_19m8374_cap_screw_4"
},
"a_19m8374_cap_screw-node_5": {
"children": [],
"matrix": [
-1,
0,
-8.97932e-011,
0,
0,
1,
0,
0,
8.97932e-011,
0,
-1,
0,
-1.5424,
-0.890499,
1.247,
1
],
"meshes": [
"body-mesh_31"
],
"name": "a_19m8374_cap_screw_5"
},
"a_19m8375_cap_screw-node": {
"children": [],
"matrix": [
-1,
0,
-8.97932e-011,
0,
0,
1,
0,
0,
8.97932e-011,
0,
-1,
0,
0.890488,
1.54239,
0.672,
1
],
"meshes": [
"body-mesh_20"
],
"name": "a_19m8375_cap_screw"
},
"a_19m8375_cap_screw-node_1": {
"children": [],
"matrix": [
-1,
0,
-8.97932e-011,
0,
0,
1,
0,
0,
8.97932e-011,
0,
-1,
0,
0.890503,
-1.54239,
0.672,
1
],
"meshes": [
"body-mesh_20"
],
"name": "a_19m8375_cap_screw_1"
},
"a_19m8375_cap_screw-node_2": {
"children": [],
"matrix": [
-1,
0,
-8.97932e-011,
0,
0,
1,
0,
0,
8.97932e-011,
0,
-1,
0,
-1.78101,
0,
0.672,
1
],
"meshes": [
"body-mesh_20"
],
"name": "a_19m8375_cap_screw_2"
},
"a_19m8375_cap_screw-node_3": {
"children": [],
"matrix": [
-1,
0,
-8.97932e-011,
0,
0,
1,
0,
0,
8.97932e-011,
0,
-1,
0,
0.890503,
1.54239,
0.672,
1
],
"meshes": [
"body-mesh_20"
],
"name": "a_19m8375_cap_screw_3"
},
"a_19m8375_cap_screw-node_4": {
"children": [],
"matrix": [
-1,
0,
-8.97932e-011,
0,
0,
1,
0,
0,
8.97932e-011,
0,
-1,
0,
0.890488,
-1.54239,
0.672,
1
],
"meshes": [
"body-mesh_20"
],
"name": "a_19m8375_cap_screw_4"
},
"a_19m8375_cap_screw-node_5": {
"children": [],
"matrix": [
-1,
0,
-8.97932e-011,
0,
0,
1,
0,
0,
8.97932e-011,
0,
-1,
0,
-1.78101,
0,
0.672,
1
],
"meshes": [
"body-mesh_20"
],
"name": "a_19m8375_cap_screw_5"
},
"base_lower_sub-node": {
"children": [
"jd9467_ball_bearing-node",
"n274011_housing-node"
],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1
],
"name": "base_lower_sub"
},
"base_lower_sub-node_1": {
"children": [
"jd9467_ball_bearing-node_1",
"n274011_housing-node_1"
],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1
],
"name": "base_lower_sub_1"
},
"base_upper_sub-node": {
"children": [
"jd9321_ball_bearing-node",
"n274010_housing-node"
],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
0,
4.926,
1
],
"name": "base_upper_sub"
},
"base_upper_sub-node_1": {
"children": [
"jd9321_ball_bearing-node_1",
"n274010_housing-node_1"
],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
0,
4.926,
1
],
"name": "base_upper_sub_1"
},
"box_bevel_gear_horz-node": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
4.48966e-011,
1,
0,
0,
-1,
4.48966e-011,
0,
0,
6.256,
0,
1
],
"meshes": [
"body-mesh_16"
],
"name": "box_bevel_gear_horz"
},
"box_bevel_gear_horz-node_1": {
"children": [],
"matrix": [
3.45615e-011,
-1,
3.45614e-011,
0,
3.45614e-011,
3.45615e-011,
1,
0,
-1,
-3.45614e-011,
3.45615e-011,
0,
2.1,
0,
0,
1
],
"meshes": [
"body-mesh_16"
],
"name": "box_bevel_gear_horz_1"
},
"ce17354_shaft-node": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
-3.05,
0,
1
],
"meshes": [
"body-mesh_12"
],
"name": "ce17354_shaft"
},
"clutch_upper_sub-node": {
"children": [
"n190954_slip_clutch_ring-node",
"n275269_bushing-node"
],
"matrix": [
0.866025,
0.5,
0,
0,
-0.5,
0.866025,
0,
0,
0,
0,
1,
0,
0,
0,
2.666,
1
],
"name": "clutch_upper_sub"
},
"clutch_upper_sub-node_1": {
"children": [
"n190954_slip_clutch_ring-node_2",
"n275269_bushing-node_1"
],
"matrix": [
0.866025,
0.5,
0,
0,
-0.5,
0.866025,
0,
0,
0,
0,
1,
0,
0,
0,
2.666,
1
],
"name": "clutch_upper_sub_1"
},
"default-node": {
"camera": "default-camera",
"children": [],
"matrix": [
0.707107,
-2.0175e-007,
-0.707107,
0,
-0.331294,
0.883452,
-0.331295,
0,
0.624695,
0.468521,
0.624695,
0,
207.615,
53.3281,
51.6212,
1
],
"name": "default_3"
},
"defaultambient-node": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1
],
"name": "defaultambient"
},
"e63526_nut-node": {
"children": [],
"matrix": [
-1,
0,
-8.97932e-011,
0,
0,
1,
0,
0,
8.97932e-011,
0,
-1,
0,
0.890503,
-1.54239,
5.429,
1
],
"meshes": [
"body-mesh_21"
],
"name": "e63526_nut"
},
"e63526_nut-node_1": {
"children": [],
"matrix": [
-1,
0,
-8.97932e-011,
0,
0,
1,
0,
0,
8.97932e-011,
0,
-1,
0,
-1.78101,
0,
5.429,
1
],
"meshes": [
"body-mesh_21"
],
"name": "e63526_nut_1"
},
"e63526_nut-node_10": {
"children": [],
"matrix": [
-1,
0,
-8.97932e-011,
0,
0,
1,
0,
0,
8.97932e-011,
0,
-1,
0,
-1.78101,
0,
5.429,
1
],
"meshes": [
"body-mesh_21"
],
"name": "e63526_nut_10"
},
"e63526_nut-node_11": {
"children": [],
"matrix": [
-1,
0,
-8.97932e-011,
0,
0,
1,
0,
0,
8.97932e-011,
0,
-1,
0,
0.890503,
1.54239,
5.429,
1
],
"meshes": [
"body-mesh_21"
],
"name": "e63526_nut_11"
},
"e63526_nut-node_12": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0.890503,
1.54239,
-0.571,
1
],
"meshes": [
"body-mesh_21"
],
"name": "e63526_nut_12"
},
"e63526_nut-node_13": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0.890488,
-1.54239,
-0.571,
1
],
"meshes": [
"body-mesh_21"
],
"name": "e63526_nut_13"
},
"e63526_nut-node_14": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
-1.78101,
0,
-0.571,
1
],
"meshes": [
"body-mesh_21"
],
"name": "e63526_nut_14"
},
"e63526_nut-node_15": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
1.54239,
-0.890503,
0.27,
1
],
"meshes": [
"body-mesh_21"
],
"name": "e63526_nut_15"
},
"e63526_nut-node_16": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
-1.5e-005,
1.781,
0.27,
1
],
"meshes": [
"body-mesh_21"
],
"name": "e63526_nut_16"
},
"e63526_nut-node_17": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
-1.5424,
-0.890499,
0.27,
1
],
"meshes": [
"body-mesh_21"
],
"name": "e63526_nut_17"
},
"e63526_nut-node_2": {
"children": [],
"matrix": [
-1,
0,
-8.97932e-011,
0,
0,
1,
0,
0,
8.97932e-011,
0,
-1,
0,
0.890488,
1.54239,
5.429,
1
],
"meshes": [
"body-mesh_21"
],
"name": "e63526_nut_2"
},
"e63526_nut-node_3": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0.890488,
1.54239,
-0.571,
1
],
"meshes": [
"body-mesh_21"
],
"name": "e63526_nut_3"
},
"e63526_nut-node_4": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0.890503,
-1.54239,
-0.571,
1
],
"meshes": [
"body-mesh_21"
],
"name": "e63526_nut_4"
},
"e63526_nut-node_5": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
-1.78101,
0,
-0.571,
1
],
"meshes": [
"body-mesh_21"
],
"name": "e63526_nut_5"
},
"e63526_nut-node_6": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
1.54239,
-0.890495,
0.27,
1
],
"meshes": [
"body-mesh_21"
],
"name": "e63526_nut_6"
},
"e63526_nut-node_7": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
1.781,
0.27,
1
],
"meshes": [
"body-mesh_21"
],
"name": "e63526_nut_7"
},
"e63526_nut-node_8": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
-1.5424,
-0.890503,
0.27,
1
],
"meshes": [
"body-mesh_21"
],
"name": "e63526_nut_8"
},
"e63526_nut-node_9": {
"children": [],
"matrix": [
-1,
0,
-8.97932e-011,
0,
0,
1,
0,
0,
8.97932e-011,
0,
-1,
0,
0.890488,
-1.54239,
5.429,
1
],
"meshes": [
"body-mesh_21"
],
"name": "e63526_nut_9"
},
"gear-1_sub-node": {
"children": [
"a_19m8374_cap_screw-node",
"a_19m8374_cap_screw-node_1",
"a_19m8374_cap_screw-node_2",
"e63526_nut-node_6",
"e63526_nut-node_7",
"e63526_nut-node_8",
"n273348_washer-node_1"
],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
0,
40.438,
1
],
"name": "gear-1_sub"
},
"gear-1_sub-node_1": {
"children": [
"a_19m8374_cap_screw-node_3",
"a_19m8374_cap_screw-node_4",
"a_19m8374_cap_screw-node_5",
"e63526_nut-node_15",
"e63526_nut-node_16",
"e63526_nut-node_17",
"n273348_washer-node_3"
],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
0,
40.438,
1
],
"name": "gear-1_sub_1"
},
"gear_clutch-node": {
"children": [
"box_bevel_gear_horz-node",
"n274314_slip_clutch-node_1",
"vert_shaft-node",
"horz_shaft-node"
],
"matrix": [
-2.22045e-016,
-6.34934e-011,
-1,
0,
6.34934e-011,
-1,
6.34934e-011,
0,
-1,
-6.34934e-011,
-2.22045e-016,
0,
0,
-3.3,
0,
1
],
"name": "gear_clutch"
},
"horz_shaft-node": {
"children": [
"box_bevel_gear_horz-node_1",
"upper_shaft-node"
],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
-3.8,
8.006,
0,
1
],
"name": "horz_shaft"
},
"jd9321_ball_bearing-node": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
0,
0.9,
1
],
"meshes": [
"body-mesh_5"
],
"name": "jd9321_ball_bearing"
},
"jd9321_ball_bearing-node_1": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
0,
0.9,
1
],
"meshes": [
"body-mesh_5"
],
"name": "jd9321_ball_bearing_1"
},
"jd9323_ball_bearing-node": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
0,
-0.311,
1
],
"meshes": [
"body-mesh_22"
],
"name": "jd9323_ball_bearing"
},
"jd9323_ball_bearing-node_1": {
"children": [],
"matrix": [
-1,
0,
-8.97932e-011,
0,
0,
1,
0,
0,
8.97932e-011,
0,
-1,
0,
0,
0,
5.3,
1
],
"meshes": [
"body-mesh_22"
],
"name": "jd9323_ball_bearing_1"
},
"jd9323_ball_bearing-node_2": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
0,
-0.311,
1
],
"meshes": [
"body-mesh_22"
],
"name": "jd9323_ball_bearing_2"
},
"jd9323_ball_bearing-node_3": {
"children": [],
"matrix": [
-1,
0,
-8.97932e-011,
0,
0,
1,
0,
0,
8.97932e-011,
0,
-1,
0,
0,
0,
5.3,
1
],
"meshes": [
"body-mesh_22"
],
"name": "jd9323_ball_bearing_3"
},
"jd9467_ball_bearing-node": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1
],
"meshes": [
"body-mesh_3"
],
"name": "jd9467_ball_bearing"
},
"jd9467_ball_bearing-node_1": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1
],
"meshes": [
"body-mesh_3"
],
"name": "jd9467_ball_bearing_1"
},
"lower_gear_case_hub-node": {
"children": [
"ce17354_shaft-node",
"n196960_compression_spring-node",
"n272730_hub-node",
"n274314_slip_clutch-node",
"gear_clutch-node"
],
"matrix": [
1,
0,
0,
0,
0,
4.48966e-011,
-1,
0,
0,
1,
4.48966e-011,
0,
2.99499,
6.50705,
37.1674,
1
],
"name": "lower_gear_case_hub"
},
"lower_gears_sub-node": {
"children": [
"a_19m8375_cap_screw-node",
"a_19m8375_cap_screw-node_1",
"a_19m8375_cap_screw-node_2",
"e63526_nut-node",
"e63526_nut-node_1",
"e63526_nut-node_2",
"e63526_nut-node_3",
"e63526_nut-node_4",
"e63526_nut-node_5",
"jd9323_ball_bearing-node",
"jd9323_ball_bearing-node_1",
"n273340_washer-node",
"n273340_washer-node_1",
"n273348_washer-node",
"n274157_spur_gear-node",
"n274233_spacer-node",
"n274242_hub-node",
"n275080_washer-node",
"n275650_cap_screw-node",
"n275650_cap_screw-node_1",
"n275650_cap_screw-node_2"
],
"matrix": [
-1,
6.34934e-011,
-6.34934e-011,
0,
-6.34934e-011,
-2.22045e-016,
1,
0,
6.34934e-011,
1,
-2.22045e-016,
0,
0,
-8.109,
0,
1
],
"name": "lower_gears_sub"
},
"lower_gears_sub-node_1": {
"children": [
"a_19m8375_cap_screw-node_3",
"a_19m8375_cap_screw-node_4",
"a_19m8375_cap_screw-node_5",
"e63526_nut-node_9",
"e63526_nut-node_10",
"e63526_nut-node_11",
"e63526_nut-node_12",
"e63526_nut-node_13",
"e63526_nut-node_14",
"jd9323_ball_bearing-node_2",
"jd9323_ball_bearing-node_3",
"n273340_washer-node_2",
"n273340_washer-node_3",
"n273348_washer-node_2",
"n274157_spur_gear-node_1",
"n274233_spacer-node_1",
"n274242_hub-node_1",
"n275080_washer-node_1",
"n275650_cap_screw-node_3",
"n275650_cap_screw-node_4",
"n275650_cap_screw-node_5"
],
"matrix": [
-1,
6.34934e-011,
-6.34934e-011,
0,
-6.34934e-011,
-2.22045e-016,
1,
0,
6.34934e-011,
1,
-2.22045e-016,
0,
0,
-8.109,
0,
1
],
"name": "lower_gears_sub_1"
},
"n131738_spring-node": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
0,
3.916,
1
],
"meshes": [
"body-mesh"
],
"name": "n131738_spring"
},
"n131738_spring-node_1": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
0,
3.916,
1
],
"meshes": [
"body-mesh"
],
"name": "n131738_spring_1"
},
"n190954_slip_clutch_ring-node": {
"children": [],
"matrix": [
-1,
6.34934e-011,
-6.34934e-011,
0,
-6.34934e-011,
-2.22045e-016,
1,
0,
6.34934e-011,
1,
-2.22045e-016,
0,
0,
0,
-0.28,
1
],
"meshes": [
"body-mesh_7"
],
"name": "n190954_slip_clutch_ring"
},
"n190954_slip_clutch_ring-node_1": {
"children": [],
"matrix": [
0.5,
-0.866026,
-1.16427e-007,
0,
1.16427e-007,
2.01658e-007,
-1,
0,
0.866026,
0.5,
2.01658e-007,
0,
0,
0,
1.72,
1
],
"meshes": [
"body-mesh_7"
],
"name": "n190954_slip_clutch_ring_1"
},
"n190954_slip_clutch_ring-node_2": {
"children": [],
"matrix": [
-1,
6.34934e-011,
-6.34934e-011,
0,
-6.34934e-011,
-2.22045e-016,
1,
0,
6.34934e-011,
1,
-2.22045e-016,
0,
0,
0,
-0.28,
1
],
"meshes": [
"body-mesh_7"
],
"name": "n190954_slip_clutch_ring_2"
},
"n190954_slip_clutch_ring-node_3": {
"children": [],
"matrix": [
0.5,
-0.866026,
-1.16427e-007,
0,
1.16427e-007,
2.01658e-007,
-1,
0,
0.866026,
0.5,
2.01658e-007,
0,
0,
0,
1.72,
1
],
"meshes": [
"body-mesh_7"
],
"name": "n190954_slip_clutch_ring_3"
},
"n196960_compression_spring-node": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
4.48966e-011,
1,
0,
0,
-1,
4.48966e-011,
0,
0,
0,
0,
1
],
"meshes": [
"body-mesh_13"
],
"name": "n196960_compression_spring"
},
"n272730_hub-node": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1
],
"meshes": [
"body-mesh_14"
],
"name": "n272730_hub"
},
"n273303_shaft-node": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
0,
30.49,
1
],
"meshes": [
"body-mesh_30"
],
"name": "n273303_shaft"
},
"n273303_shaft-node_1": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
0,
30.49,
1
],
"meshes": [
"body-mesh_30"
],
"name": "n273303_shaft_1"
},
"n273340_washer-node": {
"children": [],
"matrix": [
-1,
0,
-8.97932e-011,
0,
0,
1,
0,
0,
8.97932e-011,
0,
-1,
0,
0,
0,
5.63,
1
],
"meshes": [
"body-mesh_23"
],
"name": "n273340_washer"
},
"n273340_washer-node_1": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
0,
-0.641,
1
],
"meshes": [
"body-mesh_23"
],
"name": "n273340_washer_1"
},
"n273340_washer-node_2": {
"children": [],
"matrix": [
-1,
0,
-8.97932e-011,
0,
0,
1,
0,
0,
8.97932e-011,
0,
-1,
0,
0,
0,
5.63,
1
],
"meshes": [
"body-mesh_23"
],
"name": "n273340_washer_2"
},
"n273340_washer-node_3": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
0,
-0.641,
1
],
"meshes": [
"body-mesh_23"
],
"name": "n273340_washer_3"
},
"n273348_washer-node": {
"children": [],
"matrix": [
-0.866025,
0.5,
-8.67336e-011,
0,
0.5,
0.866025,
2.32402e-011,
0,
8.67336e-011,
-2.32402e-011,
-1,
0,
0,
0,
-0.11,
1
],
"meshes": [
"body-mesh_24"
],
"name": "n273348_washer"
},
"n273348_washer-node_1": {
"children": [],
"matrix": [
-0.5,
-0.866025,
0,
0,
0.866025,
-0.5,
0,
0,
0,
0,
1,
0,
0,
0,
1.091,
1
],
"meshes": [
"body-mesh_24"
],
"name": "n273348_washer_1"
},
"n273348_washer-node_2": {
"children": [],
"matrix": [
-0.866025,
0.5,
-8.67336e-011,
0,
0.5,
0.866025,
2.32402e-011,
0,
8.67336e-011,
-2.32402e-011,
-1,
0,
0,
0,
-0.11,
1
],
"meshes": [
"body-mesh_24"
],
"name": "n273348_washer_2"
},
"n273348_washer-node_3": {
"children": [],
"matrix": [
-0.5,
-0.866025,
0,
0,
0.866025,
-0.5,
0,
0,
0,
0,
1,
0,
0,
0,
1.091,
1
],
"meshes": [
"body-mesh_24"
],
"name": "n273348_washer_3"
},
"n273690_cover-node": {
"children": [],
"matrix": [
-1,
6.34934e-011,
-6.34934e-011,
0,
-6.34934e-011,
-2.22045e-016,
1,
0,
6.34934e-011,
1,
-2.22045e-016,
0,
0,
0.805,
0,
1
],
"meshes": [
"body-mesh_19"
],
"name": "n273690_cover"
},
"n273690_cover-node_1": {
"children": [],
"matrix": [
-1,
6.34934e-011,
-6.34934e-011,
0,
-6.34934e-011,
-2.22045e-016,
1,
0,
6.34934e-011,
1,
-2.22045e-016,
0,
0,
0.805,
0,
1
],
"meshes": [
"body-mesh_19"
],
"name": "n273690_cover_1"
},
"n274010_housing-node": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1
],
"meshes": [
"body-mesh_6"
],
"name": "n274010_housing"
},
"n274010_housing-node_1": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1
],
"meshes": [
"body-mesh_6"
],
"name": "n274010_housing_1"
},
"n274011_housing-node": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1
],
"meshes": [
"body-mesh_4"
],
"name": "n274011_housing"
},
"n274011_housing-node_1": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1
],
"meshes": [
"body-mesh_4"
],
"name": "n274011_housing_1"
},
"n274013_sleeve-node": {
"children": [],
"matrix": [
-1,
8.97932e-011,
0,
0,
-8.97932e-011,
-1,
0,
0,
0,
0,
1,
0,
0,
0,
5.185,
1
],
"meshes": [
"body-mesh_9"
],
"name": "n274013_sleeve"
},
"n274013_sleeve-node_1": {
"children": [],
"matrix": [
-1,
8.97932e-011,
0,
0,
-8.97932e-011,
-1,
0,
0,
0,
0,
1,
0,
0,
0,
5.185,
1
],
"meshes": [
"body-mesh_9"
],
"name": "n274013_sleeve_1"
},
"n274015_washer-node": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
4.48966e-011,
-1,
0,
0,
1,
4.48966e-011,
0,
0,
0,
5.606,
1
],
"meshes": [
"body-mesh_1"
],
"name": "n274015_washer"
},
"n274015_washer-node_1": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
4.48966e-011,
-1,
0,
0,
1,
4.48966e-011,
0,
0,
0,
5.606,
1
],
"meshes": [
"body-mesh_1"
],
"name": "n274015_washer_1"
},
"n274017_gear_53t-node": {
"children": [],
"matrix": [
0.5,
-0.866025,
0,
0,
0.866025,
0.5,
0,
0,
0,
0,
1,
0,
0,
0,
1.53,
1
],
"meshes": [
"body-mesh_10"
],
"name": "n274017_gear_53t"
},
"n274017_gear_53t-node_1": {
"children": [],
"matrix": [
0.5,
-0.866025,
0,
0,
0.866025,
0.5,
0,
0,
0,
0,
1,
0,
0,
0,
1.53,
1
],
"meshes": [
"body-mesh_10"
],
"name": "n274017_gear_53t_1"
},
"n274157_spur_gear-node": {
"children": [],
"matrix": [
0.5,
0.866025,
0,
0,
-0.866025,
0.5,
0,
0,
0,
0,
1,
0,
0,
0,
5.21,
1
],
"meshes": [
"body-mesh_25"
],
"name": "n274157_spur_gear"
},
"n274157_spur_gear-node_1": {
"children": [],
"matrix": [
0.5,
0.866025,
0,
0,
-0.866025,
0.5,
0,
0,
0,
0,
1,
0,
0,
0,
5.21,
1
],
"meshes": [
"body-mesh_25"
],
"name": "n274157_spur_gear_1"
},
"n274233_spacer-node": {
"children": [],
"matrix": [
4.48966e-011,
1,
0,
0,
-1,
4.48966e-011,
0,
0,
0,
0,
1,
0,
0,
0,
4.681,
1
],
"meshes": [
"body-mesh_26"
],
"name": "n274233_spacer"
},
"n274233_spacer-node_1": {
"children": [],
"matrix": [
4.48966e-011,
1,
0,
0,
-1,
4.48966e-011,
0,
0,
0,
0,
1,
0,
0,
0,
4.681,
1
],
"meshes": [
"body-mesh_26"
],
"name": "n274233_spacer_1"
},
"n274242_hub-node": {
"children": [],
"matrix": [
-1,
0,
-8.97932e-011,
0,
0,
1,
0,
0,
8.97932e-011,
0,
-1,
0,
0,
0,
2.4945,
1
],
"meshes": [
"body-mesh_27"
],
"name": "n274242_hub"
},
"n274242_hub-node_1": {
"children": [],
"matrix": [
-1,
0,
-8.97932e-011,
0,
0,
1,
0,
0,
8.97932e-011,
0,
-1,
0,
0,
0,
2.4945,
1
],
"meshes": [
"body-mesh_27"
],
"name": "n274242_hub_1"
},
"n274314_slip_clutch-node": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
-2.53,
0,
1
],
"meshes": [
"body-mesh_15"
],
"name": "n274314_slip_clutch"
},
"n274314_slip_clutch-node_1": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
-0.53,
0,
1
],
"meshes": [
"body-mesh_15"
],
"name": "n274314_slip_clutch_1"
},
"n275033_nut-node": {
"children": [],
"matrix": [
-1,
0,
-8.97932e-011,
0,
0,
1,
0,
0,
8.97932e-011,
0,
-1,
0,
0,
0,
6.831,
1
],
"meshes": [
"body-mesh_2"
],
"name": "n275033_nut"
},
"n275033_nut-node_1": {
"children": [],
"matrix": [
-1,
0,
-8.97932e-011,
0,
0,
1,
0,
0,
8.97932e-011,
0,
-1,
0,
0,
0,
6.831,
1
],
"meshes": [
"body-mesh_2"
],
"name": "n275033_nut_1"
},
"n275080_washer-node": {
"children": [],
"matrix": [
-0.866025,
0.5,
-8.67336e-011,
0,
0.5,
0.866025,
2.32402e-011,
0,
8.67336e-011,
-2.32402e-011,
-1,
0,
0,
0,
-0.311,
1
],
"meshes": [
"body-mesh_28"
],
"name": "n275080_washer"
},
"n275080_washer-node_1": {
"children": [],
"matrix": [
-0.866025,
0.5,
-8.67336e-011,
0,
0.5,
0.866025,
2.32402e-011,
0,
8.67336e-011,
-2.32402e-011,
-1,
0,
0,
0,
-0.311,
1
],
"meshes": [
"body-mesh_28"
],
"name": "n275080_washer_1"
},
"n275269_bushing-node": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1
],
"meshes": [
"body-mesh_8"
],
"name": "n275269_bushing"
},
"n275269_bushing-node_1": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1
],
"meshes": [
"body-mesh_8"
],
"name": "n275269_bushing_1"
},
"n275650_cap_screw-node": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0.890503,
-1.54239,
3.578,
1
],
"meshes": [
"body-mesh_29"
],
"name": "n275650_cap_screw"
},
"n275650_cap_screw-node_1": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
-1.78101,
0,
3.578,
1
],
"meshes": [
"body-mesh_29"
],
"name": "n275650_cap_screw_1"
},
"n275650_cap_screw-node_2": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0.890488,
1.54239,
3.578,
1
],
"meshes": [
"body-mesh_29"
],
"name": "n275650_cap_screw_2"
},
"n275650_cap_screw-node_3": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0.890488,
-1.54239,
3.578,
1
],
"meshes": [
"body-mesh_29"
],
"name": "n275650_cap_screw_3"
},
"n275650_cap_screw-node_4": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
-1.78101,
0,
3.578,
1
],
"meshes": [
"body-mesh_29"
],
"name": "n275650_cap_screw_4"
},
"n275650_cap_screw-node_5": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0.890503,
1.54239,
3.578,
1
],
"meshes": [
"body-mesh_29"
],
"name": "n275650_cap_screw_5"
},
"n276291_shaft-node": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
4.48966e-011,
-1,
0,
0,
1,
4.48966e-011,
0,
0,
0,
5.15,
1
],
"meshes": [
"body-mesh_11"
],
"name": "n276291_shaft"
},
"n276291_shaft-node_1": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
4.48966e-011,
-1,
0,
0,
1,
4.48966e-011,
0,
0,
0,
5.15,
1
],
"meshes": [
"body-mesh_11"
],
"name": "n276291_shaft_1"
},
"pro12-18s-node": {
"children": [
"a_120-14_main-node",
"a_120-14_main-node_1",
"lower_gear_case_hub-node",
"spindle_drum_complete_assy-node",
"spindle_drum_complete_assy-node_1"
],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
155.796,
8.45858,
-37.1096,
1
],
"name": "pro12-18s"
},
"shaft_sub-node": {
"children": [
"n190954_slip_clutch_ring-node_1",
"n274013_sleeve-node",
"n274017_gear_53t-node",
"n276291_shaft-node"
],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
0,
0.376,
1
],
"name": "shaft_sub"
},
"shaft_sub-node_1": {
"children": [
"n190954_slip_clutch_ring-node_3",
"n274013_sleeve-node_1",
"n274017_gear_53t-node_1",
"n276291_shaft-node_1"
],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
0,
0.376,
1
],
"name": "shaft_sub_1"
},
"spindle_drum_complete_assy-node": {
"children": [
"n273690_cover-node",
"lower_gears_sub-node",
"spindle_drum_gear_assy-node"
],
"matrix": [
0.866025,
-0.5,
2.94035e-008,
0,
2.94035e-008,
1.09735e-007,
1,
0,
-0.5,
-0.866025,
1.09735e-007,
0,
14.775,
5.745,
43.3174,
1
],
"name": "spindle_drum_complete_assy"
},
"spindle_drum_complete_assy-node_1": {
"children": [
"n273690_cover-node_1",
"lower_gears_sub-node_1",
"spindle_drum_gear_assy-node_1"
],
"matrix": [
-0.866025,
-0.5,
-2.07521e-007,
0,
-2.07521e-007,
-5.56051e-008,
1,
0,
-0.5,
0.866025,
-5.56051e-008,
0,
-8.785,
5.745,
43.3174,
1
],
"name": "spindle_drum_complete_assy_1"
},
"spindle_drum_gear_assy-node": {
"children": [
"n273303_shaft-node",
"gear-1_sub-node"
],
"matrix": [
-1,
6.34934e-011,
-6.34934e-011,
0,
-6.34934e-011,
-2.22045e-016,
1,
0,
6.34934e-011,
1,
-2.22045e-016,
0,
0,
-43.14,
0,
1
],
"name": "spindle_drum_gear_assy"
},
"spindle_drum_gear_assy-node_1": {
"children": [
"n273303_shaft-node_1",
"gear-1_sub-node_1"
],
"matrix": [
-1,
6.34934e-011,
-6.34934e-011,
0,
-6.34934e-011,
-2.22045e-016,
1,
0,
6.34934e-011,
1,
-2.22045e-016,
0,
0,
-43.14,
0,
1
],
"name": "spindle_drum_gear_assy_1"
},
"upper_shaft-node": {
"children": [],
"matrix": [
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1,
0,
0,
0,
0,
1
],
"meshes": [
"body-mesh_18"
],
"name": "upper_shaft"
},
"vert_shaft-node": {
"children": [],
"matrix": [
4.48966e-011,
1,
0,
0,
-1,
4.48966e-011,
0,
0,
0,
0,
1,
0,
0,
0.25,
0,
1
],
"meshes": [
"body-mesh_17"
],
"name": "vert_shaft"
}
},
"programs": {
"program_0": {
"attributes": [
"a_normal",
"a_position"
],
"fragmentShader": "GearboxAssy0FS",
"vertexShader": "GearboxAssy0VS"
}
},
"scene": "defaultScene",
"scenes": {
"defaultScene": {
"nodes": [
"default-node",
"Sunlight__Front-Upper-Left-node",
"Sunlight__Front-Upper-Right-node",
"defaultambient-node",
"pro12-18s-node"
]
}
},
"shaders": {
"GearboxAssy0FS": {
"type": 35632,
"uri": "GearboxAssy0FS.glsl"
},
"GearboxAssy0VS": {
"type": 35633,
"uri": "GearboxAssy0VS.glsl"
}
},
"skins": {},
"techniques": {
"technique0": {
"attributes": {
"a_normal": "normal",
"a_position": "position"
},
"parameters": {
"ambient": {
"type": 35666
},
"diffuse": {
"type": 35666
},
"emission": {
"type": 35666
},
"light0Color": {
"type": 35665,
"value": [
1,
1,
1
]
},
"light0Transform": {
"node": "Sunlight__Front-Upper-Left-node",
"semantic": "MODELVIEW",
"type": 35676
},
"light1Color": {
"type": 35665,
"value": [
1,
1,
1
]
},
"light1Transform": {
"node": "Sunlight__Front-Upper-Right-node",
"semantic": "MODELVIEW",
"type": 35676
},
"light2Color": {
"type": 35665,
"value": [
1,
1,
1
]
},
"modelViewMatrix": {
"semantic": "MODELVIEW",
"type": 35676
},
"normal": {
"semantic": "NORMAL",
"type": 35665
},
"normalMatrix": {
"semantic": "MODELVIEWINVERSETRANSPOSE",
"type": 35675
},
"position": {
"semantic": "POSITION",
"type": 35665
},
"projectionMatrix": {
"semantic": "PROJECTION",
"type": 35676
},
"shininess": {
"type": 5126
},
"specular": {
"type": 35666
}
},
"program": "program_0",
"states": {
"enable": [
2929,
2884
]
},
"uniforms": {
"u_ambient": "ambient",
"u_diffuse": "diffuse",
"u_emission": "emission",
"u_light0Color": "light0Color",
"u_light0Transform": "light0Transform",
"u_light1Color": "light1Color",
"u_light1Transform": "light1Transform",
"u_light2Color": "light2Color",
"u_modelViewMatrix": "modelViewMatrix",
"u_normalMatrix": "normalMatrix",
"u_projectionMatrix": "projectionMatrix",
"u_shininess": "shininess",
"u_specular": "specular"
}
}
}
}
+ + + +
+ +
+ + + + +
+ +
+ +
+
+ +
+ + + + + + +
+ + + You can't perform that action at this time. +
+ + + + + + + + + + +
+ + You signed in with another tab or window. Reload to refresh your session. + You signed out in another tab or window. Reload to refresh your session. +
+ + + + + + diff --git a/gltfs/GearboxAssy/GearboxAssy0FS.glsl b/gltfs/GearboxAssy/GearboxAssy0FS.glsl new file mode 100644 index 0000000..f606a29 --- /dev/null +++ b/gltfs/GearboxAssy/GearboxAssy0FS.glsl @@ -0,0 +1,999 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + glTF-Sample-Models/GearboxAssy0FS.glsl at master · KhronosGroup/glTF-Sample-Models + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Skip to content +
+ + + + + + + + + + + + + +
+ +
+ +
+
+ + + +
+
+
+ + + + + + + + +
+
+ +
    +
  • +
    + +
    + + + +
    +
    +
    + + Notifications +
    + + + +
    +
    +
    +
    +
  • + +
  • + +
    +
    + + + +
    +
    + + + +
    + +
  • + +
  • +
    + +
    + +
  • +
+ +

+ + /glTF-Sample-Models + +

+ +
+ + + + +
+ +
+
+ + + Permalink + + + +
+ +
+ + +
+ +
+
+ + Switch branches/tags +
+ +
+
+ +
+
+ +
+
+ + + +
+
+ + +
+ +
Nothing to show
+
+ +
+
+
+ +
+ + Find file + + +
+ +
+ + + +
+ Fetching contributors… +
+ +
+ + Cannot retrieve contributors at this time +
+
+ +
+
+
+ +
+ Raw + Blame + History +
+ + + + + +
+ +
+ +
+ +
+ 61 lines (60 sloc) + + 1.76 KB +
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
precision highp float;
varying vec3 v_normal;
uniform vec4 u_ambient;
uniform vec4 u_diffuse;
uniform vec4 u_emission;
uniform vec4 u_specular;
uniform float u_shininess;
varying vec3 v_light0Direction;
varying vec3 v_position;
uniform vec3 u_light0Color;
varying vec3 v_light1Direction;
uniform vec3 u_light1Color;
uniform vec3 u_light2Color;
void main(void) {
vec3 normal = normalize(v_normal);
vec4 color = vec4(0., 0., 0., 0.);
vec4 diffuse = vec4(0., 0., 0., 1.);
vec3 diffuseLight = vec3(0., 0., 0.);
vec4 emission;
vec4 ambient;
vec4 specular;
ambient = u_ambient;
diffuse = u_diffuse;
emission = u_emission;
specular = u_specular;
vec3 specularLight = vec3(0., 0., 0.);
{
float specularIntensity = 0.;
float attenuation = 1.0;
vec3 l = normalize(v_light0Direction);
vec3 viewDir = -normalize(v_position);
float phongTerm = max(0.0, dot(reflect(-l,normal), viewDir));
specularIntensity = max(0., pow(phongTerm , u_shininess)) * attenuation;
specularLight += u_light0Color * specularIntensity;
diffuseLight += u_light0Color * max(dot(normal,l), 0.) * attenuation;
}
{
float specularIntensity = 0.;
float attenuation = 1.0;
vec3 l = normalize(v_light1Direction);
vec3 viewDir = -normalize(v_position);
float phongTerm = max(0.0, dot(reflect(-l,normal), viewDir));
specularIntensity = max(0., pow(phongTerm , u_shininess)) * attenuation;
specularLight += u_light1Color * specularIntensity;
diffuseLight += u_light1Color * max(dot(normal,l), 0.) * attenuation;
}
vec3 ambientLight = vec3(0., 0., 0.);
{
ambientLight += u_light2Color;
}
ambient.xyz *= ambientLight;
color.xyz += ambient.xyz;
specular.xyz *= specularLight;
color.xyz += specular.xyz;
diffuse.xyz *= diffuseLight;
color.xyz += diffuse.xyz;
color.xyz += emission.xyz;
color = vec4(color.rgb * diffuse.a, diffuse.a);
gl_FragColor = color;
}
+ + + +
+ +
+ + + + +
+ +
+ +
+
+ +
+ + + + + + +
+ + + You can't perform that action at this time. +
+ + + + + + + + + + +
+ + You signed in with another tab or window. Reload to refresh your session. + You signed out in another tab or window. Reload to refresh your session. +
+ + + + + + diff --git a/gltfs/GearboxAssy/GearboxAssy0VS.glsl b/gltfs/GearboxAssy/GearboxAssy0VS.glsl new file mode 100644 index 0000000..c9d612d --- /dev/null +++ b/gltfs/GearboxAssy/GearboxAssy0VS.glsl @@ -0,0 +1,839 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + glTF-Sample-Models/GearboxAssy0VS.glsl at master · KhronosGroup/glTF-Sample-Models + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Skip to content +
+ + + + + + + + + + + + + +
+ +
+ +
+
+ + + +
+
+
+ + + + + + + + +
+
+ +
    +
  • +
    + +
    + + + +
    +
    +
    + + Notifications +
    + + + +
    +
    +
    +
    +
  • + +
  • + +
    +
    + + + +
    +
    + + + +
    + +
  • + +
  • +
    + +
    + +
  • +
+ +

+ + /glTF-Sample-Models + +

+ +
+ + + + +
+ +
+
+ + + Permalink + + + +
+ +
+ + +
+ +
+
+ + Switch branches/tags +
+ +
+
+ +
+
+ +
+
+ + + +
+
+ + +
+ +
Nothing to show
+
+ +
+
+
+ +
+ + Find file + + +
+ +
+ + + +
+ Fetching contributors… +
+ +
+ + Cannot retrieve contributors at this time +
+
+ +
+
+
+ +
+ Raw + Blame + History +
+ + + + + +
+ +
+ +
+ +
+ 21 lines (20 sloc) + + 642 Bytes +
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
precision highp float;
attribute vec3 a_position;
attribute vec3 a_normal;
varying vec3 v_normal;
uniform mat3 u_normalMatrix;
uniform mat4 u_modelViewMatrix;
uniform mat4 u_projectionMatrix;
varying vec3 v_light0Direction;
varying vec3 v_position;
uniform mat4 u_light0Transform;
varying vec3 v_light1Direction;
uniform mat4 u_light1Transform;
void main(void) {
vec4 pos = u_modelViewMatrix * vec4(a_position,1.0);
v_normal = u_normalMatrix * a_normal;
v_position = pos.xyz;
v_light0Direction = mat3(u_light0Transform) * vec3(0.,0.,1.);
v_light1Direction = mat3(u_light1Transform) * vec3(0.,0.,1.);
gl_Position = u_projectionMatrix * pos;
}
+ + + +
+ +
+ + + + +
+ +
+ +
+
+ +
+ + + + + + +
+ + + You can't perform that action at this time. +
+ + + + + + + + + + +
+ + You signed in with another tab or window. Reload to refresh your session. + You signed out in another tab or window. Reload to refresh your session. +
+ + + + + + diff --git a/results/05.JPG b/results/05.JPG new file mode 100644 index 0000000..8d36caa Binary files /dev/null and b/results/05.JPG differ diff --git a/results/CesiumMilkTruck.gif b/results/CesiumMilkTruck.gif new file mode 100644 index 0000000..8a198da Binary files /dev/null and b/results/CesiumMilkTruck.gif differ diff --git a/results/CesiumMilkTruck_cmp.gif b/results/CesiumMilkTruck_cmp.gif new file mode 100644 index 0000000..66cef08 Binary files /dev/null and b/results/CesiumMilkTruck_cmp.gif differ diff --git a/results/CesiumMilkTruck_k_buffer.gif b/results/CesiumMilkTruck_k_buffer.gif new file mode 100644 index 0000000..4ffc508 Binary files /dev/null and b/results/CesiumMilkTruck_k_buffer.gif differ diff --git a/results/CesiumMilkTruck_k_buffer_backface_notex.gif b/results/CesiumMilkTruck_k_buffer_backface_notex.gif new file mode 100644 index 0000000..af7ae2e Binary files /dev/null and b/results/CesiumMilkTruck_k_buffer_backface_notex.gif differ diff --git a/results/CesiumMilkTruck_k_buffer_backfaceculling.gif b/results/CesiumMilkTruck_k_buffer_backfaceculling.gif new file mode 100644 index 0000000..49428e4 Binary files /dev/null and b/results/CesiumMilkTruck_k_buffer_backfaceculling.gif differ diff --git a/results/CesiumMilkTruck_normal.gif b/results/CesiumMilkTruck_normal.gif new file mode 100644 index 0000000..95962cf Binary files /dev/null and b/results/CesiumMilkTruck_normal.gif differ diff --git a/results/checkerboard_no_pers.JPG b/results/checkerboard_no_pers.JPG new file mode 100644 index 0000000..0b76a32 Binary files /dev/null and b/results/checkerboard_no_pers.JPG differ diff --git a/results/checkerboard_with_pers.JPG b/results/checkerboard_with_pers.JPG new file mode 100644 index 0000000..0de6080 Binary files /dev/null and b/results/checkerboard_with_pers.JPG differ diff --git a/results/cow.gif b/results/cow.gif new file mode 100644 index 0000000..bc2b6b5 Binary files /dev/null and b/results/cow.gif differ diff --git a/results/duck.gif b/results/duck.gif new file mode 100644 index 0000000..55dbdc1 Binary files /dev/null and b/results/duck.gif differ diff --git a/results/engine_k_buffer.gif b/results/engine_k_buffer.gif new file mode 100644 index 0000000..5a02f15 Binary files /dev/null and b/results/engine_k_buffer.gif differ diff --git a/results/form.JPG b/results/form.JPG new file mode 100644 index 0000000..3c10838 Binary files /dev/null and b/results/form.JPG differ diff --git a/results/header.jpg b/results/header.jpg new file mode 100644 index 0000000..76682a5 Binary files /dev/null and b/results/header.jpg differ diff --git a/results/k_buffer.JPG b/results/k_buffer.JPG new file mode 100644 index 0000000..93c70c9 Binary files /dev/null and b/results/k_buffer.JPG differ diff --git a/results/k_buffer_backfaceculling.JPG b/results/k_buffer_backfaceculling.JPG new file mode 100644 index 0000000..0498b62 Binary files /dev/null and b/results/k_buffer_backfaceculling.JPG differ diff --git a/results/k_buffer_combined.gif b/results/k_buffer_combined.gif new file mode 100644 index 0000000..f23f02e Binary files /dev/null and b/results/k_buffer_combined.gif differ diff --git a/results/plot.JPG b/results/plot.JPG new file mode 100644 index 0000000..69f4920 Binary files /dev/null and b/results/plot.JPG differ diff --git a/results/plot2.JPG b/results/plot2.JPG new file mode 100644 index 0000000..a3569b0 Binary files /dev/null and b/results/plot2.JPG differ diff --git a/results/plot3.JPG b/results/plot3.JPG new file mode 100644 index 0000000..a31e1f7 Binary files /dev/null and b/results/plot3.JPG differ diff --git a/src/main.cpp b/src/main.cpp index 7986959..90570af 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -9,7 +9,7 @@ #include "main.hpp" - +#include #define STB_IMAGE_IMPLEMENTATION #define TINYGLTF_LOADER_IMPLEMENTATION #include @@ -17,6 +17,9 @@ //------------------------------- //-------------MAIN-------------- //------------------------------- +extern RenderMode curr_Mode; + +int init_time; int main(int argc, char **argv) { if (argc != 2) { @@ -57,6 +60,7 @@ int main(int argc, char **argv) { // Launch CUDA/GL if (init(scene)) { // GLFW main loop + init_time = GetTickCount(); mainLoop(); } @@ -97,23 +101,32 @@ void mainLoop() { //---------RUNTIME STUFF--------- //------------------------------- float scale = 1.0f; -float x_trans = 0.0f, y_trans = 0.0f, z_trans = -10.0f; -float x_angle = 0.0f, y_angle = 0.0f; +//duck scale = 1.0f, y = -1.0f, z = -3.5; truck z = -8.0 +//cow scale = 0.3, y = 0, z = -3.5 +float x_trans = 0.0f, y_trans = -1.0f, z_trans = -8.0f; +float x_angle = 0.3f, y_angle = 0.0f; +float Model_scale = 0.01f; void runCuda() { // Map OpenGL buffer object for writing from CUDA on a single GPU // No data is moved (Win & Linux). When mapped to CUDA, OpenGL should not use this buffer dptr = NULL; + int currentTime = GetTickCount() - init_time; + + y_angle = 0.001f * currentTime; + glm::mat4 P = glm::frustum(-scale * ((float)width) / ((float)height), scale * ((float)width / (float)height), -scale, scale, 1.0, 1000.0); glm::mat4 V = glm::mat4(1.0f); + glm::mat4 scaleMatrix = glm::scale(glm::mat4(1.0f), glm::vec3(Model_scale)); glm::mat4 M = glm::translate(glm::vec3(x_trans, y_trans, z_trans)) * glm::rotate(x_angle, glm::vec3(1.0f, 0.0f, 0.0f)) - * glm::rotate(y_angle, glm::vec3(0.0f, 1.0f, 0.0f)); + * glm::rotate(y_angle, glm::vec3(0.0f, 1.0f, 0.0f)) + * scaleMatrix; glm::mat3 MV_normal = glm::transpose(glm::inverse(glm::mat3(V) * glm::mat3(M))); glm::mat4 MV = V * M; @@ -328,6 +341,9 @@ void keyCallback(GLFWwindow *window, int key, int scancode, int action, int mods if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS) { glfwSetWindowShouldClose(window, GL_TRUE); } + if (key == GLFW_KEY_T && action == GLFW_PRESS) { + curr_Mode = RenderMode((int(curr_Mode) + 1) % 3); + } } //---------------------------- @@ -395,6 +411,6 @@ void mouseMotionCallback(GLFWwindow* window, double xpos, double ypos) void mouseWheelCallback(GLFWwindow* window, double xoffset, double yoffset) { - const double s = 1.0; // sensitivity + const double s = 0.35f; // sensitivity z_trans += (float)(s * yoffset); } diff --git a/src/main.hpp b/src/main.hpp index 4816fa1..f2ab7d5 100644 --- a/src/main.hpp +++ b/src/main.hpp @@ -101,4 +101,5 @@ std::string getFilePathExtension(const std::string &FileName); void mouseButtonCallback(GLFWwindow* window, int button, int action, int mods); void mouseMotionCallback(GLFWwindow* window, double xpos, double ypos); -void mouseWheelCallback(GLFWwindow* window, double xoffset, double yoffset); \ No newline at end of file +void mouseWheelCallback(GLFWwindow* window, double xoffset, double yoffset); + diff --git a/src/rasterize.cu b/src/rasterize.cu index 1262a09..a2ef08c 100644 --- a/src/rasterize.cu +++ b/src/rasterize.cu @@ -1,22 +1,41 @@ /** - * @file rasterize.cu - * @brief CUDA-accelerated rasterization pipeline. - * @authors Skeleton code: Yining Karl Li, Kai Ninomiya, Shuai Shao (Shrek) - * @date 2012-2016 - * @copyright University of Pennsylvania & STUDENT - */ +* @file rasterize.cu +* @brief CUDA-accelerated rasterization pipeline. +* @authors Skeleton code: Yining Karl Li, Kai Ninomiya, Shuai Shao (Shrek) +* @date 2012-2016 +* @copyright University of Pennsylvania & STUDENT +*/ #include #include #include #include #include +#include +#include #include #include #include "rasterizeTools.h" #include "rasterize.h" #include #include +#include + +#define Perspective_Correct_Toggle 1 +#define BackFaceCulling_Toggle 1 +#define K_Buffer_Toggle 1 +#define Bilinear_Color_Filter_Toggle 1 +#define Naive_Sort_Toggle 1 + +#define Alpha_Intensity 0.3f + +RenderMode curr_Mode = r_Triangle; + +//Tips: You can change the property of the model matrix in main.cpp + +// Timer +//int counter = 0; +//float time_ap = 0, time_r = 0, time_f = 0, time_s = 0; namespace { @@ -28,7 +47,7 @@ namespace { typedef unsigned char BufferByte; - enum PrimitiveType{ + enum PrimitiveType { Point = 1, Line = 2, Triangle = 3 @@ -41,12 +60,12 @@ namespace { // The attributes listed below might be useful, // but always feel free to modify on your own - glm::vec3 eyePos; // eye space position used for shading - glm::vec3 eyeNor; // eye space normal used for shading, cuz normal will go wrong after perspective transformation - // glm::vec3 col; - glm::vec2 texcoord0; - TextureData* dev_diffuseTex = NULL; - // int texWidth, texHeight; + glm::vec3 eyePos; // eye space position used for shading + glm::vec3 eyeNor; // eye space normal used for shading, cuz normal will go wrong after perspective transformation + // glm::vec3 col; + glm::vec2 texcoord0; + TextureData* dev_diffuseTex = NULL; + int texWidth, texHeight; // ... }; @@ -62,11 +81,14 @@ namespace { // The attributes listed below might be useful, // but always feel free to modify on your own - // glm::vec3 eyePos; // eye space position used for shading - // glm::vec3 eyeNor; - // VertexAttributeTexcoord texcoord0; - // TextureData* dev_diffuseTex; + glm::vec3 eyePos; // eye space position used for shading + glm::vec3 eyeNor; + VertexAttributeTexcoord texcoord0; + TextureData* dev_diffuseTex; // ... + int TexWidth, TexHeight; + + glm::vec4 K_buffer[4]; }; struct PrimitiveDevBufPointers { @@ -96,6 +118,9 @@ namespace { // TODO: add more attributes when needed }; + struct KBuffer4 { + float depths[4]; + }; } static std::map> mesh2PrimitivesMap; @@ -109,62 +134,145 @@ static Primitive *dev_primitives = NULL; static Fragment *dev_fragmentBuffer = NULL; static glm::vec3 *dev_framebuffer = NULL; +static int *dev_mutex = NULL; + static int * dev_depth = NULL; // you might need this buffer when doing depth test +static KBuffer4 *dev_k_buffer = NULL; /** - * Kernel that writes the image to the OpenGL PBO directly. - */ -__global__ +* Kernel that writes the image to the OpenGL PBO directly. +*/ +__global__ void sendImageToPBO(uchar4 *pbo, int w, int h, glm::vec3 *image) { - int x = (blockIdx.x * blockDim.x) + threadIdx.x; - int y = (blockIdx.y * blockDim.y) + threadIdx.y; - int index = x + (y * w); - - if (x < w && y < h) { - glm::vec3 color; - color.x = glm::clamp(image[index].x, 0.0f, 1.0f) * 255.0; - color.y = glm::clamp(image[index].y, 0.0f, 1.0f) * 255.0; - color.z = glm::clamp(image[index].z, 0.0f, 1.0f) * 255.0; - // Each thread writes one pixel location in the texture (textel) - pbo[index].w = 0; - pbo[index].x = color.x; - pbo[index].y = color.y; - pbo[index].z = color.z; - } + int x = (blockIdx.x * blockDim.x) + threadIdx.x; + int y = (blockIdx.y * blockDim.y) + threadIdx.y; + int index = x + (y * w); + + if (x < w && y < h) { + glm::vec3 color; + color.x = glm::clamp(image[index].x, 0.0f, 1.0f) * 255.0; + color.y = glm::clamp(image[index].y, 0.0f, 1.0f) * 255.0; + color.z = glm::clamp(image[index].z, 0.0f, 1.0f) * 255.0; + // Each thread writes one pixel location in the texture (textel) + pbo[index].w = 0.9; + pbo[index].x = color.x; + pbo[index].y = color.y; + pbo[index].z = color.z; + } +} + + +// From Wikipedia: https://en.wikipedia.org/wiki/Bilinear_filtering Part "Sample Code" +__device__ __host__ glm::vec3 getBilinearFilteredPixelColor(TextureData* tex, glm::vec2 uv, int texWidth, int texHeight) { + float u = uv.s * texWidth - 0.5f; + float v = uv.t * texHeight - 0.5f; + int x = glm::floor(u); + int y = glm::floor(v); + float u_ratio = u - x; + float v_ratio = v - y; + float u_opposite = 1 - u_ratio; + float v_opposite = 1 - v_ratio; + int i0 = 3 * (x + y * texWidth); + int i1 = 3 * ((x + 1) + y * texWidth); + int i2 = 3 * (x + (y + 1) * texWidth); + int i3 = 3 * ((x + 1) + (y + 1) * texWidth); + + float red = (tex[i0] * u_opposite + tex[i1] * u_ratio) * v_opposite + (tex[i2] * u_opposite + tex[i3] * u_ratio) * v_ratio; + float green = (tex[i0 + 1] * u_opposite + tex[i1 + 1] * u_ratio) * v_opposite + (tex[i2 + 1] * u_opposite + tex[i3 + 1] * u_ratio) * v_ratio; + float blue = (tex[i0 + 2] * u_opposite + tex[i1 + 2] * u_ratio) * v_opposite + (tex[i2 + 2] * u_opposite + tex[i3 + 2] * u_ratio) * v_ratio; + + return glm::vec3(red, green, blue) / 255.0f; } -/** + +/** * Writes fragment colors to the framebuffer */ + __global__ -void render(int w, int h, Fragment *fragmentBuffer, glm::vec3 *framebuffer) { - int x = (blockIdx.x * blockDim.x) + threadIdx.x; - int y = (blockIdx.y * blockDim.y) + threadIdx.y; - int index = x + (y * w); +void render(int w, int h, Fragment *fragmentBuffer, glm::vec3 *framebuffer, RenderMode renderMode) { + int x = (blockIdx.x * blockDim.x) + threadIdx.x; + int y = (blockIdx.y * blockDim.y) + threadIdx.y; + int index = x + (y * w); - if (x < w && y < h) { - framebuffer[index] = fragmentBuffer[index].color; + if (x < w && y < h) { + //framebuffer[index] = fragmentBuffer[index].color; + Fragment fgbuffer = fragmentBuffer[index]; // TODO: add your fragment shader code here + glm::vec3 normal = fgbuffer.eyeNor; + glm::vec3 lightDir = glm::normalize(glm::vec3(-3.0f, 5.0f, 5.0f) - fgbuffer.eyePos); - } + float lambertian = glm::clamp(glm::dot(normal, lightDir), 0.0f, 1.0f); + float specular = 0.0f; + + if (lambertian > 0.0f) { + glm::vec3 viewDir = glm::normalize(-fgbuffer.eyePos); + + //this is blinn phong + glm::vec3 halfDir = glm::normalize(lightDir + viewDir); + float specAngle = glm::clamp(glm::dot(halfDir, normal), 0.0f, 1.0f); + specular = glm::pow(specAngle, 16.0f); + } + glm::vec3 ambientColor = glm::vec3(0.0f, 0.0f, 0.0f); + glm::vec3 diffuseColor; + glm::vec3 specColor = glm::vec3(1.0, 1.0, 1.0); + + +#if K_Buffer_Toggle + float a = Alpha_Intensity; + /*diffuseColor = a * glm::vec3(fgbuffer.K_buffer[3]); + diffuseColor = a * glm::vec3(fgbuffer.K_buffer[2]) + (1 - a)* diffuseColor; + diffuseColor = a * glm::vec3(fgbuffer.K_buffer[1]) + (1 - a)* diffuseColor; + diffuseColor = a * glm::vec3(fgbuffer.K_buffer[0]) + (1 - a)* diffuseColor; +*/ + fgbuffer.K_buffer[3] = glm::vec4((a * glm::vec3(fgbuffer.K_buffer[3]), (1-a)*glm::vec3(0.0f,0.0f,0.0f)),fgbuffer.K_buffer[3].w); + for (int i = 3; i > 0; i--) { + if (fgbuffer.K_buffer[i].w == 1.0f) + fgbuffer.K_buffer[i] = glm::vec4(0.0f,0.0f,0.0f,1.0f); + fgbuffer.K_buffer[i-1] = glm::vec4((a * glm::vec3(fgbuffer.K_buffer[i-1]) + (1 - a)*glm::vec3(fgbuffer.K_buffer[i])), fgbuffer.K_buffer[i-1].w); + } + diffuseColor = glm::vec3(fgbuffer.K_buffer[0]); + specular = 0; + lambertian = 1.0f; +#else + if (fgbuffer.dev_diffuseTex != NULL) +#if Bilinear_Color_Filter_Toggle + diffuseColor = getBilinearFilteredPixelColor(fgbuffer.dev_diffuseTex, fgbuffer.texcoord0, fgbuffer.TexWidth, fgbuffer.TexHeight); +#else + diffuseColor = fgbuffer.color; +#endif + else + diffuseColor = fgbuffer.color; +#endif + glm::vec3 colorLinear = ambientColor + lambertian * diffuseColor + specular * specColor; + framebuffer[index] = colorLinear; + if(renderMode == r_Point || renderMode == r_Line) + framebuffer[index] = diffuseColor; + } } /** - * Called once at the beginning of the program to allocate memory. - */ +* Called once at the beginning of the program to allocate memory. +*/ void rasterizeInit(int w, int h) { - width = w; - height = h; + width = w; + height = h; cudaFree(dev_fragmentBuffer); cudaMalloc(&dev_fragmentBuffer, width * height * sizeof(Fragment)); cudaMemset(dev_fragmentBuffer, 0, width * height * sizeof(Fragment)); - cudaFree(dev_framebuffer); - cudaMalloc(&dev_framebuffer, width * height * sizeof(glm::vec3)); - cudaMemset(dev_framebuffer, 0, width * height * sizeof(glm::vec3)); - + cudaFree(dev_framebuffer); + cudaMalloc(&dev_framebuffer, width * height * sizeof(glm::vec3)); + cudaMemset(dev_framebuffer, 0, width * height * sizeof(glm::vec3)); + cudaFree(dev_depth); cudaMalloc(&dev_depth, width * height * sizeof(int)); +#if K_Buffer_Toggle + cudaFree(dev_k_buffer); + cudaMalloc((void**)&dev_k_buffer, width * height * sizeof(KBuffer4)); +#endif + cudaFree(dev_mutex); + cudaMalloc(&dev_mutex, width * height * sizeof(int)); checkCUDAError("rasterizeInit"); } @@ -182,14 +290,45 @@ void initDepth(int w, int h, int * depth) } } +__global__ +void initKBuffer4(int w, int h, KBuffer4 * k_buffer) +{ + int x = (blockIdx.x * blockDim.x) + threadIdx.x; + int y = (blockIdx.y * blockDim.y) + threadIdx.y; + + if (x < w && y < h) + { + int index = x + (y * w); + k_buffer[index].depths[0] = 1.0f; + k_buffer[index].depths[1] = 1.0f; + k_buffer[index].depths[2] = 1.0f; + k_buffer[index].depths[3] = 1.0f; + } +} + +__global__ +void initKBufferInFrag(int w, int h, Fragment * fragbuffer) +{ + int x = (blockIdx.x * blockDim.x) + threadIdx.x; + int y = (blockIdx.y * blockDim.y) + threadIdx.y; + + if (x < w && y < h) + { + int index = x + (y * w); + fragbuffer[index].K_buffer[0].w = 1.0f; + fragbuffer[index].K_buffer[1].w = 1.0f; + fragbuffer[index].K_buffer[2].w = 1.0f; + fragbuffer[index].K_buffer[3].w = 1.0f; + } +} /** * kern function with support for stride to sometimes replace cudaMemcpy * One thread is responsible for copying one component */ -__global__ +__global__ void _deviceBufferCopy(int N, BufferByte* dev_dst, const BufferByte* dev_src, int n, int byteStride, int byteOffset, int componentTypeByteSize) { - + // Attribute (vec3 position) // component (3 * float) // byte (4 * byte) @@ -202,20 +341,20 @@ void _deviceBufferCopy(int N, BufferByte* dev_dst, const BufferByte* dev_src, in int offset = i - count * n; // which component of the attribute for (int j = 0; j < componentTypeByteSize; j++) { - - dev_dst[count * componentTypeByteSize * n - + offset * componentTypeByteSize + + dev_dst[count * componentTypeByteSize * n + + offset * componentTypeByteSize + j] - = + = - dev_src[byteOffset - + count * (byteStride == 0 ? componentTypeByteSize * n : byteStride) - + offset * componentTypeByteSize + dev_src[byteOffset + + count * (byteStride == 0 ? componentTypeByteSize * n : byteStride) + + offset * componentTypeByteSize + j]; } } - + } @@ -235,7 +374,7 @@ void _nodeMatrixTransform( } glm::mat4 getMatrixFromNodeMatrixVector(const tinygltf::Node & n) { - + glm::mat4 curMatrix(1.0); const std::vector &m = n.matrix; @@ -247,7 +386,8 @@ glm::mat4 getMatrixFromNodeMatrixVector(const tinygltf::Node & n) { curMatrix[i][j] = (float)m.at(4 * i + j); } } - } else { + } + else { // no matrix, use rotation, scale, translation if (n.translation.size() > 0) { @@ -275,12 +415,12 @@ glm::mat4 getMatrixFromNodeMatrixVector(const tinygltf::Node & n) { return curMatrix; } -void traverseNode ( +void traverseNode( std::map & n2m, const tinygltf::Scene & scene, const std::string & nodeString, const glm::mat4 & parentMatrix - ) +) { const tinygltf::Node & n = scene.nodes.at(nodeString); glm::mat4 M = parentMatrix * getMatrixFromNodeMatrixVector(n); @@ -537,7 +677,7 @@ void rasterizeSetBuffers(const tinygltf::Scene & scene) { size_t s = image.image.size() * sizeof(TextureData); cudaMalloc(&dev_diffuseTex, s); cudaMemcpy(dev_diffuseTex, &image.image.at(0), s, cudaMemcpyHostToDevice); - + diffuseTexWidth = image.width; diffuseTexHeight = image.height; @@ -554,7 +694,8 @@ void rasterizeSetBuffers(const tinygltf::Scene & scene) { // ---------Node hierarchy transform-------- cudaDeviceSynchronize(); - + + // Transform from local to camera dim3 numBlocksNodeTransform((numVertices + numThreadsPerBlock.x - 1) / numThreadsPerBlock.x); _nodeMatrixTransform << > > ( numVertices, @@ -595,21 +736,21 @@ void rasterizeSetBuffers(const tinygltf::Scene & scene) { } // for each node } - + // 3. Malloc for dev_primitives { cudaMalloc(&dev_primitives, totalNumPrimitives * sizeof(Primitive)); } - + // Finally, cudaFree raw dev_bufferViews { std::map::const_iterator it(bufferViewDevPointers.begin()); std::map::const_iterator itEnd(bufferViewDevPointers.end()); - - //bufferViewDevPointers + + //bufferViewDevPointers for (; it != itEnd; it++) { cudaFree(it->second); @@ -623,11 +764,11 @@ void rasterizeSetBuffers(const tinygltf::Scene & scene) { -__global__ +__global__ void _vertexTransformAndAssembly( - int numVertices, - PrimitiveDevBufPointers primitive, - glm::mat4 MVP, glm::mat4 MV, glm::mat3 MV_normal, + int numVertices, + PrimitiveDevBufPointers primitive, + glm::mat4 MVP, glm::mat4 MV, glm::mat3 MV_normal, int width, int height) { // vertex id @@ -636,12 +777,31 @@ void _vertexTransformAndAssembly( // TODO: Apply vertex transformation here // Multiply the MVP matrix for each vertex position, this will transform everything into clipping space + glm::vec4 position = glm::vec4(primitive.dev_position[vid], 1.0f); + glm::vec4 clipVPosition = MVP * position; // Then divide the pos by its w element to transform into NDC space + clipVPosition /= clipVPosition.w; // Finally transform x and y to viewport space + clipVPosition.x = 0.5f * (float)width * (clipVPosition.x + 1.0f); // Viewport(Screen / Window) Space + clipVPosition.y = 0.5f * (float)height * (1.0f - clipVPosition.y); // Viewport(Screen / Window) Space + + primitive.dev_verticesOut[vid].pos = clipVPosition; + + primitive.dev_verticesOut[vid].eyeNor = glm::normalize(MV_normal * primitive.dev_normal[vid]); + glm::vec4 eyeSpacePos = (MV * glm::vec4(primitive.dev_position[vid], 1.0f)); + eyeSpacePos /= eyeSpacePos.w; + primitive.dev_verticesOut[vid].eyePos = glm::vec3(eyeSpacePos); + + if (primitive.dev_diffuseTex != NULL) { + primitive.dev_verticesOut[vid].dev_diffuseTex = primitive.dev_diffuseTex; + primitive.dev_verticesOut[vid].texcoord0 = primitive.dev_texcoord0[vid]; + primitive.dev_verticesOut[vid].texWidth = primitive.diffuseTexWidth; + primitive.dev_verticesOut[vid].texHeight = primitive.diffuseTexHeight; + } // TODO: Apply vertex assembly here // Assemble all attribute arraies into the primitive array - + } } @@ -649,7 +809,7 @@ void _vertexTransformAndAssembly( static int curPrimitiveBeginId = 0; -__global__ +__global__ void _primitiveAssembly(int numIndices, int curPrimitiveBeginId, Primitive* dev_primitives, PrimitiveDevBufPointers primitive) { // index id @@ -660,33 +820,375 @@ void _primitiveAssembly(int numIndices, int curPrimitiveBeginId, Primitive* dev_ // TODO: uncomment the following code for a start // This is primitive assembly for triangles - //int pid; // id for cur primitives vector - //if (primitive.primitiveMode == TINYGLTF_MODE_TRIANGLES) { - // pid = iid / (int)primitive.primitiveType; - // dev_primitives[pid + curPrimitiveBeginId].v[iid % (int)primitive.primitiveType] - // = primitive.dev_verticesOut[primitive.dev_indices[iid]]; - //} - + int pid; // id for cur primitives vector + if (primitive.primitiveMode == TINYGLTF_MODE_TRIANGLES) { + pid = iid / (int)primitive.primitiveType; + dev_primitives[pid + curPrimitiveBeginId].v[iid % (int)primitive.primitiveType] + = primitive.dev_verticesOut[primitive.dev_indices[iid]]; + } // TODO: other primitive types (point, line) } - + +} + +__device__ float cuda_clamp(float input, float min, float max) { + float result = input; + if (result < min) + result = min; + if (result > max) + result = max; + return result; +} +__device__ __host__ float cuda_getPerspectiveCorrectZ(glm::vec3 tri[3], glm::vec3 baryvalue) { + float inverse_Z = baryvalue.x / (tri[0].z + FLT_EPSILON) + baryvalue.y / (tri[1].z + FLT_EPSILON) + baryvalue.z / (tri[2].z + FLT_EPSILON); + return 1.0f / inverse_Z; +} +__device__ __host__ glm::vec2 cuda_getPerspectiveCorrectUV(glm::vec2 tri_uvs[3], glm::vec3 tri[3], glm::vec3 baryvalue, float Z) { + glm::vec2 correct_texcoords = Z * glm::vec2( + baryvalue.x * tri_uvs[0] / (tri[0].z + FLT_EPSILON) + + baryvalue.y * tri_uvs[1] / (tri[1].z + FLT_EPSILON) + + baryvalue.z * tri_uvs[2] / (tri[2].z + FLT_EPSILON)); + return correct_texcoords; +} +__device__ __host__ glm::vec3 cuda_getPerspectiveCorrectNormal(glm::vec3 tri_normals[3], glm::vec3 tri[3], glm::vec3 baryvalue, float Z) { + glm::vec3 correct_normal = glm::normalize(Z * glm::vec3( + baryvalue.x * tri_normals[0] / (tri[0].z + FLT_EPSILON) + + baryvalue.y * tri_normals[1] / (tri[1].z + FLT_EPSILON) + + baryvalue.z * tri_normals[2] / (tri[2].z + FLT_EPSILON))); + return correct_normal; +} + +__host__ __device__ void naive_sort(glm::vec4 *k_buffer4) { + for (int i = 0; i < 3; i++) { + float min = k_buffer4[i].w; + int n = i; + for (int j = i + 1; j < 4; j++) { + if (k_buffer4[j].w < min) { + n = j; + min = k_buffer4[j].w; + } + } + glm::vec4 temp = k_buffer4[i]; + k_buffer4[i] = k_buffer4[n]; + k_buffer4[n] = temp; + } +} + +// From https://devtalk.nvidia.com/default/topic/492068/atomicmin-with-float/ +__device__ static +float fatomicMin(float *addr, float value) +{ + float old = *addr, assumed; + if (old <= value) return old; + do { + assumed = old; + old = atomicCAS((unsigned int*)addr, __float_as_int(assumed), __float_as_int(value)); + } while (old != assumed); + + return old; +} + + +__global__ void rasterizer(Fragment *fragmentBuffer, Primitive *primitives, int *depth, int num_primitives, int height, int width, int *mutex, KBuffer4* k_buffer) { + // index of primitives + int pid = (blockIdx.x * blockDim.x) + threadIdx.x; + if (pid < num_primitives) { + Primitive this_primitives = primitives[pid]; +#if BackFaceCulling_Toggle + if (glm::dot(this_primitives.v[0].eyeNor, -this_primitives.v[0].eyePos) < 0.0f) + return; +#endif + glm::vec3 tri[3]; + //tri[0] = glm::vec3(0.5f - this_primitives.v[0].pos[0] * 3.0f, 0.8f - this_primitives.v[0].pos[1] * 3.0f, this_primitives.v[0].pos[2]); + //tri[1] = glm::vec3(0.5f - this_primitives.v[1].pos[0] * 3.0f, 0.8f - this_primitives.v[1].pos[1] * 3.0f, this_primitives.v[1].pos[2]); + //tri[2] = glm::vec3(0.5f - this_primitives.v[2].pos[0] * 3.0f, 0.8f - this_primitives.v[2].pos[1] * 3.0f, this_primitives.v[2].pos[2]); + tri[0] = glm::vec3(this_primitives.v[0].pos); + tri[1] = glm::vec3(this_primitives.v[1].pos); + tri[2] = glm::vec3(this_primitives.v[2].pos); + + AABB bbox; + bbox = getAABBForTriangle(tri); + + /*bbox.min.x *= width; + bbox.max.x *= width; + bbox.min.y *= height; + bbox.max.y *= height;*/ + + //clamp inside of the screen + bbox.min.x = glm::clamp(bbox.min.x, 0.0f, float(width)); + bbox.max.x = glm::clamp(bbox.max.x, 0.0f, float(width)); + bbox.min.y = glm::clamp(bbox.min.y, 0.0f, float(height)); + bbox.max.y = glm::clamp(bbox.max.y, 0.0f, float(height)); + + + //scan the pixels inside of the bbox + for (int i = bbox.min.x; i <= bbox.max.x; i++) + for (int j = bbox.min.y; j <= bbox.max.y; j++) { + glm::vec2 point(i, j); + glm::vec3 baryvalue = calculateBarycentricCoordinate(tri, point); + if (isBarycentricCoordInBounds(baryvalue)) { + int pixel_index = i + j*width; + float ffragDepth; +#if Perspective_Correct_Toggle + ffragDepth = cuda_getPerspectiveCorrectZ(tri, baryvalue); +#else + ffragDepth = baryvalue[0] * this_primitives.v[0].pos[2] + baryvalue[1] * this_primitives.v[1].pos[2] + baryvalue[2] * this_primitives.v[2].pos[2]; +#endif + int ifragDepth = INT_MAX * ffragDepth; + +#if K_Buffer_Toggle + + float maxDepth = -1.0f; + int max_id = 0; + for (int m = 3; m >0; m--) { + if (maxDepth < k_buffer[pixel_index].depths[m]) { + maxDepth = k_buffer[pixel_index].depths[m]; + max_id = m; + } + } + + if (ffragDepth < maxDepth) { + fatomicMin(&k_buffer[pixel_index].depths[max_id], ffragDepth); +#else + if (ifragDepth < depth[pixel_index]) { + atomicMin(&depth[pixel_index], ifragDepth); +#endif + bool isSet; + do { + isSet = (atomicCAS(&mutex[pixel_index], 0, 1) == 0); + if (isSet) { + // Critical section goes here. + // The critical section MUST be inside the wait loop; + // if it is afterward, a deadlock will occur. + //fragmentBuffer[pixel_index].color = glm::vec3(1, 1, 1); +#if Perspective_Correct_Toggle + glm::vec2 tri_uvs[3]; + tri_uvs[0] = this_primitives.v[0].texcoord0; + tri_uvs[1] = this_primitives.v[1].texcoord0; + tri_uvs[2] = this_primitives.v[2].texcoord0; + fragmentBuffer[pixel_index].texcoord0 = cuda_getPerspectiveCorrectUV(tri_uvs, tri, baryvalue, ffragDepth); + //fragmentBuffer[pixel_index].texcoord0 = baryvalue[0] * this_primitives.v[0].texcoord0 + baryvalue[1] * this_primitives.v[1].texcoord0 + baryvalue[2] * this_primitives.v[2].texcoord0; +#else + fragmentBuffer[pixel_index].texcoord0 = baryvalue[0] * this_primitives.v[0].texcoord0 + baryvalue[1] * this_primitives.v[1].texcoord0 + baryvalue[2] * this_primitives.v[2].texcoord0; +#endif +#if Perspective_Correct_Toggle + glm::vec3 tri_normals[3]; + tri_normals[0] = this_primitives.v[0].eyeNor; + tri_normals[1] = this_primitives.v[1].eyeNor; + tri_normals[2] = this_primitives.v[2].eyeNor; + fragmentBuffer[pixel_index].eyeNor = cuda_getPerspectiveCorrectNormal(tri_normals, tri, baryvalue, ffragDepth); +#else + fragmentBuffer[pixel_index].eyeNor = baryvalue[0] * this_primitives.v[0].eyeNor + baryvalue[1] * this_primitives.v[1].eyeNor + baryvalue[2] * this_primitives.v[2].eyeNor; +#endif + fragmentBuffer[pixel_index].eyePos = baryvalue[0] * this_primitives.v[0].eyePos + baryvalue[1] * this_primitives.v[1].eyePos + baryvalue[2] * this_primitives.v[2].eyePos; + + fragmentBuffer[pixel_index].TexWidth = this_primitives.v[0].texWidth; + fragmentBuffer[pixel_index].TexHeight = this_primitives.v[0].texHeight; + + + +#if K_Buffer_Toggle + if (this_primitives.v[0].dev_diffuseTex != NULL) { + fragmentBuffer[pixel_index].dev_diffuseTex = this_primitives.v[0].dev_diffuseTex; +#if Bilinear_Color_Filter_Toggle + fragmentBuffer[pixel_index].color = getBilinearFilteredPixelColor(this_primitives.v[0].dev_diffuseTex, fragmentBuffer[pixel_index].texcoord0, this_primitives.v[0].texWidth, this_primitives.v[0].texHeight); +#else + fragmentBuffer[pixel_index].color = glm::vec3(1.0f, 1.0f, 1.0f); +#endif + //fragmentBuffer[pixel_index].K_buffer[max_id] = glm::vec4(fragmentBuffer[pixel_index].texcoord0, 0.0f, ffragDepth); + } + else + fragmentBuffer[pixel_index].color = glm::vec3(1, 1, 1); + //K_buffer RBGZ + fragmentBuffer[pixel_index].K_buffer[max_id] = glm::vec4(fragmentBuffer[pixel_index].color, ffragDepth); + //sort fragment k-buffer +#if Naive_Sort_Toggle + naive_sort(fragmentBuffer[pixel_index].K_buffer); +#else + float keys[4] = { fragmentBuffer[pixel_index].K_buffer[0].w, fragmentBuffer[pixel_index].K_buffer[1].w, fragmentBuffer[pixel_index].K_buffer[2].w , fragmentBuffer[pixel_index].K_buffer[3].w }; + thrust::sort_by_key(thrust::device, keys, keys + 4, fragmentBuffer[pixel_index].K_buffer); +#endif + for (int m = 0; m < 4; m++) { + k_buffer[pixel_index].depths[m] = fragmentBuffer[pixel_index].K_buffer[m].w; + } +#else + if (this_primitives.v[0].dev_diffuseTex != NULL) { + fragmentBuffer[pixel_index].dev_diffuseTex = this_primitives.v[0].dev_diffuseTex; + fragmentBuffer[pixel_index].color = glm::vec3(1.0f, 1.0f, 1.0f); + //fragmentBuffer[pixel_index].color = getBilinearFilteredPixelColor(this_primitives.v[0].dev_diffuseTex, fragmentBuffer[pixel_index].texcoord0, this_primitives.v[0].texWidth, this_primitives.v[0].texHeight); + } + else + fragmentBuffer[pixel_index].color = glm::vec3(1, 1, 1); +#endif + //k_max_idx[pixel_index] = 3; + } + if (isSet) { + mutex[pixel_index] = 0; + } + } while (!isSet); + } + } + } + } + +} + +__global__ void rasterizer_Line(Fragment *fragmentBuffer, Primitive *primitives, int *depth, int num_primitives, int height, int width, int *mutex) { + // index of primitives + int pid = (blockIdx.x * blockDim.x) + threadIdx.x; + if (pid < num_primitives) { + Primitive this_primitives = primitives[pid]; + //if (glm::dot(this_primitives.v[0].eyeNor, -this_primitives.v[0].eyePos) < 0.0f) + // return; + + //3 edges for each triangle + for (int i = 0; i < 3; i++) { + VertexOut v_outs[2]; + v_outs[0] = this_primitives.v[i % 3]; + v_outs[1] = this_primitives.v[(i + 1) % 3]; + glm::vec3 v_start, v_end; + v_start = glm::vec3(v_outs[0].pos); + v_end = glm::vec3(v_outs[1].pos); + v_start = glm::clamp(v_start, glm::vec3(0, 0, 0), glm::vec3(width, height, 1.0f)); + v_end = glm::clamp(v_end, glm::vec3(0, 0, 0), glm::vec3(width, height, 1.0f)); + glm::vec3 v_dir = glm::normalize(v_end - v_start); + int j = 0; + while (true) { + glm::vec3 v_curr = v_start + v_dir * float(j); + j++; + if (glm::dot(v_end - v_curr, v_dir) < 0.0f) + break; + int px, py; + px = v_curr.x; + py = v_curr.y; + int pixel_index = px + py*width; + glm::vec2 baryvalue; + baryvalue[0] = glm::length(v_curr - v_start) / glm::length(v_end - v_start); + baryvalue[1] = 1.0f - baryvalue[0]; + //Get perspective Correct Z + float ffragDepth = baryvalue[0] / v_start.z + baryvalue[1] / v_end.z; + ffragDepth = 1.0f / ffragDepth; + int ifragDepth = INT_MAX * ffragDepth; + if (ifragDepth < depth[pixel_index]) { + atomicMin(&depth[pixel_index], ifragDepth); + bool isSet; + do { + isSet = (atomicCAS(&mutex[pixel_index], 0, 1) == 0); + if (isSet) { + //TexCoords(Perspective Correct) + fragmentBuffer[pixel_index].texcoord0 = (ffragDepth*( + v_outs[0].texcoord0 * baryvalue[0] / v_outs[0].pos.z + + v_outs[1].texcoord0 * baryvalue[1] / v_outs[1].pos.z + ) + ); + //Normals(Per. Cor.) + fragmentBuffer[pixel_index].eyeNor = glm::normalize(ffragDepth*( + v_outs[0].eyeNor * baryvalue[0] / v_outs[0].pos.z + + v_outs[1].eyeNor * baryvalue[1] / v_outs[1].pos.z + ) + ); + //EyePos + fragmentBuffer[pixel_index].eyePos = baryvalue[0] * v_outs[0].eyePos + baryvalue[1] * v_outs[1].eyePos; + // + fragmentBuffer[pixel_index].TexWidth = v_outs[0].texWidth; + fragmentBuffer[pixel_index].TexHeight = v_outs[0].texHeight; + //Tex + if (v_outs[0].dev_diffuseTex != NULL) { + fragmentBuffer[pixel_index].dev_diffuseTex = v_outs[0].dev_diffuseTex; + //fragmentBuffer[pixel_index].color = getBilinearFilteredPixelColor(this_primitives.v[0].dev_diffuseTex, fragmentBuffer[pixel_index].texcoord0, this_primitives.v[0].texWidth, this_primitives.v[0].texHeight); + } + else + fragmentBuffer[pixel_index].color = glm::vec3(1, 1, 1); + + } + if (isSet) { + mutex[pixel_index] = 0; + } + } while (!isSet); + } + + } + } + } + } +__global__ void rasterizer_Point(Fragment *fragmentBuffer, Primitive *primitives, int *depth, int num_primitives, int height, int width, int *mutex) { + // index of primitives + int pid = (blockIdx.x * blockDim.x) + threadIdx.x; + if (pid < num_primitives) { + Primitive this_primitives = primitives[pid]; + //if (glm::dot(this_primitives.v[0].eyeNor, -this_primitives.v[0].eyePos) < 0.0f) + // return; + + //3 points for each triangle + for (int i = 0; i < 3; i++) { + int pixel_index = int(this_primitives.v[i].pos.x) + int(this_primitives.v[i].pos.y) * width; + float ffragDepth = this_primitives.v[i].pos.z; + int ifragDepth = INT_MAX * ffragDepth; + if (ifragDepth < depth[pixel_index]) { + atomicMin(&depth[pixel_index], ifragDepth); + bool isSet; + do { + isSet = (atomicCAS(&mutex[pixel_index], 0, 1) == 0); + if (isSet) { + //TexCoords + fragmentBuffer[pixel_index].texcoord0 = this_primitives.v[i].texcoord0; + //Normals(Per. Cor.) + fragmentBuffer[pixel_index].eyeNor = this_primitives.v[i].eyeNor; + //EyePos + fragmentBuffer[pixel_index].eyePos = this_primitives.v[i].eyePos; + // + fragmentBuffer[pixel_index].TexWidth = this_primitives.v[0].texWidth; + fragmentBuffer[pixel_index].TexHeight = this_primitives.v[0].texHeight; + //Tex + if (this_primitives.v[0].dev_diffuseTex != NULL) { + fragmentBuffer[pixel_index].dev_diffuseTex = this_primitives.v[0].dev_diffuseTex; + //fragmentBuffer[pixel_index].color = getBilinearFilteredPixelColor(this_primitives.v[0].dev_diffuseTex, fragmentBuffer[pixel_index].texcoord0, this_primitives.v[0].texWidth, this_primitives.v[0].texHeight); + } + else + fragmentBuffer[pixel_index].color = glm::vec3(1, 1, 1); + + } + if (isSet) { + mutex[pixel_index] = 0; + } + } while (!isSet); + } + + } + } +} + +struct BackFaceCulling_Cmp { + __host__ __device__ bool operator()(const Primitive &p) { + glm::vec3 face_normal = glm::cross(glm::vec3(p.v[1].pos - p.v[0].pos), glm::vec3(p.v[2].pos - p.v[0].pos)); + glm::vec3 inverse_eye_dir = -p.v[0].eyePos; + // 'cause the NDC to pixel mirror the vertices, thus the front face turns to be clockwise + return glm::dot(face_normal, inverse_eye_dir) > 0.0f; + } +}; /** - * Perform rasterization. - */ +* Perform rasterization. +*/ void rasterize(uchar4 *pbo, const glm::mat4 & MVP, const glm::mat4 & MV, const glm::mat3 MV_normal) { - int sideLength2d = 8; - dim3 blockSize2d(sideLength2d, sideLength2d); - dim3 blockCount2d((width - 1) / blockSize2d.x + 1, + int sideLength2d = 8; + dim3 blockSize2d(sideLength2d, sideLength2d); + dim3 blockCount2d((width - 1) / blockSize2d.x + 1, (height - 1) / blockSize2d.y + 1); // Execute your rasterization pipeline here // (See README for rasterization pipeline outline.) + /*float time_elapsed=0; + cudaEvent_t start,stop; + cudaEventCreate(&start); + cudaEventCreate(&stop); + cudaEventRecord( start,0); +*/ // Vertex Process & primitive assembly { curPrimitiveBeginId = 0; @@ -706,10 +1208,10 @@ void rasterize(uchar4 *pbo, const glm::mat4 & MVP, const glm::mat4 & MV, const g checkCUDAError("Vertex Processing"); cudaDeviceSynchronize(); _primitiveAssembly << < numBlocksForIndices, numThreadsPerBlock >> > - (p->numIndices, - curPrimitiveBeginId, - dev_primitives, - *p); + (p->numIndices, + curPrimitiveBeginId, + dev_primitives, + *p); checkCUDAError("Primitive Assembly"); curPrimitiveBeginId += p->numPrimitives; @@ -718,28 +1220,102 @@ void rasterize(uchar4 *pbo, const glm::mat4 & MVP, const glm::mat4 & MV, const g checkCUDAError("Vertex Processing and Primitive Assembly"); } - + + /*cudaEventRecord( stop,0); + cudaEventSynchronize(start); + cudaEventSynchronize(stop); + cudaEventElapsedTime(&time_elapsed,start,stop); + if (counter < 100) { + time_ap += time_elapsed; + } + else if (counter == 100) { + printf("Vertex Process & primitive Assembly: %f ms\n", time_ap); + }*/ + + + int Culled_totalNumPrimitives = totalNumPrimitives; +#if BackFaceCulling_Toggle + Primitive* dev_primitives_end = thrust::remove_if(thrust::device, dev_primitives, dev_primitives + totalNumPrimitives, BackFaceCulling_Cmp()); + Culled_totalNumPrimitives = dev_primitives_end - dev_primitives; + if (Culled_totalNumPrimitives <= 0) + Culled_totalNumPrimitives = 1; +#endif cudaMemset(dev_fragmentBuffer, 0, width * height * sizeof(Fragment)); initDepth << > >(width, height, dev_depth); - +#if K_Buffer_Toggle + initKBuffer4 << > > (width, height, dev_k_buffer); + initKBufferInFrag << > > (width, height, dev_fragmentBuffer); +#endif + //cudaEventRecord(start, 0); + // TODO: rasterize + cudaMemset(dev_mutex, 0, width * height * sizeof(int)); + dim3 numThreadsPerBlock(128); + dim3 numBlocksForPrimitives((Culled_totalNumPrimitives + numThreadsPerBlock.x - 1) / numThreadsPerBlock.x); + if (curr_Mode == r_Point) + rasterizer_Point << > >(dev_fragmentBuffer, dev_primitives, dev_depth, Culled_totalNumPrimitives, height, width, dev_mutex); + else if (curr_Mode == r_Line) + rasterizer_Line << > >(dev_fragmentBuffer, dev_primitives, dev_depth, Culled_totalNumPrimitives, height, width, dev_mutex); + else if (curr_Mode == r_Triangle) + rasterizer << > >(dev_fragmentBuffer, dev_primitives, dev_depth, Culled_totalNumPrimitives, height, width, dev_mutex, dev_k_buffer); + + /*cudaEventRecord(stop, 0); + cudaEventSynchronize(start); + cudaEventSynchronize(stop); + cudaEventElapsedTime(&time_elapsed, start, stop); + if (counter < 100) { + time_r += time_elapsed; + } + else if (counter == 100) { + printf("Rasterization: %f ms\n", time_r); + }*/ + checkCUDAError("rasterization"); + + //cudaEventRecord(start, 0); + // Copy depthbuffer colors into framebuffer + render << > >(width, height, dev_fragmentBuffer, dev_framebuffer, curr_Mode); + + /*cudaEventRecord(stop, 0); + cudaEventSynchronize(start); + cudaEventSynchronize(stop); + cudaEventElapsedTime(&time_elapsed, start, stop);*/ + /*if (counter < 100) { + time_f += time_elapsed; + } + else if (counter == 100) { + printf("Render(Fragment Shader): %f ms\n", time_f); + }*/ + + //cudaEventRecord(start, 0); - // Copy depthbuffer colors into framebuffer - render << > >(width, height, dev_fragmentBuffer, dev_framebuffer); checkCUDAError("fragment shader"); - // Copy framebuffer into OpenGL buffer for OpenGL previewing - sendImageToPBO<<>>(pbo, width, height, dev_framebuffer); - checkCUDAError("copy render result to pbo"); + // Copy framebuffer into OpenGL buffer for OpenGL previewing + + sendImageToPBO << > >(pbo, width, height, dev_framebuffer); + + //cudaEventRecord(stop, 0); + //cudaEventSynchronize(start); + //cudaEventSynchronize(stop); + //cudaEventElapsedTime(&time_elapsed, start, stop); + //if (counter < 100) { + // time_s += time_elapsed; + //} + //else if (counter == 100) { + // printf("SendToPBO: %f ms\n", time_s); + //} + //counter++; + + checkCUDAError("copy render result to pbo"); } /** - * Called once at the end of the program to free CUDA memory. - */ +* Called once at the end of the program to free CUDA memory. +*/ void rasterizeFree() { - // deconstruct primitives attribute/indices device buffer + // deconstruct primitives attribute/indices device buffer auto it(mesh2PrimitivesMap.begin()); auto itEnd(mesh2PrimitivesMap.end()); @@ -753,24 +1329,31 @@ void rasterizeFree() { cudaFree(p->dev_verticesOut); - + //TODO: release other attributes and materials } } //////////// - cudaFree(dev_primitives); - dev_primitives = NULL; + cudaFree(dev_primitives); + dev_primitives = NULL; cudaFree(dev_fragmentBuffer); dev_fragmentBuffer = NULL; - cudaFree(dev_framebuffer); - dev_framebuffer = NULL; + cudaFree(dev_framebuffer); + dev_framebuffer = NULL; cudaFree(dev_depth); dev_depth = NULL; +#if K_Buffer_Toggle + cudaFree(dev_k_buffer); + dev_k_buffer = NULL; + +#endif + cudaFree(dev_mutex); + dev_mutex = NULL; - checkCUDAError("rasterize Free"); + checkCUDAError("rasterize Free"); } diff --git a/src/rasterize.h b/src/rasterize.h index 560aae9..8d2604e 100644 --- a/src/rasterize.h +++ b/src/rasterize.h @@ -22,3 +22,5 @@ void rasterizeSetBuffers(const tinygltf::Scene & scene); void rasterize(uchar4 *pbo, const glm::mat4 & MVP, const glm::mat4 & MV, const glm::mat3 MV_normal); void rasterizeFree(); + +enum RenderMode {r_Point, r_Line, r_Triangle}; diff --git a/src/rasterizeTools.h b/src/rasterizeTools.h index 46c701e..9d77154 100644 --- a/src/rasterizeTools.h +++ b/src/rasterizeTools.h @@ -99,3 +99,4 @@ float getZAtCoordinate(const glm::vec3 barycentricCoord, const glm::vec3 tri[3]) + barycentricCoord.y * tri[1].z + barycentricCoord.z * tri[2].z); } +