├── .gitignore ├── OpenSubdivForUnity ├── Assets │ ├── Examples.meta │ ├── Examples │ │ ├── Animations.meta │ │ ├── Animations │ │ │ ├── Raycaster.controller │ │ │ ├── Raycaster.controller.meta │ │ │ ├── TestRaycaster.anim │ │ │ └── TestRaycaster.anim.meta │ │ ├── Materials.meta │ │ ├── Materials │ │ │ ├── Default.mat │ │ │ └── Default.mat.meta │ │ ├── Scripts.meta │ │ ├── Scripts │ │ │ ├── BezierPatchRaycaster.cs │ │ │ └── BezierPatchRaycaster.cs.meta │ │ ├── Shaders.meta │ │ └── Shaders │ │ │ ├── BezierPatchDebug.compute │ │ │ └── BezierPatchDebug.compute.meta │ ├── Ist.meta │ ├── Ist │ │ ├── BatchRenderer.meta │ │ ├── BatchRenderer │ │ │ ├── Materials.meta │ │ │ ├── Materials │ │ │ │ ├── BatchBillboard_Add.mat │ │ │ │ ├── BatchBillboard_Add.mat.meta │ │ │ │ ├── BatchBillboard_AddMultiply.mat │ │ │ │ ├── BatchBillboard_AddMultiply.mat.meta │ │ │ │ ├── BatchBillboard_AlphaBlend.mat │ │ │ │ ├── BatchBillboard_AlphaBlend.mat.meta │ │ │ │ ├── BatchStandard.mat │ │ │ │ ├── BatchStandard.mat.meta │ │ │ │ ├── BatchTransparent_Add.mat │ │ │ │ ├── BatchTransparent_Add.mat.meta │ │ │ │ ├── BatchTransparent_AddMultiply.mat │ │ │ │ ├── BatchTransparent_AddMultiply.mat.meta │ │ │ │ ├── BatchTransparent_AlphaBlend.mat │ │ │ │ ├── BatchTransparent_AlphaBlend.mat.meta │ │ │ │ ├── ProceduralGBuffer.mat │ │ │ │ └── ProceduralGBuffer.mat.meta │ │ │ ├── Prefabs.meta │ │ │ ├── Prefabs │ │ │ │ ├── BatchRenderer.prefab │ │ │ │ └── BatchRenderer.prefab.meta │ │ │ ├── Scripts.meta │ │ │ ├── Scripts │ │ │ │ ├── BatchRenderer.cs │ │ │ │ ├── BatchRenderer.cs.meta │ │ │ │ ├── BatchRendererBase.cs │ │ │ │ ├── BatchRendererBase.cs.meta │ │ │ │ ├── BatchRendererUtil.cs │ │ │ │ ├── BatchRendererUtil.cs.meta │ │ │ │ ├── CustumDataBatchRenderer.cs │ │ │ │ ├── CustumDataBatchRenderer.cs.meta │ │ │ │ ├── ProceduralGBuffer.cs │ │ │ │ └── ProceduralGBuffer.cs.meta │ │ │ ├── Shaders.meta │ │ │ └── Shaders │ │ │ │ ├── BatchRenderer.cginc │ │ │ │ ├── BatchRenderer.cginc.meta │ │ │ │ ├── Billboard.cginc │ │ │ │ ├── Billboard.cginc.meta │ │ │ │ ├── Billboard.shader │ │ │ │ ├── Billboard.shader.meta │ │ │ │ ├── FixedBillboard.shader │ │ │ │ ├── FixedBillboard.shader.meta │ │ │ │ ├── ProceduralGBuffer.shader │ │ │ │ ├── ProceduralGBuffer.shader.meta │ │ │ │ ├── Standard.shader │ │ │ │ ├── Standard.shader.meta │ │ │ │ ├── Surface.cginc │ │ │ │ ├── Surface.cginc.meta │ │ │ │ ├── Transparent.cginc │ │ │ │ ├── Transparent.cginc.meta │ │ │ │ ├── Transparent.shader │ │ │ │ └── Transparent.shader.meta │ │ ├── BezierPatch.meta │ │ ├── BezierPatch │ │ │ ├── Editor.meta │ │ │ ├── Editor │ │ │ │ ├── BezierPatchEditorEditor.cs │ │ │ │ └── BezierPatchEditorEditor.cs.meta │ │ │ ├── Materials.meta │ │ │ ├── Materials │ │ │ │ ├── BezierPatchRaytracer.mat │ │ │ │ └── BezierPatchRaytracer.mat.meta │ │ │ ├── Scripts.meta │ │ │ ├── Scripts │ │ │ │ ├── BezierPatchContainer.cs │ │ │ │ ├── BezierPatchContainer.cs.meta │ │ │ │ ├── BezierPatchControlPoint.cs │ │ │ │ ├── BezierPatchControlPoint.cs.meta │ │ │ │ ├── BezierPatchEditor.cs │ │ │ │ ├── BezierPatchEditor.cs.meta │ │ │ │ ├── BezierPatchFoundation.cs │ │ │ │ ├── BezierPatchFoundation.cs.meta │ │ │ │ ├── BezierPatchRenderer.cs │ │ │ │ ├── BezierPatchRenderer.cs.meta │ │ │ │ ├── IBezierPatchContainer.cs │ │ │ │ └── IBezierPatchContainer.cs.meta │ │ │ ├── Shaders.meta │ │ │ └── Shaders │ │ │ │ ├── BezierPatchGBuffer.shader │ │ │ │ └── BezierPatchGBuffer.shader.meta │ │ ├── Foundation.meta │ │ ├── Foundation │ │ │ ├── Materials.meta │ │ │ ├── Materials │ │ │ │ ├── DoNothing.mat │ │ │ │ └── DoNothing.mat.meta │ │ │ ├── Meshes.meta │ │ │ ├── Meshes │ │ │ │ ├── Capsule(Reverse).asset │ │ │ │ ├── Capsule(Reverse).asset.meta │ │ │ │ ├── Cube(Reverse).asset │ │ │ │ ├── Cube(Reverse).asset.meta │ │ │ │ ├── Cube.asset │ │ │ │ ├── Cube.asset.meta │ │ │ │ ├── IcoSphere.asset │ │ │ │ ├── IcoSphere.asset.meta │ │ │ │ ├── IcoSphereI2.asset │ │ │ │ ├── IcoSphereI2.asset.meta │ │ │ │ ├── IcoSphereI3.asset │ │ │ │ ├── IcoSphereI3.asset.meta │ │ │ │ ├── LineSquare.asset │ │ │ │ ├── LineSquare.asset.meta │ │ │ │ ├── Quad.asset │ │ │ │ ├── Quad.asset.meta │ │ │ │ ├── Sphere(Reverse).asset │ │ │ │ ├── Sphere(Reverse).asset.meta │ │ │ │ ├── Sphere.asset │ │ │ │ ├── Sphere.asset.meta │ │ │ │ ├── Square.asset │ │ │ │ ├── Square.asset.meta │ │ │ │ ├── WireCube.asset │ │ │ │ └── WireCube.asset.meta │ │ │ ├── Scripts.meta │ │ │ ├── Scripts │ │ │ │ ├── HalfConverter.cs │ │ │ │ ├── HalfConverter.cs.meta │ │ │ │ ├── ICommandBufferExecuter.cs │ │ │ │ ├── ICommandBufferExecuter.cs.meta │ │ │ │ ├── Singleton.cs │ │ │ │ └── Singleton.cs.meta │ │ │ ├── Shaders.meta │ │ │ └── Shaders │ │ │ │ ├── BezierPatch.cginc │ │ │ │ ├── BezierPatch.cginc.meta │ │ │ │ ├── BezierPatch.glslinc │ │ │ │ ├── BezierPatch.glslinc.meta │ │ │ │ ├── BezierPatchIntersection.cginc │ │ │ │ ├── BezierPatchIntersection.cginc.meta │ │ │ │ ├── BuiltinVariablesExt.cginc │ │ │ │ ├── BuiltinVariablesExt.cginc.meta │ │ │ │ ├── DoNothing.shader │ │ │ │ ├── DoNothing.shader.meta │ │ │ │ ├── Geometry.cginc │ │ │ │ ├── Geometry.cginc.meta │ │ │ │ ├── Math.cginc │ │ │ │ ├── Math.cginc.meta │ │ │ │ ├── Random.cginc │ │ │ │ └── Random.cginc.meta │ │ ├── GBufferUtils.meta │ │ ├── GBufferUtils │ │ │ ├── Materials.meta │ │ │ ├── Materials │ │ │ │ ├── Depth.mat │ │ │ │ ├── Depth.mat.meta │ │ │ │ ├── SimpleColor.mat │ │ │ │ ├── SimpleColor.mat.meta │ │ │ │ ├── ZPrePass.mat │ │ │ │ └── ZPrePass.mat.meta │ │ │ ├── Scripts.meta │ │ │ ├── Scripts │ │ │ │ ├── DepthDrawer.cs │ │ │ │ ├── DepthDrawer.cs.meta │ │ │ │ ├── EmissionDrawer.cs │ │ │ │ ├── EmissionDrawer.cs.meta │ │ │ │ ├── GBufferUtils.cs │ │ │ │ ├── GBufferUtils.cs.meta │ │ │ │ ├── MaterialSettings.cs │ │ │ │ ├── MaterialSettings.cs.meta │ │ │ │ ├── ShaderParams.cs │ │ │ │ ├── ShaderParams.cs.meta │ │ │ │ ├── VelocityDrawer.cs │ │ │ │ └── VelocityDrawer.cs.meta │ │ │ ├── Shaders.meta │ │ │ └── Shaders │ │ │ │ ├── Depth.shader │ │ │ │ ├── Depth.shader.meta │ │ │ │ ├── DepthToVelocity.shader │ │ │ │ ├── DepthToVelocity.shader.meta │ │ │ │ ├── GBufferCopy.shader │ │ │ │ ├── GBufferCopy.shader.meta │ │ │ │ ├── GBufferUtils.cginc │ │ │ │ ├── GBufferUtils.cginc.meta │ │ │ │ ├── SimpleTexture.shader │ │ │ │ ├── SimpleTexture.shader.meta │ │ │ │ ├── Velocity.shader │ │ │ │ ├── Velocity.shader.meta │ │ │ │ ├── ZPrePass.shader │ │ │ │ └── ZPrePass.shader.meta │ │ ├── MassParticle.meta │ │ ├── MassParticle │ │ │ ├── CPUParticle.meta │ │ │ ├── CPUParticle │ │ │ │ ├── Materials.meta │ │ │ │ ├── Materials │ │ │ │ │ ├── MPDSGBuffer.mat │ │ │ │ │ ├── MPDSGBuffer.mat.meta │ │ │ │ │ ├── MPDSGbufferCB.mat │ │ │ │ │ ├── MPDSGbufferCB.mat.meta │ │ │ │ │ ├── MPDepthPrePass.mat │ │ │ │ │ ├── MPDepthPrePass.mat.meta │ │ │ │ │ ├── MPGSBillboard.mat │ │ │ │ │ ├── MPGSBillboard.mat.meta │ │ │ │ │ ├── MPLambert.mat │ │ │ │ │ ├── MPLambert.mat.meta │ │ │ │ │ ├── MPPointLight.mat │ │ │ │ │ ├── MPPointLight.mat.meta │ │ │ │ │ ├── MPStandard.mat │ │ │ │ │ ├── MPStandard.mat.meta │ │ │ │ │ ├── MPStandardSpherify.mat │ │ │ │ │ └── MPStandardSpherify.mat.meta │ │ │ │ ├── Prefabs.meta │ │ │ │ ├── Prefabs │ │ │ │ │ ├── MPBoxCollider.prefab │ │ │ │ │ ├── MPBoxCollider.prefab.meta │ │ │ │ │ ├── MPCapsuleCollider.prefab │ │ │ │ │ ├── MPCapsuleCollider.prefab.meta │ │ │ │ │ ├── MPEmitter.prefab │ │ │ │ │ ├── MPEmitter.prefab.meta │ │ │ │ │ ├── MPForce.prefab │ │ │ │ │ ├── MPForce.prefab.meta │ │ │ │ │ ├── MPSphereCollider.prefab │ │ │ │ │ ├── MPSphereCollider.prefab.meta │ │ │ │ │ ├── MPWorld.prefab │ │ │ │ │ └── MPWorld.prefab.meta │ │ │ │ ├── Scripts.meta │ │ │ │ ├── Scripts │ │ │ │ │ ├── MP.cs │ │ │ │ │ ├── MP.cs.meta │ │ │ │ │ ├── MPBoxCollider.cs │ │ │ │ │ ├── MPBoxCollider.cs.meta │ │ │ │ │ ├── MPCapsuleCollider.cs │ │ │ │ │ ├── MPCapsuleCollider.cs.meta │ │ │ │ │ ├── MPCollider.cs │ │ │ │ │ ├── MPCollider.cs.meta │ │ │ │ │ ├── MPEmitter.cs │ │ │ │ │ ├── MPEmitter.cs.meta │ │ │ │ │ ├── MPForce.cs │ │ │ │ │ ├── MPForce.cs.meta │ │ │ │ │ ├── MPLightRenderer.cs │ │ │ │ │ ├── MPLightRenderer.cs.meta │ │ │ │ │ ├── MPRenderer.cs │ │ │ │ │ ├── MPRenderer.cs.meta │ │ │ │ │ ├── MPSphereCollider.cs │ │ │ │ │ ├── MPSphereCollider.cs.meta │ │ │ │ │ ├── MPWorld.cs │ │ │ │ │ └── MPWorld.cs.meta │ │ │ │ ├── Shaders.meta │ │ │ │ └── Shaders │ │ │ │ │ ├── MPDepthPrePass.shader │ │ │ │ │ ├── MPDepthPrePass.shader.meta │ │ │ │ │ ├── MPFoundation.cginc │ │ │ │ │ ├── MPFoundation.cginc.meta │ │ │ │ │ ├── MPGSBillboard.shader │ │ │ │ │ ├── MPGSBillboard.shader.meta │ │ │ │ │ ├── MPLambert.shader │ │ │ │ │ ├── MPLambert.shader.meta │ │ │ │ │ ├── MPPointLight.shader │ │ │ │ │ ├── MPPointLight.shader.meta │ │ │ │ │ ├── MPStandard.shader │ │ │ │ │ ├── MPStandard.shader.meta │ │ │ │ │ ├── MPStandardSpherify.shader │ │ │ │ │ ├── MPStandardSpherify.shader.meta │ │ │ │ │ ├── MPSurface.cginc │ │ │ │ │ └── MPSurface.cginc.meta │ │ │ ├── GPUParticle.meta │ │ │ └── GPUParticle │ │ │ │ ├── Materials.meta │ │ │ │ ├── Materials │ │ │ │ ├── MPGPPointLight.mat │ │ │ │ ├── MPGPPointLight.mat.meta │ │ │ │ ├── MPGPStandard.mat │ │ │ │ ├── MPGPStandard.mat.meta │ │ │ │ ├── MPGPTrail.mat │ │ │ │ ├── MPGPTrail.mat.meta │ │ │ │ ├── MPGPTransparentAdd.mat │ │ │ │ └── MPGPTransparentAdd.mat.meta │ │ │ │ ├── Prefabs.meta │ │ │ │ ├── Prefabs │ │ │ │ ├── MPGPEmitter.prefab │ │ │ │ ├── MPGPEmitter.prefab.meta │ │ │ │ ├── MPGPForce.prefab │ │ │ │ ├── MPGPForce.prefab.meta │ │ │ │ ├── MPGPWorld.prefab │ │ │ │ └── MPGPWorld.prefab.meta │ │ │ │ ├── Scripts.meta │ │ │ │ ├── Scripts │ │ │ │ ├── MPGPBezierPatchCollider.cs │ │ │ │ ├── MPGPBezierPatchCollider.cs.meta │ │ │ │ ├── MPGPBoxCollider.cs │ │ │ │ ├── MPGPBoxCollider.cs.meta │ │ │ │ ├── MPGPCapsuleCollider.cs │ │ │ │ ├── MPGPCapsuleCollider.cs.meta │ │ │ │ ├── MPGPCollider.cs │ │ │ │ ├── MPGPCollider.cs.meta │ │ │ │ ├── MPGPDataTypes.cs │ │ │ │ ├── MPGPDataTypes.cs.meta │ │ │ │ ├── MPGPEmitter.cs │ │ │ │ ├── MPGPEmitter.cs.meta │ │ │ │ ├── MPGPForce.cs │ │ │ │ ├── MPGPForce.cs.meta │ │ │ │ ├── MPGPGPUSort.cs │ │ │ │ ├── MPGPGPUSort.cs.meta │ │ │ │ ├── MPGPLightRenderer.cs │ │ │ │ ├── MPGPLightRenderer.cs.meta │ │ │ │ ├── MPGPRenderer.cs │ │ │ │ ├── MPGPRenderer.cs.meta │ │ │ │ ├── MPGPSphereCollider.cs │ │ │ │ ├── MPGPSphereCollider.cs.meta │ │ │ │ ├── MPGPTrailRenderer.cs │ │ │ │ ├── MPGPTrailRenderer.cs.meta │ │ │ │ ├── MPGPWorld.cs │ │ │ │ └── MPGPWorld.cs.meta │ │ │ │ ├── Shaders.meta │ │ │ │ └── Shaders │ │ │ │ ├── MPGPBitonicSort.compute │ │ │ │ ├── MPGPBitonicSort.compute.meta │ │ │ │ ├── MPGPFoundation.cginc │ │ │ │ ├── MPGPFoundation.cginc.meta │ │ │ │ ├── MPGPHashGrid.compute │ │ │ │ ├── MPGPHashGrid.compute.meta │ │ │ │ ├── MPGPParticleCore.compute │ │ │ │ ├── MPGPParticleCore.compute.meta │ │ │ │ ├── MPGPPointLight.shader │ │ │ │ ├── MPGPPointLight.shader.meta │ │ │ │ ├── MPGPStandard.shader │ │ │ │ ├── MPGPStandard.shader.meta │ │ │ │ ├── MPGPSurface.cginc │ │ │ │ ├── MPGPSurface.cginc.meta │ │ │ │ ├── MPGPTrail.cginc │ │ │ │ ├── MPGPTrail.cginc.meta │ │ │ │ ├── MPGPTrail.compute │ │ │ │ ├── MPGPTrail.compute.meta │ │ │ │ ├── MPGPTrail_Transparent.shader │ │ │ │ ├── MPGPTrail_Transparent.shader.meta │ │ │ │ ├── MPGPTransparent.shader │ │ │ │ └── MPGPTransparent.shader.meta │ │ ├── Plugins.meta │ │ ├── Plugins │ │ │ ├── x86.meta │ │ │ ├── x86 │ │ │ │ ├── CopyToTexture.dll │ │ │ │ ├── CopyToTexture.dll.meta │ │ │ │ ├── MassParticle.dll │ │ │ │ ├── MassParticle.dll.meta │ │ │ │ ├── MassParticleHelper.dll │ │ │ │ ├── MassParticleHelper.dll.meta │ │ │ │ ├── msvcp120.dll │ │ │ │ ├── msvcp120.dll.meta │ │ │ │ ├── msvcr120.dll │ │ │ │ ├── msvcr120.dll.meta │ │ │ │ ├── tbb.dll │ │ │ │ └── tbb.dll.meta │ │ │ ├── x86_64.meta │ │ │ └── x86_64 │ │ │ │ ├── CopyToTexture.dll │ │ │ │ ├── CopyToTexture.dll.meta │ │ │ │ ├── MassParticle.dll │ │ │ │ ├── MassParticle.dll.meta │ │ │ │ ├── MassParticleHelper.dll │ │ │ │ ├── MassParticleHelper.dll.meta │ │ │ │ ├── msvcp120.dll │ │ │ │ ├── msvcp120.dll.meta │ │ │ │ ├── msvcr120.dll │ │ │ │ ├── msvcr120.dll.meta │ │ │ │ ├── tbb.dll │ │ │ │ └── tbb.dll.meta │ │ ├── Utilities.meta │ │ └── Utilities │ │ │ ├── Scripts.meta │ │ │ ├── Scripts │ │ │ ├── ICommandBufferRenderer.cs │ │ │ ├── ICommandBufferRenderer.cs.meta │ │ │ ├── IcoSphere.cs │ │ │ ├── IcoSphere.cs.meta │ │ │ ├── InstanceSet.cs │ │ │ ├── InstanceSet.cs.meta │ │ │ ├── MeshUtils.cs │ │ │ ├── MeshUtils.cs.meta │ │ │ ├── MouseCameraControl.cs │ │ │ └── MouseCameraControl.cs.meta │ │ │ ├── Textures.meta │ │ │ └── Textures │ │ │ ├── RandomVectors.png │ │ │ └── RandomVectors.png.meta │ ├── TestColliderForGPUParticle.unity │ ├── TestColliderForGPUParticle.unity.meta │ ├── TestGBuffer.unity │ ├── TestGBuffer.unity.meta │ ├── TestRaycast.unity │ ├── TestRaycast.unity.meta │ ├── UTJ.meta │ ├── UTJ │ │ ├── OSD.meta │ │ └── OSD │ │ │ ├── Editor.meta │ │ │ ├── Editor │ │ │ ├── Misc.meta │ │ │ └── Misc │ │ │ │ ├── LayerSelectorDrawer.cs │ │ │ │ └── LayerSelectorDrawer.cs.meta │ │ │ ├── Plugins.meta │ │ │ ├── Plugins │ │ │ ├── x86_64.meta │ │ │ └── x86_64 │ │ │ │ └── osdi.dll.meta │ │ │ ├── Scripts.meta │ │ │ ├── Scripts │ │ │ ├── Misc.meta │ │ │ ├── Misc │ │ │ │ ├── LayerSelector.cs │ │ │ │ └── LayerSelector.cs.meta │ │ │ ├── SubdivisionRenderer.cs │ │ │ └── SubdivisionRenderer.cs.meta │ │ │ └── Shaders.meta │ ├── smcs.rsp │ └── smcs.rsp.meta └── ProjectSettings │ ├── AudioManager.asset │ ├── ClusterInputManager.asset │ ├── DynamicsManager.asset │ ├── EditorBuildSettings.asset │ ├── EditorSettings.asset │ ├── GraphicsSettings.asset │ ├── InputManager.asset │ ├── NavMeshAreas.asset │ ├── NetworkManager.asset │ ├── Physics2DSettings.asset │ ├── ProjectSettings.asset │ ├── ProjectVersion.txt │ ├── QualitySettings.asset │ ├── TagManager.asset │ ├── TimeManager.asset │ ├── UnityAdsSettings.asset │ └── UnityConnectSettings.asset ├── Plugin ├── External │ ├── 7z │ │ └── 7za.exe │ └── libs1.7z ├── osdi.sln ├── osdi.vcxproj ├── osdi.vcxproj.filters └── osdi │ ├── BezierPatch │ ├── BezierPatch.cpp │ ├── BezierPatch.h │ ├── BezierPatchConverter.cpp │ ├── BezierPatchConverter.h │ ├── BezierPatchIntersection.cpp │ └── BezierPatchIntersection.h │ ├── osdi.cpp │ ├── osdi.h │ ├── osuInternal.h │ ├── pch.cpp │ └── pch.h ├── README.md └── setup.bat /.gitignore: -------------------------------------------------------------------------------- 1 | *.obj 2 | *.pch 3 | *.lib 4 | *.exe 5 | *.exp 6 | *.ilk 7 | *.ipch 8 | *.pdb 9 | *.suo 10 | *.sdf 11 | *.opensdf 12 | *.user 13 | *.log 14 | *.tlog 15 | *.db 16 | *.opendb 17 | 18 | *.exe 19 | *.dll 20 | 21 | _out/ 22 | _tmp/ 23 | External/ 24 | Library/ 25 | Temp/ 26 | Build/ 27 | Hidden/ 28 | Hidden.meta 29 | obj/ 30 | OpenSubdivForUnity/*.sln 31 | OpenSubdivForUnity/*.csproj 32 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Examples.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 592c19879b84fd04691d7fb6a8f7c2c3 3 | folderAsset: yes 4 | timeCreated: 1446386849 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Examples/Animations.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 62cdab15015d3ed4b869cc378a08d83d 3 | folderAsset: yes 4 | timeCreated: 1446911288 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Examples/Animations/Raycaster.controller: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/Assets/Examples/Animations/Raycaster.controller -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Examples/Animations/Raycaster.controller.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f91969c58c0412246b4e9e3dcd0080aa 3 | timeCreated: 1446911288 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Examples/Animations/TestRaycaster.anim: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/Assets/Examples/Animations/TestRaycaster.anim -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Examples/Animations/TestRaycaster.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9e8ef0afbf644b24d873747bfc675013 3 | timeCreated: 1446911288 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Examples/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 69590d16623bbc446bca346d1c684c7c 3 | folderAsset: yes 4 | timeCreated: 1446444764 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Examples/Materials/Default.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/Assets/Examples/Materials/Default.mat -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Examples/Materials/Default.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b8f0e9e3d623e7d46a8301d90533d3c6 3 | timeCreated: 1446444773 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Examples/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c5b98eb0a32c1144b8b26e59958c1d30 3 | folderAsset: yes 4 | timeCreated: 1447657046 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Examples/Scripts/BezierPatchRaycaster.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0beaff83ccf762b49ade75d35ae21e0c 3 | timeCreated: 1446818463 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Examples/Shaders.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fdf7bd9b19303ed4ab64eae6d7060a12 3 | folderAsset: yes 4 | timeCreated: 1447700345 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Examples/Shaders/BezierPatchDebug.compute.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e1ebdbf70889f0a429cf4c718f866f4c 3 | timeCreated: 1447698955 4 | licenseType: Pro 5 | ComputeShaderImporter: 6 | currentBuildTarget: -2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e51b98bbd17720f4c9ce25a8ac620493 3 | folderAsset: yes 4 | timeCreated: 1437567576 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BatchRenderer.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0b20c243dc23bed418ccfe19131d3a50 3 | folderAsset: yes 4 | timeCreated: 1437397071 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BatchRenderer/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4f1d71744d0c91c4cb179d1ca1001a2c 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BatchRenderer/Materials/BatchBillboard_Add.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/Assets/Ist/BatchRenderer/Materials/BatchBillboard_Add.mat -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BatchRenderer/Materials/BatchBillboard_Add.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 24ad451f63d398a45a0987e4070ea0ab 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BatchRenderer/Materials/BatchBillboard_AddMultiply.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/Assets/Ist/BatchRenderer/Materials/BatchBillboard_AddMultiply.mat -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BatchRenderer/Materials/BatchBillboard_AddMultiply.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3b2c10db649b5c4498b6c36619c0f2cf 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BatchRenderer/Materials/BatchBillboard_AlphaBlend.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/Assets/Ist/BatchRenderer/Materials/BatchBillboard_AlphaBlend.mat -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BatchRenderer/Materials/BatchBillboard_AlphaBlend.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 612eb5d63f4f8934c95b530aec045774 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BatchRenderer/Materials/BatchStandard.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/Assets/Ist/BatchRenderer/Materials/BatchStandard.mat -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BatchRenderer/Materials/BatchStandard.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cbf8cd41fb019224180acd7fa67fc104 3 | timeCreated: 1427875888 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BatchRenderer/Materials/BatchTransparent_Add.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/Assets/Ist/BatchRenderer/Materials/BatchTransparent_Add.mat -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BatchRenderer/Materials/BatchTransparent_Add.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6b7b6cddb961fff45b3fb65211984de1 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BatchRenderer/Materials/BatchTransparent_AddMultiply.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/Assets/Ist/BatchRenderer/Materials/BatchTransparent_AddMultiply.mat -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BatchRenderer/Materials/BatchTransparent_AddMultiply.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e1704869d684cc3449ae4125c9f3f901 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BatchRenderer/Materials/BatchTransparent_AlphaBlend.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/Assets/Ist/BatchRenderer/Materials/BatchTransparent_AlphaBlend.mat -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BatchRenderer/Materials/BatchTransparent_AlphaBlend.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 978def133119c594a98d11e81d806f45 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BatchRenderer/Materials/ProceduralGBuffer.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/Assets/Ist/BatchRenderer/Materials/ProceduralGBuffer.mat -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BatchRenderer/Materials/ProceduralGBuffer.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 98e7f3c43b05dc449917f683ba55d150 3 | timeCreated: 1434105067 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BatchRenderer/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 40f3627e46894b04ba6d4ef8a7594a7e 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BatchRenderer/Prefabs/BatchRenderer.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/Assets/Ist/BatchRenderer/Prefabs/BatchRenderer.prefab -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BatchRenderer/Prefabs/BatchRenderer.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 32083cf0fe750e7499efae2d53e3b625 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BatchRenderer/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 12b370c6acaedfa48934a6e13e7cfb38 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BatchRenderer/Scripts/BatchRenderer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c7364fb970c67784a82eb707fcc98f38 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BatchRenderer/Scripts/BatchRendererBase.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 39b4d4681501fed45bb2af096b1bbef9 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BatchRenderer/Scripts/BatchRendererUtil.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8d75572ed4a4e7a479a4d2e30123634c 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BatchRenderer/Scripts/CustumDataBatchRenderer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 03584f349cc050a4e94ec30fdda77f79 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BatchRenderer/Scripts/ProceduralGBuffer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 23e83fc8db4f5bd4fa1e65e05d8e2a26 3 | timeCreated: 1434105191 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BatchRenderer/Shaders.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8a373b094463b0e4ea98fac4960cb306 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BatchRenderer/Shaders/BatchRenderer.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d9aac8a12378a4a449ac9070162bd16a 3 | TextScriptImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BatchRenderer/Shaders/Billboard.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 955c9fc334f2e7d4e9e8cb7a7be5261d 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BatchRenderer/Shaders/Billboard.shader: -------------------------------------------------------------------------------- 1 | Shader "BatchRenderer/Billboard" { 2 | Properties { 3 | [Enum(UnityEngine.Rendering.BlendMode)] _SrcBlend("Src Blend", Int) = 5 4 | [Enum(UnityEngine.Rendering.BlendMode)] _DstBlend("Dst Blend", Int) = 10 5 | 6 | _MainTex ("Texture", 2D) = "white" {} 7 | g_base_color ("Base Color", Color) = (1,1,1,1) 8 | } 9 | 10 | Category { 11 | Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } 12 | Blend[_SrcBlend][_DstBlend] 13 | AlphaTest Greater .01 14 | ColorMask RGB 15 | Cull Off Lighting Off ZWrite Off Fog { Color (0,0,0,0) } 16 | 17 | SubShader { 18 | Pass { 19 | CGPROGRAM 20 | #pragma target 3.0 21 | 22 | #pragma vertex vert 23 | #pragma fragment frag 24 | #pragma multi_compile ___ ENABLE_INSTANCE_BUFFER 25 | #pragma multi_compile ___ ENABLE_INSTANCE_ROTATION 26 | #pragma multi_compile ___ ENABLE_INSTANCE_SCALE 27 | #pragma multi_compile ___ ENABLE_INSTANCE_EMISSION 28 | #pragma multi_compile ___ ENABLE_INSTANCE_COLOR 29 | #pragma multi_compile ___ ENABLE_INSTANCE_UVOFFSET 30 | 31 | #define BR_BILLBOARD 32 | #include "Billboard.cginc" 33 | ENDCG 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BatchRenderer/Shaders/Billboard.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 04e56a9460558df439870df0fb4845f1 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BatchRenderer/Shaders/FixedBillboard.shader: -------------------------------------------------------------------------------- 1 | Shader "BatchRenderer/FixedBillboard" { 2 | Properties { 3 | [Enum(UnityEngine.Rendering.BlendMode)] _SrcBlend("Src Blend", Int) = 5 4 | [Enum(UnityEngine.Rendering.BlendMode)] _DstBlend("Dst Blend", Int) = 10 5 | 6 | _MainTex ("Texture", 2D) = "white" {} 7 | g_base_color ("Base Color", Color) = (1,1,1,1) 8 | } 9 | 10 | Category { 11 | Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } 12 | Blend[_SrcBlend][_DstBlend] 13 | AlphaTest Greater .01 14 | ColorMask RGB 15 | Cull Off Lighting Off ZWrite Off ZTest Less Fog { Color (0,0,0,0) } 16 | 17 | SubShader { 18 | Pass { 19 | CGPROGRAM 20 | #pragma target 3.0 21 | #pragma vertex vert 22 | #pragma fragment frag 23 | #pragma multi_compile ___ ENABLE_INSTANCE_BUFFER 24 | #pragma multi_compile ___ ENABLE_INSTANCE_ROTATION 25 | #pragma multi_compile ___ ENABLE_INSTANCE_SCALE 26 | #pragma multi_compile ___ ENABLE_INSTANCE_EMISSION 27 | #pragma multi_compile ___ ENABLE_INSTANCE_COLOR 28 | #pragma multi_compile ___ ENABLE_INSTANCE_UVOFFSET 29 | 30 | #define BR_FIXED_BILLBOARD 31 | #include "Billboard.cginc" 32 | ENDCG 33 | } 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BatchRenderer/Shaders/FixedBillboard.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cd369f8f291e03a438d6d2310e54695d 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BatchRenderer/Shaders/ProceduralGBuffer.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: acec53e1dd1d5ff468f81e4fbdc2cb95 3 | timeCreated: 1434102360 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BatchRenderer/Shaders/Standard.shader: -------------------------------------------------------------------------------- 1 | Shader "BatchRenderer/Standard" { 2 | Properties { 3 | _Color ("Color", Color) = (1,1,1,1) 4 | _MainTex ("Albedo (RGB)", 2D) = "white" {} 5 | _Glossiness ("Smoothness", Range(0,1)) = 0.5 6 | _Metallic("Metallic", Range(0,1)) = 0.0 7 | _Emission("Emission", Color) = (0,0,0,0) 8 | } 9 | SubShader { 10 | Tags { "RenderType"="Opaque" "Queue"="Geometry+1" } 11 | 12 | CGPROGRAM 13 | #pragma target 3.0 14 | #pragma surface surf Standard fullforwardshadows vertex:vert addshadow 15 | #pragma multi_compile ___ ENABLE_INSTANCE_BUFFER 16 | #pragma multi_compile ___ ENABLE_INSTANCE_ROTATION 17 | #pragma multi_compile ___ ENABLE_INSTANCE_SCALE 18 | #pragma multi_compile ___ ENABLE_INSTANCE_EMISSION 19 | #pragma multi_compile ___ ENABLE_INSTANCE_UVOFFSET 20 | #pragma multi_compile ___ ENABLE_INSTANCE_COLOR 21 | 22 | 23 | #define BR_STANDARD 24 | #include "Surface.cginc" 25 | ENDCG 26 | } 27 | 28 | FallBack Off 29 | } 30 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BatchRenderer/Shaders/Standard.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1fca54bead074bd4d966701799f0a132 3 | timeCreated: 1427875482 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BatchRenderer/Shaders/Surface.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6ed1b9e7c5257ee4ea150ea0eb5e5799 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BatchRenderer/Shaders/Transparent.cginc: -------------------------------------------------------------------------------- 1 | #ifndef BRTransparent_h 2 | #define BRTransparent_h 3 | 4 | #include "UnityCG.cginc" 5 | #include "Assets/Ist/BatchRenderer/Shaders/BatchRenderer.cginc" 6 | 7 | 8 | void ApplyInstanceTransformSimplified(float2 id, inout float4 vertex, inout float2 texcoord, inout float4 color) 9 | { 10 | int instance_id = GetBatchBegin() + id.x; 11 | if(instance_id >= GetNumInstances()) { 12 | vertex.xyz *= 0.0; 13 | return; 14 | } 15 | 16 | vertex.xyz *= GetBaseScale(); 17 | #if ENABLE_INSTANCE_SCALE 18 | { 19 | vertex.xyz *= GetInstanceScale(instance_id); 20 | } 21 | #endif 22 | #if ENABLE_INSTANCE_ROTATION 23 | { 24 | float3x3 rot = QuaternionToMatrix33(GetInstanceRotation(instance_id)); 25 | vertex.xyz = mul(rot, vertex.xyz); 26 | } 27 | #endif 28 | vertex.xyz += GetInstanceTranslation(instance_id); 29 | vertex = mul(UNITY_MATRIX_VP, vertex); 30 | 31 | #if ENABLE_INSTANCE_UVOFFSET 32 | { 33 | float4 u = GetInstanceUVOffset(instance_id); 34 | texcoord = texcoord*u.xy + u.zw; 35 | } 36 | #endif 37 | #if ENABLE_INSTANCE_COLOR 38 | { 39 | color *= GetInstanceColor(instance_id); 40 | } 41 | #endif 42 | } 43 | 44 | 45 | #ifdef BR_TRANSPARENT 46 | sampler2D _MainTex; 47 | float4 g_base_color; 48 | 49 | struct appdata_t { 50 | float4 vertex : POSITION; 51 | float2 texcoord : TEXCOORD0; 52 | float2 texcoord1 : TEXCOORD1; 53 | }; 54 | 55 | struct v2f { 56 | float4 vertex : SV_POSITION; 57 | float2 texcoord : TEXCOORD0; 58 | float4 color : TEXCOORD1; 59 | }; 60 | 61 | v2f vert(appdata_t v) 62 | { 63 | float4 color = g_base_color; 64 | ApplyInstanceTransformSimplified(v.texcoord1, v.vertex, v.texcoord, color); 65 | 66 | v2f o; 67 | o.vertex = v.vertex; 68 | o.texcoord = v.texcoord; 69 | o.color = color; 70 | return o; 71 | } 72 | 73 | float4 frag(v2f i) : SV_Target 74 | { 75 | float4 color = tex2D(_MainTex, i.texcoord) * i.color; 76 | return color; 77 | } 78 | #endif // BR_TRANSPARENT 79 | 80 | #endif // BRTransparent_h 81 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BatchRenderer/Shaders/Transparent.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 963ae562426bb4c4ca138036dbadd28c 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BatchRenderer/Shaders/Transparent.shader: -------------------------------------------------------------------------------- 1 | Shader "BatchRenderer/Transparent" { 2 | Properties { 3 | [Enum(UnityEngine.Rendering.BlendMode)] _SrcBlend("Src Blend", Int) = 5 4 | [Enum(UnityEngine.Rendering.BlendMode)] _DstBlend("Dst Blend", Int) = 10 5 | 6 | _MainTex ("Texture", 2D) = "white" {} 7 | g_base_color ("Base Color", Color) = (1,1,1,1) 8 | } 9 | 10 | Category { 11 | Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } 12 | Blend[_SrcBlend][_DstBlend] 13 | AlphaTest Greater .01 14 | ColorMask RGB 15 | Cull Off Lighting Off ZWrite Off Fog { Color (0,0,0,0) } 16 | 17 | SubShader { 18 | Pass { 19 | CGPROGRAM 20 | #pragma target 3.0 21 | #pragma vertex vert 22 | #pragma fragment frag 23 | #pragma multi_compile ___ ENABLE_INSTANCE_BUFFER 24 | #pragma multi_compile ___ ENABLE_INSTANCE_ROTATION 25 | #pragma multi_compile ___ ENABLE_INSTANCE_SCALE 26 | #pragma multi_compile ___ ENABLE_INSTANCE_EMISSION 27 | #pragma multi_compile ___ ENABLE_INSTANCE_COLOR 28 | #pragma multi_compile ___ ENABLE_INSTANCE_UVOFFSET 29 | 30 | #define BR_TRANSPARENT 31 | #include "Transparent.cginc" 32 | ENDCG 33 | } 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BatchRenderer/Shaders/Transparent.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 93e6ef5fff430144db36f51aa8808d72 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BezierPatch.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4676c31a569f7294da0515bdca977c02 3 | folderAsset: yes 4 | timeCreated: 1446337907 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BezierPatch/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 47a4c2b4c31c3b846a8847208b82d982 3 | folderAsset: yes 4 | timeCreated: 1447065363 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BezierPatch/Editor/BezierPatchEditorEditor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEditor; 3 | using UnityEngine; 4 | 5 | namespace Ist 6 | { 7 | 8 | [CustomEditor(typeof(BezierPatchEditor))] 9 | public class BezierPatchEditorEditor : Editor 10 | { 11 | private void OnEnable() 12 | { 13 | } 14 | 15 | 16 | public override void OnInspectorGUI() 17 | { 18 | DrawDefaultInspector(); 19 | 20 | //if (GUILayout.Button("Generate Mesh")) 21 | //{ 22 | // var t = target as BezierPatchEditor; 23 | // t.GenerateMesh(); 24 | //} 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BezierPatch/Editor/BezierPatchEditorEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0a8da01b0de091c4d8abcefbd71b5583 3 | timeCreated: 1446441894 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BezierPatch/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cdcdb98d907649d449db5e26a5d9b7e7 3 | folderAsset: yes 4 | timeCreated: 1447680644 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BezierPatch/Materials/BezierPatchRaytracer.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/Assets/Ist/BezierPatch/Materials/BezierPatchRaytracer.mat -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BezierPatch/Materials/BezierPatchRaytracer.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5cb9ef8e1ef3db3498fa4acde1b5f69b 3 | timeCreated: 1447680659 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BezierPatch/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6fa528fc64df0394b8ed2e2fa1c0e594 3 | folderAsset: yes 4 | timeCreated: 1446361119 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/BezierPatch/Scripts/BezierPatchContainer.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | #if UNITY_EDITOR 3 | using UnityEditor; 4 | #endif 5 | 6 | 7 | namespace Ist 8 | { 9 | class BezierPatchContainer : IBezierPatchContainer 10 | { 11 | BezierPatchRaw[] m_bpatch_src; 12 | BezierPatchRaw[] m_bpatch; 13 | BezierPatchAABB[] m_aabbs; 14 | bool m_dirty; 15 | 16 | void UpdateBezierPatch() 17 | { 18 | if (!m_dirty || m_bpatch_src == null) { return; } 19 | if (m_bpatch == null) 20 | { 21 | m_bpatch = new BezierPatchRaw[m_bpatch_src.Length]; 22 | m_aabbs = new BezierPatchAABB[m_bpatch_src.Length]; 23 | } 24 | 25 | var trans = GetComponent().localToWorldMatrix; 26 | for(int i=0; i : MonoBehaviour where T : MonoBehaviour 6 | { 7 | private static T s_instance; 8 | 9 | public static T GetInstance() 10 | { 11 | if (s_instance == null) 12 | { 13 | s_instance = FindObjectOfType(); 14 | 15 | if (FindObjectsOfType().Length > 1) 16 | { 17 | Debug.LogError("[Singleton] Something went really wrong " + 18 | " - there should never be more than 1 singleton!" + 19 | " Reopening the scene might fix it."); 20 | return s_instance; 21 | } 22 | 23 | if (s_instance == null) 24 | { 25 | GameObject singleton = new GameObject(); 26 | s_instance = singleton.AddComponent(); 27 | singleton.name = "[Singleton] " + typeof(T).ToString(); 28 | 29 | DontDestroyOnLoad(singleton); 30 | 31 | Debug.Log("[Singleton] An instance of " + typeof(T) + 32 | " is needed in the scene, so '" + singleton + 33 | "' was created with DontDestroyOnLoad."); 34 | } 35 | else 36 | { 37 | Debug.Log("[Singleton] Using instance already created: " + 38 | s_instance.gameObject.name); 39 | } 40 | } 41 | 42 | return s_instance; 43 | } 44 | 45 | public virtual void OnDestroy() 46 | { 47 | if (s_instance == this) 48 | { 49 | s_instance = null; 50 | } 51 | } 52 | } 53 | } -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Foundation/Scripts/Singleton.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 98ab6e0d8c5a7894899e68e83214c8f4 3 | timeCreated: 1437668094 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Foundation/Shaders.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3cbb25a5cd95f0c4b9bc5d53a7b0c55d 3 | folderAsset: yes 4 | timeCreated: 1446124760 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Foundation/Shaders/BezierPatch.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0f4f383722a3ced4c9354507c39154a7 3 | timeCreated: 1446975681 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Foundation/Shaders/BezierPatch.glslinc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d2c47bdd97c82cf42a7d4cea3f774bca 3 | timeCreated: 1447655754 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Foundation/Shaders/BezierPatchIntersection.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 81e748cc7ad7dd44c991f90fd285d45c 3 | timeCreated: 1446975681 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Foundation/Shaders/BuiltinVariablesExt.cginc: -------------------------------------------------------------------------------- 1 | #ifndef IstBuiltinVariablesExt_h 2 | #define IstBuiltinVariablesExt_h 3 | 4 | float3 GetObjectPosition() { return float3(unity_ObjectToWorld[0][3], unity_ObjectToWorld[1][3], unity_ObjectToWorld[2][3]); } 5 | float3 GetObjectForward() { return normalize(-unity_ObjectToWorld[2].xyz); } 6 | float3 GetObjectUp() { return normalize(unity_ObjectToWorld[1].xyz); } 7 | float3 GetObjectRight() { return normalize(unity_ObjectToWorld[0].xyz); } 8 | 9 | float3 GetCameraPosition() { return _WorldSpaceCameraPos; } 10 | float3 GetCameraForward() { return -UNITY_MATRIX_V[2].xyz; } 11 | float3 GetCameraUp() { return UNITY_MATRIX_V[1].xyz; } 12 | float3 GetCameraRight() { return UNITY_MATRIX_V[0].xyz; } 13 | float GetCameraFocalLength() { return abs(UNITY_MATRIX_P[1][1]); } 14 | 15 | float2 GetScreenSize() { return _ScreenParams.xy; } 16 | float2 GetPixelSize() { return _ScreenParams.zw - 1.0; } 17 | float GetAspectRatio() { return _ScreenParams.x / _ScreenParams.y; } 18 | 19 | // screen_pos.x must be multiplies by aspect ratio 20 | Ray GetCameraRay(float2 screen_pos) 21 | { 22 | float3 cam_pos = GetCameraPosition(); 23 | float3 cam_forward = GetCameraForward(); 24 | float3 cam_up = GetCameraUp(); 25 | float3 cam_right = GetCameraRight(); 26 | float cam_focal_len= GetCameraFocalLength(); 27 | float3 cam_ray = normalize(cam_right*screen_pos.x + cam_up*screen_pos.y + cam_forward*cam_focal_len); 28 | Ray r = { _WorldSpaceCameraPos.xyz , cam_ray }; 29 | return r; 30 | } 31 | 32 | // screen_pos.x must be multiplies by aspect ratio 33 | float3 IntersectionEyeViewPlane(float2 screen_pos, float3 plane_pos) 34 | { 35 | float3 camera_dir = normalize(_WorldSpaceCameraPos.xyz - plane_pos); 36 | Plane plane = { camera_dir, dot(plane_pos, -camera_dir) }; 37 | Ray ray = GetCameraRay(screen_pos); 38 | return IntersectionRayPlane(ray, plane); 39 | } 40 | 41 | float3 IntersectionEyeViewPlane(float3 world_pos, float3 plane_pos) 42 | { 43 | float3 camera_dir = normalize(_WorldSpaceCameraPos.xyz - plane_pos); 44 | Plane plane = { camera_dir, dot(plane_pos, -camera_dir) }; 45 | Ray ray = { _WorldSpaceCameraPos.xyz , normalize(world_pos-_WorldSpaceCameraPos.xyz)}; 46 | return IntersectionRayPlane(ray, plane); 47 | } 48 | 49 | #endif // IstBuiltinVariablesExt_h 50 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Foundation/Shaders/BuiltinVariablesExt.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7730490f5d8f98c4abeeb4240b17495b 3 | timeCreated: 1439266662 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Foundation/Shaders/DoNothing.shader: -------------------------------------------------------------------------------- 1 | Shader "Ist/DoNothing" { 2 | CGINCLUDE 3 | struct ia_out 4 | { 5 | float4 vertex : POSITION; 6 | }; 7 | 8 | struct vs_out 9 | { 10 | float4 vertex : SV_POSITION; 11 | }; 12 | 13 | struct ps_out 14 | { 15 | float4 color : SV_Target; 16 | }; 17 | 18 | 19 | vs_out vert(ia_out I) 20 | { 21 | vs_out O; 22 | O.vertex = float4(0.0, 0.0, 0.0, 1.0); 23 | return O; 24 | } 25 | 26 | ps_out frag(vs_out I) 27 | { 28 | ps_out O; 29 | O.color = 0.0; 30 | return O; 31 | } 32 | ENDCG 33 | 34 | SubShader { 35 | Tags{ "RenderType" = "Opaque" "DisableBatching" = "True" "Queue" = "Geometry+10" } 36 | Cull Off 37 | 38 | Pass { 39 | Tags { "LightMode" = "Deferred" } 40 | ColorMask 0 41 | ZWrite Off 42 | CGPROGRAM 43 | #pragma vertex vert 44 | #pragma fragment frag 45 | ENDCG 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Foundation/Shaders/DoNothing.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1af8b4866e61138469e3fc10eb40c0a7 3 | timeCreated: 1447681231 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Foundation/Shaders/Geometry.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3c64d14791af6b14c8eed71710f585d3 3 | timeCreated: 1428486001 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Foundation/Shaders/Math.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 86dea7de223407f4483ae834b514fa7d 3 | timeCreated: 1428485712 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Foundation/Shaders/Random.cginc: -------------------------------------------------------------------------------- 1 | #ifndef IstRandom_h 2 | #define IstRandom_h 3 | 4 | float iq_rand(float p) 5 | { 6 | return frac(sin(p)*43758.5453); 7 | } 8 | float2 iq_rand(float2 p) 9 | { 10 | p = float2(dot(p, float2(127.1, 311.7)), dot(p, float2(269.5, 183.3))); 11 | return frac(sin(p)*43758.5453); 12 | } 13 | float3 iq_rand(float3 p) 14 | { 15 | p = float3(dot(p, float3(127.1, 311.7, 311.7)), dot(p, float3(269.5, 183.3, 183.3)), dot(p, float3(269.5, 183.3, 183.3))); 16 | return frac(sin(p)*43758.5453); 17 | } 18 | 19 | 20 | /* 21 | thanks to T.Hachisuka: 22 | http://www.ci.i.u-tokyo.ac.jp/~hachisuka/tdf2015.pdf 23 | 24 | example: 25 | 26 | void Test() 27 | { 28 | float4 state = _Time.y; // initialize state 29 | for(int i=0; i 13 | { 14 | public Material[] m_materials_depth; 15 | 16 | #if UNITY_EDITOR 17 | void Reset() 18 | { 19 | var mat = AssetDatabase.LoadAssetAtPath("Assets/Ist/GBufferUtils/Materials/Depth.mat"); 20 | int num_materials = GetComponent().sharedMaterials.Length; 21 | m_materials_depth = new Material[num_materials]; 22 | for (int i = 0; i < m_materials_depth.Length; ++i) 23 | { 24 | m_materials_depth[i] = mat; 25 | } 26 | } 27 | #endif // UNITY_EDITOR 28 | 29 | public virtual void IssueDrawCall_FrontDepth(CommandBuffer commands) 30 | { 31 | var renderer = GetComponent(); 32 | for (int i = 0; i < m_materials_depth.Length; ++i) 33 | { 34 | commands.DrawRenderer(renderer, m_materials_depth[i], i, 1); 35 | } 36 | } 37 | 38 | public virtual void IssueDrawCall_BackDepth(CommandBuffer commands) 39 | { 40 | var renderer = GetComponent(); 41 | for (int i = 0; i < m_materials_depth.Length; ++i) 42 | { 43 | commands.DrawRenderer(renderer, m_materials_depth[i], i, 0); 44 | } 45 | } 46 | 47 | 48 | protected override void AddCommandBuffer(Camera c, CommandBuffer cb) 49 | { 50 | c.AddCommandBuffer(CameraEvent.AfterGBuffer, cb); 51 | } 52 | 53 | protected override void RemoveCommandBuffer(Camera c, CommandBuffer cb) 54 | { 55 | c.RemoveCommandBuffer(CameraEvent.AfterGBuffer, cb); 56 | } 57 | 58 | // subclass should implement UpdateCommandBuffer() 59 | } 60 | 61 | } -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/GBufferUtils/Scripts/DepthDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2cb6b20f55f8765449eab3502e9ed9b1 3 | timeCreated: 1437337824 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/GBufferUtils/Scripts/EmissionDrawer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.Rendering; 5 | #if UNITY_EDITOR 6 | using UnityEditor; 7 | #endif // UNITY_EDITOR 8 | 9 | namespace Ist 10 | { 11 | 12 | [RequireComponent(typeof(Renderer))] 13 | [ExecuteInEditMode] 14 | public class EmissionDrawer : ICommandBufferExecuter 15 | { 16 | public Material[] m_materials; 17 | 18 | #if UNITY_EDITOR 19 | void Reset() 20 | { 21 | var mat = AssetDatabase.LoadAssetAtPath("Assets/Ist/GBufferUtils/Materials/Depth.mat"); 22 | int num_materials = GetComponent().sharedMaterials.Length; 23 | m_materials = new Material[num_materials]; 24 | for (int i = 0; i < m_materials.Length; ++i) 25 | { 26 | m_materials[i] = mat; 27 | } 28 | } 29 | #endif // UNITY_EDITOR 30 | 31 | public void IssueDrawCall(CommandBuffer commands) 32 | { 33 | if (!gameObject.activeInHierarchy && !enabled) { return; } 34 | 35 | var renderer = GetComponent(); 36 | for (int i = 0; i < m_materials.Length; ++i) 37 | { 38 | commands.DrawRenderer(renderer, m_materials[i], i, 0); 39 | } 40 | } 41 | 42 | protected override void AddCommandBuffer(Camera c, CommandBuffer cb) 43 | { 44 | c.AddCommandBuffer(CameraEvent.AfterGBuffer, cb); 45 | } 46 | 47 | protected override void RemoveCommandBuffer(Camera c, CommandBuffer cb) 48 | { 49 | c.RemoveCommandBuffer(CameraEvent.AfterGBuffer, cb); 50 | } 51 | 52 | protected override void UpdateCommandBuffer(CommandBuffer commands) 53 | { 54 | commands.Clear(); 55 | 56 | if (Camera.current.hdr) 57 | { 58 | commands.SetRenderTarget(BuiltinRenderTextureType.CameraTarget); 59 | } 60 | else 61 | { 62 | commands.SetRenderTarget(BuiltinRenderTextureType.GBuffer3); 63 | } 64 | 65 | foreach (var i in GetInstances()) { i.IssueDrawCall(commands); } 66 | } 67 | } 68 | 69 | } -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/GBufferUtils/Scripts/EmissionDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7c24ef9530d127748b764428b2597da9 3 | timeCreated: 1437378263 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/GBufferUtils/Scripts/GBufferUtils.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e37363ba44f77df45aae82af81e8c9da 3 | timeCreated: 1436874046 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/GBufferUtils/Scripts/MaterialSettings.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.Rendering; 5 | #if UNITY_EDITOR 6 | using UnityEditor; 7 | #endif // UNITY_EDITOR 8 | 9 | [AddComponentMenu("Ist/Material Settings")] 10 | [ExecuteInEditMode] 11 | public class MaterialSettings : MonoBehaviour 12 | { 13 | [System.Serializable] 14 | public class StringBoolPair 15 | { 16 | public string key; 17 | public bool value; 18 | } 19 | 20 | [System.Serializable] 21 | public class StringFloatPair 22 | { 23 | public string key; 24 | public float value; 25 | } 26 | 27 | [System.Serializable] 28 | public class MaterialSetting 29 | { 30 | public Material material; 31 | public List keyworkds = new List(); 32 | public List fparams = new List(); 33 | } 34 | 35 | public bool m_assign_on_update; 36 | public List m_settings = new List(); 37 | 38 | 39 | public void AssignParams() 40 | { 41 | for (int i = 0; i < m_settings.Count; ++i) 42 | { 43 | AssignParams(m_settings[i]); 44 | } 45 | } 46 | 47 | public MaterialSetting FindSetting(string material_name) 48 | { 49 | return m_settings.Find((a) => { return a.material.name == material_name; }); 50 | } 51 | 52 | void AssignParams(MaterialSetting setting) 53 | { 54 | var mat = setting.material; 55 | var keywords = setting.keyworkds; 56 | var fparams = setting.fparams; 57 | 58 | for (int i = 0; i < keywords.Count; ++i) 59 | { 60 | if (keywords[i].value) 61 | { 62 | mat.EnableKeyword(keywords[i].key); 63 | } 64 | else 65 | { 66 | mat.DisableKeyword(keywords[i].key); 67 | 68 | } 69 | //Debug.Log(mat.name + " " + keywords[i].key + " " + mat.IsKeywordEnabled(keywords[i].key)); 70 | } 71 | 72 | for (int i = 0; i < fparams.Count; ++i) 73 | { 74 | mat.SetFloat(fparams[i].key, fparams[i].value); 75 | } 76 | } 77 | 78 | 79 | public virtual void Awake() 80 | { 81 | AssignParams(); 82 | } 83 | 84 | public virtual void LateUpdate() 85 | { 86 | if(m_assign_on_update) 87 | { 88 | AssignParams(); 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/GBufferUtils/Scripts/MaterialSettings.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dfd3e72410edb4e4eb2f496da3e7b080 3 | timeCreated: 1439406270 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/GBufferUtils/Scripts/ShaderParams.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.Rendering; 5 | #if UNITY_EDITOR 6 | using UnityEditor; 7 | #endif // UNITY_EDITOR 8 | 9 | [AddComponentMenu("Ist/Shader Params")] 10 | [RequireComponent(typeof(Renderer))] 11 | [ExecuteInEditMode] 12 | public class ShaderParams : MonoBehaviour 13 | { 14 | [System.Serializable] 15 | public class StringBoolPair 16 | { 17 | public string key; 18 | public bool value; 19 | } 20 | 21 | [System.Serializable] 22 | public class StringFloatPair 23 | { 24 | public string key; 25 | public float value; 26 | } 27 | 28 | static uint s_idgen; 29 | 30 | public bool m_debug_log = false; 31 | public bool m_use_root_position = false; 32 | public bool m_use_root_rotation = false; 33 | public bool m_use_root_scale = false; 34 | public float m_local_time; 35 | public List m_fparams = new List(); 36 | 37 | uint m_id; 38 | MaterialPropertyBlock m_mpb; 39 | 40 | public void AssignParams() 41 | { 42 | var renderer = GetComponent(); 43 | var trans = GetComponent(); 44 | 45 | if (m_mpb == null) 46 | { 47 | m_mpb = new MaterialPropertyBlock(); 48 | m_mpb.SetFloat("_ObjectID", m_id); 49 | } 50 | 51 | var pos = m_use_root_position ? trans.root.position : trans.position; 52 | var rot = m_use_root_rotation ? trans.root.rotation : trans.rotation; 53 | var scale = m_use_root_scale ? trans.root.lossyScale : trans.lossyScale; 54 | if(m_debug_log) 55 | { 56 | Debug.Log("pos: " + pos); 57 | Debug.Log("rot: " + rot); 58 | Debug.Log("scale: " + scale); 59 | } 60 | m_mpb.SetVector("_Position", pos); 61 | m_mpb.SetVector("_Rotation", new Vector4(rot.x, rot.y, rot.z, rot.w)); 62 | m_mpb.SetVector("_Scale", scale); 63 | m_mpb.SetFloat("_LocalTime", m_local_time); 64 | for (int i = 0; i < m_fparams.Count; ++i) 65 | { 66 | m_mpb.SetFloat(m_fparams[i].key, m_fparams[i].value); 67 | } 68 | renderer.SetPropertyBlock(m_mpb); 69 | } 70 | 71 | 72 | public virtual void LateUpdate() 73 | { 74 | if(m_id==0) 75 | { 76 | m_id = ++s_idgen; 77 | } 78 | m_local_time += Time.deltaTime; 79 | 80 | AssignParams(); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/GBufferUtils/Scripts/ShaderParams.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1b53a4580aab4ef41b54d1b675f1c961 3 | timeCreated: 1438195059 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/GBufferUtils/Scripts/VelocityDrawer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.Rendering; 5 | #if UNITY_EDITOR 6 | using UnityEditor; 7 | #endif // UNITY_EDITOR 8 | 9 | namespace Ist 10 | { 11 | [RequireComponent(typeof(Renderer))] 12 | public abstract class VelocityDrawer : ICommandBufferExecuter 13 | { 14 | public Material[] m_materials; 15 | 16 | #if UNITY_EDITOR 17 | void Reset() 18 | { 19 | var mat = AssetDatabase.LoadAssetAtPath("Assets/Ist/GBufferUtils/Materials/Velocity.mat"); 20 | int num_materials = GetComponent().sharedMaterials.Length; 21 | m_materials = new Material[num_materials]; 22 | for (int i = 0; i < m_materials.Length; ++i) 23 | { 24 | m_materials[i] = mat; 25 | } 26 | } 27 | #endif // UNITY_EDITOR 28 | 29 | void Start() 30 | { 31 | } 32 | 33 | void Update() 34 | { 35 | } 36 | 37 | public override void OnWillRenderObject() 38 | { 39 | base.OnWillRenderObject(); 40 | 41 | var cb = GetCommandBuffer(); 42 | var renderer = GetComponent(); 43 | for (int i = 0; i < m_materials.Length; ++i) 44 | { 45 | cb.DrawRenderer(renderer, m_materials[i], i, 0); 46 | } 47 | } 48 | 49 | 50 | protected override void AddCommandBuffer(Camera c, CommandBuffer cb) 51 | { 52 | c.AddCommandBuffer(CameraEvent.AfterGBuffer, cb); 53 | } 54 | 55 | protected override void RemoveCommandBuffer(Camera c, CommandBuffer cb) 56 | { 57 | c.RemoveCommandBuffer(CameraEvent.AfterGBuffer, cb); 58 | } 59 | 60 | protected override void UpdateCommandBuffer(CommandBuffer cb) 61 | { 62 | cb.Clear(); 63 | } 64 | } 65 | 66 | } -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/GBufferUtils/Scripts/VelocityDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5df0ab73389e4ff418574351f9d759a1 3 | timeCreated: 1442141869 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/GBufferUtils/Shaders.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6a7807f77fe77824c9e9f91a2505cd84 3 | folderAsset: yes 4 | timeCreated: 1436492855 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/GBufferUtils/Shaders/Depth.shader: -------------------------------------------------------------------------------- 1 | Shader "Ist/GbufferUtils/Depth" 2 | { 3 | 4 | SubShader 5 | { 6 | CGINCLUDE 7 | #include "UnityCG.cginc" 8 | 9 | float ComputeDepth(float4 clippos) 10 | { 11 | #if defined(SHADER_TARGET_GLSL) || defined(SHADER_API_GLES) || defined(SHADER_API_GLES3) 12 | return (clippos.z / clippos.w) * 0.5 + 0.5; 13 | #else 14 | return clippos.z / clippos.w; 15 | #endif 16 | } 17 | 18 | 19 | struct ia_out 20 | { 21 | float4 vertex : POSITION; 22 | }; 23 | 24 | struct vs_out 25 | { 26 | float4 vertex : SV_POSITION; 27 | float4 screen_pos : TEXCOORD0; 28 | }; 29 | 30 | struct ps_out 31 | { 32 | float4 color : SV_Target; 33 | }; 34 | 35 | 36 | vs_out vert(ia_out v) 37 | { 38 | vs_out o; 39 | o.vertex = UnityObjectToClipPos(v.vertex); 40 | o.screen_pos = ComputeScreenPos(o.vertex); 41 | return o; 42 | } 43 | 44 | ps_out frag(vs_out i) 45 | { 46 | ps_out r; 47 | r.color = ComputeDepth(i.screen_pos); 48 | return r; 49 | } 50 | ENDCG 51 | 52 | // back 53 | Pass { 54 | Cull Front 55 | ZTest Greater 56 | ZWrite On 57 | 58 | CGPROGRAM 59 | #pragma vertex vert 60 | #pragma fragment frag 61 | ENDCG 62 | } 63 | 64 | // front 65 | Pass { 66 | Cull Back 67 | ZTest Less 68 | ZWrite On 69 | 70 | CGPROGRAM 71 | #pragma vertex vert 72 | #pragma fragment frag 73 | ENDCG 74 | } 75 | 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/GBufferUtils/Shaders/Depth.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c0ba72b943c5c204a969aa0120b91b66 3 | timeCreated: 1437336360 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/GBufferUtils/Shaders/DepthToVelocity.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: df14687b098aebb4299eeda4cea45561 3 | timeCreated: 1442221830 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/GBufferUtils/Shaders/GBufferCopy.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 19d36fee37535374b8850c4e1e5bf214 3 | timeCreated: 1436616687 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/GBufferUtils/Shaders/GBufferUtils.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0a5e9f32c0d83dc40a884149c9f85b0e 3 | timeCreated: 1436245957 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/GBufferUtils/Shaders/SimpleTexture.shader: -------------------------------------------------------------------------------- 1 | Shader "Ist/GbufferUtils/SimpleTexture" 2 | { 3 | Properties { 4 | _MainTex("Color", 2D) = "white" {} 5 | _ColorToAdd ("Color To Add", Color) = (0,0,0) 6 | _ColorToMultiply ("Color To Multiply", Color) = (1,1,1) 7 | } 8 | 9 | SubShader 10 | { 11 | CGINCLUDE 12 | 13 | sampler2D _MainTex; 14 | float4 _ColorToAdd; 15 | float4 _ColorToMultiply; 16 | 17 | struct ia_out 18 | { 19 | float4 vertex : POSITION; 20 | float4 texcoord : TEXCOORD0; 21 | }; 22 | 23 | struct vs_out 24 | { 25 | float4 vertex : SV_POSITION; 26 | float4 texcoord : TEXCOORD0; 27 | }; 28 | 29 | struct ps_out 30 | { 31 | float4 color : SV_Target; 32 | }; 33 | 34 | 35 | vs_out vert(ia_out v) 36 | { 37 | vs_out o; 38 | o.vertex = UnityObjectToClipPos(v.vertex); 39 | o.texcoord = v.texcoord; 40 | return o; 41 | } 42 | 43 | ps_out frag(vs_out i) 44 | { 45 | ps_out r; 46 | r.color = tex2D(_MainTex, i.texcoord) * _ColorToMultiply + _ColorToAdd; 47 | return r; 48 | } 49 | ENDCG 50 | 51 | Pass { 52 | Cull Back 53 | ZTest LEqual 54 | ZWrite Off 55 | 56 | CGPROGRAM 57 | #pragma vertex vert 58 | #pragma fragment frag 59 | ENDCG 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/GBufferUtils/Shaders/SimpleTexture.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6447ce0474fc5924e824985253849d67 3 | timeCreated: 1437380947 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/GBufferUtils/Shaders/Velocity.shader: -------------------------------------------------------------------------------- 1 | Shader "Ist/GbufferUtils/Velocity" 2 | { 3 | 4 | 5 | SubShader 6 | { 7 | CGINCLUDE 8 | #include "UnityCG.cginc" 9 | #include "Assets/Ist/GBufferUtils/Shaders/GBufferUtils.cginc" 10 | 11 | //float4x4 _PrevViewProj; 12 | float4x4 _PrevObject2World; 13 | 14 | 15 | struct ia_out 16 | { 17 | float4 vertex : POSITION; 18 | }; 19 | 20 | struct vs_out 21 | { 22 | float4 vertex : SV_POSITION; 23 | float4 screen_pos : TEXCOORD0; 24 | float4 prev_screen_pos : TEXCOORD1; 25 | }; 26 | 27 | 28 | vs_out vert(ia_out v) 29 | { 30 | vs_out o; 31 | o.vertex = UnityObjectToClipPos(v.vertex); 32 | o.screen_pos = ComputeScreenPos(o.vertex); 33 | 34 | float4x4 prev_mvp = _PrevObject2World * _PrevViewProj; 35 | o.prev_screen_pos = ComputeScreenPos(mul(prev_mvp, v.vertex)); 36 | return o; 37 | } 38 | 39 | half4 frag(vs_out i) : SV_Target 40 | { 41 | float2 screen_pos = i.screen_pos.xy / i.screen_pos.w; 42 | float2 prev_screen_pos = i.prev_screen_pos.xy / i.prev_screen_pos.w; 43 | float2 vel = screen_pos - prev_screen_pos; 44 | return half4(vel.xyxy); 45 | } 46 | ENDCG 47 | 48 | // front 49 | Pass { 50 | Cull Back 51 | ZTest Equal 52 | ZWrite Off 53 | 54 | CGPROGRAM 55 | #pragma vertex vert 56 | #pragma fragment frag 57 | ENDCG 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/GBufferUtils/Shaders/Velocity.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a231a8701b4fbd24e82bdbc22777b027 3 | timeCreated: 1442146722 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/GBufferUtils/Shaders/ZPrePass.shader: -------------------------------------------------------------------------------- 1 | Shader "Ist/ZPrePass" { 2 | CGINCLUDE 3 | struct ia_out 4 | { 5 | float4 vertex : POSITION; 6 | }; 7 | struct vs_out 8 | { 9 | float4 vertex : SV_POSITION; 10 | }; 11 | 12 | 13 | vs_out vert(ia_out v) 14 | { 15 | vs_out o; 16 | o.vertex = UnityObjectToClipPos(v.vertex); 17 | return o; 18 | } 19 | 20 | half4 frag(vs_out v) : SV_Target 21 | { 22 | return 0; 23 | } 24 | ENDCG 25 | 26 | SubShader { 27 | Tags{ "RenderType" = "Opaque" "Queue" = "Geometry-100" } 28 | 29 | Pass{ 30 | Tags{ "LightMode" = "Deferred" } 31 | Cull Back 32 | ColorMask 0 33 | 34 | CGPROGRAM 35 | #pragma vertex vert 36 | #pragma fragment frag 37 | ENDCG 38 | } 39 | } 40 | 41 | Fallback Off 42 | } 43 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/GBufferUtils/Shaders/ZPrePass.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 916b73be70736dd41ba59b919f89c185 3 | timeCreated: 1438206397 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7a0151954761e3d4f9c2744bd90030e6 3 | folderAsset: yes 4 | timeCreated: 1437397025 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f8c711ee9636b1d49a3f04190fa5af56 3 | folderAsset: yes 4 | timeCreated: 1438507273 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2013c9b0e77f66d41a02475e66bff9ac 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Materials/MPDSGBuffer.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Materials/MPDSGBuffer.mat -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Materials/MPDSGBuffer.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 86594874622423c4d9478bbb8401d42b 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Materials/MPDSGbufferCB.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Materials/MPDSGbufferCB.mat -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Materials/MPDSGbufferCB.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 703ddcfec9c26f64b87b7087ae426dff 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Materials/MPDepthPrePass.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Materials/MPDepthPrePass.mat -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Materials/MPDepthPrePass.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 53b655bc4f022cd4288a8546eb286f88 3 | timeCreated: 1428664168 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Materials/MPGSBillboard.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Materials/MPGSBillboard.mat -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Materials/MPGSBillboard.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 104497b94d051cf4b9b7ce9baa590258 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Materials/MPLambert.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Materials/MPLambert.mat -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Materials/MPLambert.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1f51d3d94ce825346bde4ed07f4cd206 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Materials/MPPointLight.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Materials/MPPointLight.mat -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Materials/MPPointLight.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 97a0a0e26f53be546a87b261e4f6e039 3 | timeCreated: 1438894109 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Materials/MPStandard.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Materials/MPStandard.mat -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Materials/MPStandard.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5d0b858eb43fef94a993bacac643cd26 3 | timeCreated: 1427872734 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Materials/MPStandardSpherify.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Materials/MPStandardSpherify.mat -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Materials/MPStandardSpherify.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3f79fe6da3c00e14e89631056cf58546 3 | timeCreated: 1427954704 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f1883bf3304b3df468f947e529dfb98e 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Prefabs/MPBoxCollider.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Prefabs/MPBoxCollider.prefab -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Prefabs/MPBoxCollider.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5d0fcbf952ee35c4bbb4c60ad6e056f7 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Prefabs/MPCapsuleCollider.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Prefabs/MPCapsuleCollider.prefab -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Prefabs/MPCapsuleCollider.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e18f4dd00a7f5f448835b384847050c4 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Prefabs/MPEmitter.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Prefabs/MPEmitter.prefab -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Prefabs/MPEmitter.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 55c38057a98aa1547a5cfb98fdda82c0 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Prefabs/MPForce.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Prefabs/MPForce.prefab -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Prefabs/MPForce.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e53a6bb1bc42ecb4babd11300a227939 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Prefabs/MPSphereCollider.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Prefabs/MPSphereCollider.prefab -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Prefabs/MPSphereCollider.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 39efc3674bcb8dd419a367ce142e079c 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Prefabs/MPWorld.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Prefabs/MPWorld.prefab -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Prefabs/MPWorld.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6203f6936c8b7154991b4283493e06ed 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8f0a9df72f3a4f54e90af24485c596cf 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Scripts/MP.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 63b852811bc3dc541b00210fdc3147e7 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Scripts/MPBoxCollider.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | 5 | namespace Ist 6 | { 7 | [AddComponentMenu("MassParticle/CPU Particle/Box Collider")] 8 | public class MPBoxCollider : MPCollider 9 | { 10 | public Vector3 m_center; 11 | public Vector3 m_size = Vector3.one; 12 | 13 | public override void MPUpdate() 14 | { 15 | base.MPUpdate(); 16 | 17 | Matrix4x4 mat = m_trans.localToWorldMatrix; 18 | EachTargets((w) => 19 | { 20 | MPAPI.mpAddBoxCollider(w.GetContext(), ref m_cprops, ref mat, ref m_center, ref m_size); 21 | }); 22 | } 23 | 24 | void OnDrawGizmos() 25 | { 26 | if (!enabled) return; 27 | Transform t = GetComponent(); // エディタから実行されるので trans は使えない 28 | Gizmos.color = MPImpl.ColliderGizmoColor; 29 | Gizmos.matrix = t.localToWorldMatrix; 30 | Gizmos.DrawWireCube(m_center, m_size); 31 | Gizmos.matrix = Matrix4x4.identity; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Scripts/MPBoxCollider.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 24a6cb8d76b219340a6a9c5c54a25e08 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Scripts/MPCapsuleCollider.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | 5 | namespace Ist 6 | { 7 | [AddComponentMenu("MassParticle/CPU Particle/Capsule Collider")] 8 | public class MPCapsuleCollider : MPCollider 9 | { 10 | public enum Direction 11 | { 12 | X, 13 | Y, 14 | Z, 15 | } 16 | public Direction m_direction = Direction.Y; 17 | public Vector3 m_center; 18 | public float m_radius = 0.5f; 19 | public float m_height = 0.5f; 20 | Vector4 m_pos1 = Vector4.zero; 21 | Vector4 m_pos2 = Vector4.zero; 22 | 23 | public override void MPUpdate() 24 | { 25 | Vector3 pos1_3 = m_pos1; 26 | Vector3 pos2_3 = m_pos2; 27 | base.MPUpdate(); 28 | UpdateCapsule(); 29 | EachTargets((w) => 30 | { 31 | MPAPI.mpAddCapsuleCollider(w.GetContext(), ref m_cprops, ref pos1_3, ref pos2_3, m_radius); 32 | }); 33 | } 34 | 35 | void UpdateCapsule() 36 | { 37 | Vector3 e = Vector3.zero; 38 | float h = Mathf.Max(0.0f, m_height - m_radius * 2.0f); 39 | switch (m_direction) 40 | { 41 | case Direction.X: e.Set(h * 0.5f, 0.0f, 0.0f); break; 42 | case Direction.Y: e.Set(0.0f, h * 0.5f, 0.0f); break; 43 | case Direction.Z: e.Set(0.0f, 0.0f, h * 0.5f); break; 44 | } 45 | Vector4 pos1 = new Vector4(e.x + m_center.x, e.y + m_center.y, e.z + m_center.z, 1.0f); 46 | Vector4 pos2 = new Vector4(-e.x + m_center.x, -e.y + m_center.y, -e.z + m_center.z, 1.0f); 47 | m_pos1 = m_trans.localToWorldMatrix * pos1; 48 | m_pos2 = m_trans.localToWorldMatrix * pos2; 49 | } 50 | 51 | void OnDrawGizmos() 52 | { 53 | if (!enabled) return; 54 | m_trans = GetComponent(); 55 | UpdateCapsule(); // エディタから実行される都合上必要 56 | Gizmos.color = MPImpl.ColliderGizmoColor; 57 | Gizmos.DrawWireSphere(m_pos1, m_radius); 58 | Gizmos.DrawWireSphere(m_pos2, m_radius); 59 | Gizmos.DrawLine(m_pos1, m_pos2); 60 | Gizmos.matrix = Matrix4x4.identity; 61 | } 62 | 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Scripts/MPCapsuleCollider.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 062495baff58022488b1a08b40da7792 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Scripts/MPCollider.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d66c852c4a4a2314c8285ae7e5a46947 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Scripts/MPEmitter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8745f04ed1eb9664d8617e5771c9fa49 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Scripts/MPForce.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aecf09b28dbc2f64e944345a5e4262e5 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Scripts/MPLightRenderer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e6ed4c65f5ca9da458ecfebda18d8014 3 | timeCreated: 1438890957 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Scripts/MPRenderer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8858996fe56f7704b964c2a92f7b9584 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Scripts/MPSphereCollider.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | 5 | namespace Ist 6 | { 7 | [AddComponentMenu("MassParticle/CPU Particle/Sphere Collider")] 8 | public class MPSphereCollider : MPCollider 9 | { 10 | public Vector3 m_center; 11 | public float m_radius = 0.5f; 12 | 13 | 14 | public override void MPUpdate() 15 | { 16 | base.MPUpdate(); 17 | Vector3 pos = m_trans.localToWorldMatrix * new Vector4(m_center.x, m_center.y, m_center.z, 1.0f); 18 | EachTargets((w) => 19 | { 20 | MPAPI.mpAddSphereCollider(w.GetContext(), ref m_cprops, ref pos, m_trans.localScale.magnitude * 0.25f); 21 | }); 22 | } 23 | 24 | void OnDrawGizmos() 25 | { 26 | if (!enabled) return; 27 | Transform t = GetComponent(); // エディタから実行されるので trans は使えない 28 | Gizmos.color = MPImpl.ColliderGizmoColor; 29 | Gizmos.matrix = t.localToWorldMatrix; 30 | Gizmos.DrawWireSphere(m_center, 0.5f); 31 | Gizmos.matrix = Matrix4x4.identity; 32 | } 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Scripts/MPSphereCollider.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1c5e417bb57dd5c4cb3182d223b0c9f3 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Scripts/MPWorld.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8255d8bc933d1bc46859365ec1b9f56a 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Shaders.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e8a0e6c834fcd0e4dbf08809301489eb 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Shaders/MPDepthPrePass.shader: -------------------------------------------------------------------------------- 1 | Shader "MassParticle/DepthPrePass" { 2 | 3 | Properties { 4 | g_size ("Particle Size", Float) = 0.2 5 | g_fade_time ("Fade Time", Float) = 0.3 6 | g_spin ("Spin", Float) = 0.0 7 | } 8 | 9 | SubShader { 10 | Tags { "RenderType"="Opaque" "Queue"="Geometry-1" } 11 | ZWrite On ZTest LEqual 12 | ColorMask 0 13 | 14 | CGPROGRAM 15 | #pragma surface surf Standard vertex:vert 16 | #pragma target 3.0 17 | 18 | #define MP_STANDARD 19 | #include "MPSurface.cginc" 20 | ENDCG 21 | } 22 | FallBack Off 23 | 24 | } 25 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Shaders/MPDepthPrePass.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 07efd8aaf66f76a4b88f6b3ebbd02c89 3 | timeCreated: 1428663990 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Shaders/MPFoundation.cginc: -------------------------------------------------------------------------------- 1 | #ifndef MPFoundation_h 2 | #define MPFoundation_h 3 | 4 | #include "Assets/Ist/Foundation/Shaders/Math.cginc" 5 | 6 | int g_batch_begin; 7 | int g_num_max_instances; 8 | int g_num_instances; 9 | sampler2D g_instance_data; 10 | float g_size; 11 | float g_fade_time; 12 | float g_spin; 13 | float4 g_instance_data_size; 14 | 15 | 16 | float3 iq_rand( float3 p ) 17 | { 18 | p = float3( dot(p,float3(127.1,311.7,311.7)), dot(p,float3(269.5,183.3,183.3)), dot(p,float3(269.5,183.3,183.3)) ); 19 | return frac(sin(p)*43758.5453)*2.0-1.0; 20 | } 21 | 22 | 23 | // o_pos: w=ID 24 | // o_params: y=lifetime 25 | void GetParticleParams(int iid, out float4 o_pos, out float4 o_vel, out float4 o_params) 26 | { 27 | float i = iid*3; 28 | float4 t = float4( 29 | g_instance_data_size.xy * float2(fmod(i, g_instance_data_size.z) + 0.5, floor(i/g_instance_data_size.z) + 0.5), 30 | 0.0, 0.0); 31 | float4 pitch = float4(g_instance_data_size.x, 0.0, 0.0, 0.0); 32 | o_pos = tex2Dlod(g_instance_data, t + pitch*0.0); 33 | o_vel = tex2Dlod(g_instance_data, t + pitch*1.0); 34 | o_params= tex2Dlod(g_instance_data, t + pitch*2.0); 35 | } 36 | 37 | // o_pos: w=ID 38 | // o_params: y=lifetime, z=fade scale 39 | void ParticleTransform(inout appdata_full v, out float4 o_pos, out float4 o_vel, out float4 o_params) 40 | { 41 | int iid = v.texcoord1.x + g_batch_begin; 42 | if (iid >= g_num_instances) { 43 | v.vertex.xyz *= 0.0; 44 | return; 45 | } 46 | GetParticleParams(iid, o_pos, o_vel, o_params); 47 | float lifetime = o_params.y; 48 | float fade = min(1.0, lifetime / g_fade_time); 49 | o_params.z = fade; 50 | 51 | v.vertex.xyz *= g_size; 52 | v.vertex.xyz *= fade; 53 | v.vertex.xyz *= saturate(lifetime * 10000000); // 0 if dead 54 | #ifdef MP_ENABLE_SPIN 55 | if(g_spin != 0.0) { 56 | float ang = (dot(o_pos.xyz, 1.0) * min(1.0, o_vel.w*0.02)) * g_spin; 57 | float3x3 rot = RotateAxis33(normalize(iq_rand(o_pos.www)), ang); 58 | v.vertex.xyz = mul(rot, v.vertex.xyz); 59 | v.normal.xyz = mul(rot, v.normal.xyz); 60 | } 61 | #endif // MP_ENABLE_SPIN 62 | v.vertex.xyz += o_pos.xyz; 63 | } 64 | 65 | 66 | #endif // MPFoundation_h 67 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Shaders/MPFoundation.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 602683ed30d7eb74f97d5da29062a2b3 3 | timeCreated: 1427953186 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Shaders/MPGSBillboard.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 258b919c62cdb624191c9526eaac5f4b 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Shaders/MPLambert.shader: -------------------------------------------------------------------------------- 1 | Shader "MassParticle/Lambert" { 2 | 3 | Properties { 4 | _MainTex ("Base (RGB)", 2D) = "white" {} 5 | _Color ("Color", Color) = (0.8, 0.8, 0.8, 1.0) 6 | 7 | _HeatThreshold("Heat Threshold", Float) = 2.0 8 | _HeatIntensity("Heat Intensity", Float) = 1.0 9 | _HeatColor("Heat Color", Color) = (0.25, 0.05, 0.025, 0.0) 10 | 11 | g_size ("Particle Size", Float) = 0.2 12 | g_fade_time ("Fade Time", Float) = 0.3 13 | g_spin ("Spin", Float) = 0.0 14 | } 15 | SubShader { 16 | Tags { "RenderType"="Opaque" "Queue"="Geometry+1" } 17 | 18 | CGPROGRAM 19 | #pragma surface surf Lambert vertex:vert addshadow 20 | 21 | #define MP_SURFACE 22 | #include "MPSurface.cginc" 23 | ENDCG 24 | } 25 | 26 | FallBack Off 27 | } 28 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Shaders/MPLambert.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 00658bd314fcae84ab2d108f424551c4 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Shaders/MPPointLight.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fa06456c08bdd1d4ab84891f4e2aa73d 3 | timeCreated: 1438892688 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Shaders/MPStandard.shader: -------------------------------------------------------------------------------- 1 | Shader "MassParticle/Standard" { 2 | 3 | Properties { 4 | _MainTex ("Base (RGB)", 2D) = "white" {} 5 | _Color ("Color", Color) = (0.8, 0.8, 0.8, 1.0) 6 | _Glossiness ("Smoothness", Range(0,1)) = 0.5 7 | _Metallic ("Metallic", Range(0,1)) = 0.0 8 | 9 | _HeatColor("Heat Color", Color) = (0.25, 0.05, 0.025, 0.0) 10 | _HeatThreshold("Heat Threshold", Float) = 2.0 11 | _HeatIntensity("Heat Intensity", Float) = 1.0 12 | 13 | g_size ("Particle Size", Float) = 0.2 14 | g_fade_time ("Fade Time", Float) = 0.3 15 | g_spin ("Spin", Float) = 0.0 16 | } 17 | 18 | SubShader { 19 | Tags { "RenderType"="Opaque" "Queue"="Geometry+1" } 20 | //ZWrite Off ZTest Equal // for depth prepass 21 | 22 | CGPROGRAM 23 | #pragma surface surf Standard fullforwardshadows vertex:vert addshadow 24 | #pragma target 3.0 25 | 26 | #define MP_STANDARD 27 | #include "MPSurface.cginc" 28 | ENDCG 29 | } 30 | FallBack Off 31 | 32 | } 33 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Shaders/MPStandard.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 62721d67acd77a848a00b9237b575958 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Shaders/MPStandardSpherify.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ec863441227a8af40bb78e8419d6d4c4 3 | timeCreated: 1427953219 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/CPUParticle/Shaders/MPSurface.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3555814c07bc7684d8de4739e4c02504 3 | timeCreated: 1428297642 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4f5b5e689390fd444a1e72d9106d4832 3 | folderAsset: yes 4 | timeCreated: 1437397025 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 387fd8de0fcaacd4396b2eb80f47cbb9 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Materials/MPGPPointLight.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Materials/MPGPPointLight.mat -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Materials/MPGPPointLight.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7ec2ff08d5899514db53e2cc35c65203 3 | timeCreated: 1438507395 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Materials/MPGPStandard.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Materials/MPGPStandard.mat -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Materials/MPGPStandard.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 16ba62bef94e71f4dbcc5ecda26b80c1 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Materials/MPGPTrail.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Materials/MPGPTrail.mat -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Materials/MPGPTrail.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a7f81d14909ca9b4faae37a287ba70aa 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Materials/MPGPTransparentAdd.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Materials/MPGPTransparentAdd.mat -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Materials/MPGPTransparentAdd.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c033008fbece5e64f8cd990f82dab8a1 3 | timeCreated: 1438865170 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 146b357112c8619419bc4bd0f4756735 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Prefabs/MPGPEmitter.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &100000 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 100100000} 8 | serializedVersion: 4 9 | m_Component: 10 | - 4: {fileID: 400000} 11 | - 114: {fileID: 11400000} 12 | m_Layer: 0 13 | m_Name: MPGPEmitter 14 | m_TagString: Untagged 15 | m_Icon: {fileID: 0} 16 | m_NavMeshLayer: 0 17 | m_StaticEditorFlags: 0 18 | m_IsActive: 1 19 | --- !u!4 &400000 20 | Transform: 21 | m_ObjectHideFlags: 1 22 | m_PrefabParentObject: {fileID: 0} 23 | m_PrefabInternal: {fileID: 100100000} 24 | m_GameObject: {fileID: 100000} 25 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 26 | m_LocalPosition: {x: -13.3782139, y: -16.8906784, z: 20.8024559} 27 | m_LocalScale: {x: 1, y: 1, z: 1} 28 | m_Children: [] 29 | m_Father: {fileID: 0} 30 | m_RootOrder: 0 31 | --- !u!114 &11400000 32 | MonoBehaviour: 33 | m_ObjectHideFlags: 1 34 | m_PrefabParentObject: {fileID: 0} 35 | m_PrefabInternal: {fileID: 100100000} 36 | m_GameObject: {fileID: 100000} 37 | m_Enabled: 1 38 | m_EditorHideFlags: 0 39 | m_Script: {fileID: 11500000, guid: 14a620dce051f6241a1a86f57720215d, type: 3} 40 | m_Name: 41 | m_EditorClassIdentifier: 42 | m_targets: [] 43 | m_emit_count: 100 44 | m_shape: 0 45 | m_velosity_base: {x: 0, y: 0, z: 0} 46 | m_velosity_diffuse: .5 47 | --- !u!1001 &100100000 48 | Prefab: 49 | m_ObjectHideFlags: 1 50 | serializedVersion: 2 51 | m_Modification: 52 | m_TransformParent: {fileID: 0} 53 | m_Modifications: [] 54 | m_RemovedComponents: [] 55 | m_ParentPrefab: {fileID: 0} 56 | m_RootGameObject: {fileID: 100000} 57 | m_IsPrefabParent: 1 58 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Prefabs/MPGPEmitter.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 917f7d3ede8fe0b4ca2cf0e3b35c42a8 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Prefabs/MPGPForce.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &100000 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 100100000} 8 | serializedVersion: 4 9 | m_Component: 10 | - 4: {fileID: 400000} 11 | - 114: {fileID: 11400000} 12 | m_Layer: 0 13 | m_Name: MPGPForce 14 | m_TagString: Untagged 15 | m_Icon: {fileID: 0} 16 | m_NavMeshLayer: 0 17 | m_StaticEditorFlags: 0 18 | m_IsActive: 1 19 | --- !u!4 &400000 20 | Transform: 21 | m_ObjectHideFlags: 1 22 | m_PrefabParentObject: {fileID: 0} 23 | m_PrefabInternal: {fileID: 100100000} 24 | m_GameObject: {fileID: 100000} 25 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 26 | m_LocalPosition: {x: -1.62302351, y: 4.92446041, z: 1.5222435} 27 | m_LocalScale: {x: 1, y: 1, z: 1} 28 | m_Children: [] 29 | m_Father: {fileID: 0} 30 | m_RootOrder: 0 31 | --- !u!114 &11400000 32 | MonoBehaviour: 33 | m_ObjectHideFlags: 1 34 | m_PrefabParentObject: {fileID: 0} 35 | m_PrefabInternal: {fileID: 100100000} 36 | m_GameObject: {fileID: 100000} 37 | m_Enabled: 1 38 | m_EditorHideFlags: 0 39 | m_Script: {fileID: 11500000, guid: c4f151a651c9ed84c8218aab306ea6d1, type: 3} 40 | m_Name: 41 | m_EditorClassIdentifier: 42 | m_targets: [] 43 | m_shape_type: 0 44 | m_direction_type: 0 45 | m_strength_near: 10 46 | m_strength_far: 0 47 | m_range_inner: 0 48 | m_range_outer: 100 49 | m_attenuation_exp: .5 50 | m_random_diffuse: 0 51 | m_random_seed: 1 52 | m_direction: {x: 0, y: -1, z: 0} 53 | m_vectorfield_cellsize: {x: 1.5, y: 1.5, z: 1.5} 54 | --- !u!1001 &100100000 55 | Prefab: 56 | m_ObjectHideFlags: 1 57 | serializedVersion: 2 58 | m_Modification: 59 | m_TransformParent: {fileID: 0} 60 | m_Modifications: [] 61 | m_RemovedComponents: [] 62 | m_ParentPrefab: {fileID: 0} 63 | m_RootGameObject: {fileID: 100000} 64 | m_IsPrefabParent: 1 65 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Prefabs/MPGPForce.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dcf38784a9249b949aebe1214d622318 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Prefabs/MPGPWorld.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Prefabs/MPGPWorld.prefab -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Prefabs/MPGPWorld.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fa7d7831513feaf40abaa22e0da07344 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5a6596d85111632468e947e309a4cce7 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Scripts/MPGPBezierPatchCollider.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | 5 | 6 | namespace Ist 7 | { 8 | [AddComponentMenu("MassParticle/GPU Particle/Bezier Patch Collider")] 9 | [RequireComponent(typeof(IBezierPatchContainer))] 10 | public class MPGPBezierPatchCollider : MPGPColliderBase 11 | { 12 | public Vector3 m_center; 13 | public Vector3 m_size = Vector3.one; 14 | 15 | public override void ActualUpdate() 16 | { 17 | var container = GetComponent(); 18 | var bps = container.GetBezierPatches(); 19 | var aabbs = container.GetAABBs(); 20 | MPGPBezierPatchColliderData collider; 21 | for (int i=0; i { t.AddBezierPatchCollider(ref collider); }); 28 | } 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Scripts/MPGPBezierPatchCollider.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 07a86d0d9fe93514994e54f193ef3369 3 | timeCreated: 1448024570 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Scripts/MPGPBoxCollider.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | 5 | 6 | namespace Ist 7 | { 8 | [AddComponentMenu("MassParticle/GPU Particle/Box Collider")] 9 | public class MPGPBoxCollider : MPGPColliderBase 10 | { 11 | public Vector3 m_center; 12 | public Vector3 m_size = Vector3.one; 13 | MPGPBoxColliderData m_collider_data; 14 | 15 | public override void ActualUpdate() 16 | { 17 | MPGPImpl.BuildBoxCollider(ref m_collider_data, m_trans, ref m_center, ref m_size, m_id); 18 | EachTargets((t) => { t.AddBoxCollider(ref m_collider_data); }); 19 | } 20 | 21 | void OnDrawGizmos() 22 | { 23 | if (!enabled) return; 24 | Transform t = GetComponent(); 25 | Gizmos.color = MPGPImpl.ColliderGizmoColor; 26 | Gizmos.matrix = t.localToWorldMatrix; 27 | Gizmos.DrawWireCube(m_center, m_size); 28 | Gizmos.matrix = Matrix4x4.identity; 29 | } 30 | 31 | } 32 | } -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Scripts/MPGPBoxCollider.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b5aca4c4866ebe54b999020322d051e3 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Scripts/MPGPCapsuleCollider.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | 5 | 6 | namespace Ist 7 | { 8 | [AddComponentMenu("MassParticle/GPU Particle/Capsule Collider")] 9 | public class MPGPCapsuleCollider : MPGPColliderBase 10 | { 11 | public enum Direction 12 | { 13 | X, Y, Z 14 | } 15 | 16 | public Vector3 m_center; 17 | public float m_radius = 0.5f; 18 | public float m_height = 2.0f; 19 | public Direction m_direction = Direction.Y; 20 | MPGPCapsuleColliderData m_collider_data; 21 | 22 | public override void ActualUpdate() 23 | { 24 | MPGPImpl.BuildCapsuleCollider(ref m_collider_data, m_trans, ref m_center, m_radius, m_height, (int)m_direction, m_id); 25 | EachTargets((t) => { t.AddCapsuleCollider(ref m_collider_data); }); 26 | } 27 | 28 | void OnDrawGizmos() 29 | { 30 | if (!enabled) return; 31 | m_trans = GetComponent(); 32 | MPGPImpl.BuildCapsuleCollider(ref m_collider_data, m_trans, ref m_center, m_radius, m_height, (int)m_direction, m_id); 33 | Gizmos.color = MPGPImpl.ColliderGizmoColor; 34 | Gizmos.DrawWireSphere(m_collider_data.shape.pos1, m_radius); 35 | Gizmos.DrawWireSphere(m_collider_data.shape.pos2, m_radius); 36 | Gizmos.DrawLine(m_collider_data.shape.pos1, m_collider_data.shape.pos2); 37 | Gizmos.matrix = Matrix4x4.identity; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Scripts/MPGPCapsuleCollider.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f67e5816354e34448b66085eac3c1a7b 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Scripts/MPGPCollider.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | 5 | 6 | namespace Ist 7 | { 8 | public class MPGPColliderBase : MonoBehaviour 9 | { 10 | static List s_instances; 11 | 12 | public static List GetInstances() 13 | { 14 | if (s_instances == null) s_instances = new List(); 15 | return s_instances; 16 | } 17 | 18 | public static void UpdateAll() 19 | { 20 | int i = 0; 21 | GetInstances().ForEach((v) => { 22 | v.m_id = i++; 23 | v.ActualUpdate(); 24 | }); 25 | } 26 | 27 | 28 | public MPGPWorld[] m_targets; 29 | public bool m_send_collision = true; 30 | public bool m_receive_collision = false; 31 | protected int m_id; 32 | protected Transform m_trans; 33 | 34 | protected void EachTargets(System.Action a) 35 | { 36 | if (m_targets.Length == 0) { MPGPWorld.GetInstances().ForEach(a); } 37 | else { foreach (var t in m_targets) { a(t); } } 38 | } 39 | 40 | void OnEnable() 41 | { 42 | GetInstances().Add(this); 43 | m_trans = GetComponent(); 44 | } 45 | 46 | void OnDisable() 47 | { 48 | GetInstances().Remove(this); 49 | } 50 | 51 | public virtual void ActualUpdate() { } 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Scripts/MPGPCollider.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fd4f2838a47ddf9498cef2b134b242b0 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Scripts/MPGPDataTypes.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 58fc77fa4b9808b4790a17341634c3e1 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Scripts/MPGPEmitter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 14a620dce051f6241a1a86f57720215d 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Scripts/MPGPForce.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c4f151a651c9ed84c8218aab306ea6d1 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Scripts/MPGPGPUSort.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3f4dc3ada5e38ff44827bea2ade53dfa 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Scripts/MPGPLightRenderer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 62e26ce803841a34987b44b3957478bc 3 | timeCreated: 1438507149 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Scripts/MPGPRenderer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c5c7c11ce580fad4e8463635a1a63bec 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Scripts/MPGPSphereCollider.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | 5 | 6 | namespace Ist 7 | { 8 | [AddComponentMenu("MassParticle/GPU Particle/Sphere Collider")] 9 | public class MPGPSphereCollider : MPGPColliderBase 10 | { 11 | public Vector3 m_center; 12 | public float m_radius = 0.5f; 13 | MPGPSphereColliderData m_collider_data; 14 | 15 | public override void ActualUpdate() 16 | { 17 | MPGPImpl.BuildSphereCollider(ref m_collider_data, m_trans, ref m_center, m_radius, m_id); 18 | EachTargets((t) => { t.AddSphereCollider(ref m_collider_data); }); 19 | } 20 | 21 | void OnDrawGizmos() 22 | { 23 | if (!enabled) return; 24 | Transform t = GetComponent(); // エディタから実行されるので trans は使えない 25 | Gizmos.color = MPGPImpl.ColliderGizmoColor; 26 | Gizmos.matrix = t.localToWorldMatrix; 27 | Gizmos.DrawWireSphere(m_center, m_radius); 28 | Gizmos.matrix = Matrix4x4.identity; 29 | } 30 | 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Scripts/MPGPSphereCollider.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c0e50e5d50898714aab0ccd9fde6c306 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Scripts/MPGPTrailRenderer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9daca0f84a702d84e84507e3c85100a7 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Scripts/MPGPWorld.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7b9ca155f2517784ba640582e4876110 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Shaders.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ee823f1a31de91f4fb090b24f8a74d16 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Shaders/MPGPBitonicSort.compute: -------------------------------------------------------------------------------- 1 | #pragma kernel BitonicSort 2 | #pragma kernel MatrixTranspose 3 | 4 | #define BITONIC_BLOCK_SIZE 512 5 | #define TRANSPOSE_BLOCK_SIZE 16 6 | 7 | 8 | struct CB 9 | { 10 | uint level; 11 | uint levelMask; 12 | uint width; 13 | uint height; 14 | }; 15 | 16 | struct KIP 17 | { 18 | uint key; 19 | uint index; 20 | }; 21 | 22 | StructuredBuffer consts; 23 | StructuredBuffer kip; 24 | RWStructuredBuffer kip_rw; 25 | 26 | groupshared KIP shared_data[BITONIC_BLOCK_SIZE]; 27 | 28 | [numthreads(BITONIC_BLOCK_SIZE, 1, 1)] 29 | void BitonicSort( uint3 gid : SV_GroupID, 30 | uint3 dtid : SV_DispatchThreadID, 31 | uint3 gtid : SV_GroupThreadID, 32 | uint gi : SV_GroupIndex ) 33 | { 34 | shared_data[gi] = kip_rw[dtid.x]; 35 | GroupMemoryBarrierWithGroupSync(); 36 | 37 | for (uint j = consts[0].level >> 1 ; j > 0 ; j >>= 1) 38 | { 39 | KIP result; 40 | bool c1 = shared_data[gi & ~j].key <= shared_data[gi | j].key; 41 | bool c2 = (consts[0].levelMask & dtid.x) != 0; 42 | if(c1==c2) { 43 | result = shared_data[gi ^ j]; 44 | } 45 | else { 46 | result = shared_data[gi]; 47 | } 48 | 49 | GroupMemoryBarrierWithGroupSync(); 50 | shared_data[gi] = result; 51 | GroupMemoryBarrierWithGroupSync(); 52 | } 53 | kip_rw[dtid.x] = shared_data[gi]; 54 | } 55 | 56 | 57 | groupshared KIP transpose_shared_data[TRANSPOSE_BLOCK_SIZE * TRANSPOSE_BLOCK_SIZE]; 58 | 59 | [numthreads(TRANSPOSE_BLOCK_SIZE, TRANSPOSE_BLOCK_SIZE, 1)] 60 | void MatrixTranspose( uint3 gid : SV_GroupID, 61 | uint3 dtid : SV_DispatchThreadID, 62 | uint3 gtid : SV_GroupThreadID, 63 | uint gi : SV_GroupIndex ) 64 | { 65 | transpose_shared_data[gi] = kip[dtid.y * consts[0].width + dtid.x]; 66 | GroupMemoryBarrierWithGroupSync(); 67 | uint2 XY = dtid.yx - gtid.yx + gtid.xy; 68 | kip_rw[XY.y * consts[0].height + XY.x] = transpose_shared_data[gtid.x * TRANSPOSE_BLOCK_SIZE + gtid.y]; 69 | } 70 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Shaders/MPGPBitonicSort.compute.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9fbd75338190f964a893faa5660d1c82 3 | ComputeShaderImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Shaders/MPGPFoundation.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fa4f165bb9f45a54d904664e16947acc 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Shaders/MPGPHashGrid.compute.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c13cd6233c9d74d45a4e2bd3a963d774 3 | ComputeShaderImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Shaders/MPGPParticleCore.compute.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8303c0f8ebb0e4a4588a441eb323207b 3 | ComputeShaderImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Shaders/MPGPPointLight.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6fd321ee6628e2a4385e8d65c870134b 3 | timeCreated: 1438507038 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Shaders/MPGPStandard.shader: -------------------------------------------------------------------------------- 1 | Shader "GPUParticle/Standard" { 2 | 3 | Properties { 4 | _MainTex ("Albedo", 2D) = "white" {} 5 | _Color("Albedo Color", Color) = (0.8, 0.8, 0.8, 1.0) 6 | _Emission("Emission Color", Color) = (0, 0, 0, 0) 7 | _Glossiness ("Smoothness", Range(0,1)) = 0.5 8 | _Metallic ("Metallic", Range(0,1)) = 0.0 9 | 10 | _HeatThreshold("Heat Threshold", Float) = 2.0 11 | _HeatIntensity("Heat Intensity", Float) = 1.0 12 | _HeatColor("Heat Color", Color) = (0.25, 0.05, 0.025, 0.0) 13 | 14 | g_size ("Particle Size", Float) = 0.2 15 | g_fade_time ("Fade Time", Float) = 0.3 16 | g_spin ("Spin", Float) = 0.0 17 | } 18 | 19 | SubShader { 20 | Tags { "RenderType"="Opaque" "Queue"="Geometry+1" } 21 | 22 | CGPROGRAM 23 | #pragma target 5.0 24 | #pragma surface surf Standard fullforwardshadows vertex:vert addshadow 25 | 26 | #define MPGP_STANDARD 27 | #include "MPGPSurface.cginc" 28 | ENDCG 29 | } 30 | 31 | 32 | FallBack Off 33 | } 34 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Shaders/MPGPStandard.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1b428dc560adc424f970a1df19f51fa1 3 | timeCreated: 1428297271 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Shaders/MPGPSurface.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2bc933edb2d5b934ba26877ab1d3c10e 3 | timeCreated: 1428299972 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Shaders/MPGPTrail.cginc: -------------------------------------------------------------------------------- 1 | #ifndef Trail_h 2 | #define Trail_h 3 | 4 | #include "UnityCG.cginc" 5 | #define MPGP_FOR_DRAW 6 | #include "MPGPFoundation.cginc" 7 | 8 | fixed4 _BaseColor; 9 | float _FadeTime; 10 | int g_batch_begin; 11 | float g_width; 12 | StructuredBuffer particles; 13 | StructuredBuffer params; 14 | StructuredBuffer vertices; 15 | 16 | struct ia_out { 17 | float4 vertex : POSITION; 18 | }; 19 | 20 | struct vs_out { 21 | float4 vertex : SV_POSITION; 22 | float2 texcoord : TEXCOORD0; 23 | float4 color : TEXCOORD01; 24 | }; 25 | 26 | struct ps_out 27 | { 28 | float4 color : COLOR0; 29 | }; 30 | 31 | 32 | vs_out vert(ia_out io) 33 | { 34 | uint vertex_id = io.vertex.x; 35 | uint instance_id = g_batch_begin + io.vertex.y; 36 | 37 | float lifetime = particles[instance_id].lifetime; 38 | float fade = min(lifetime/_FadeTime, 1.0); 39 | 40 | float4 vp = 0.0; 41 | float2 tc = 0.0; 42 | if(lifetime > 0.0) { 43 | uint ii = (particles[instance_id].id % params[0].max_entities) * params[0].max_history; 44 | TrailVertex tv = vertices[ii + vertex_id/2]; 45 | 46 | float3 pos = tv.position; 47 | float3 tangent = tv.tangent; 48 | float3 aim_camera = normalize(_WorldSpaceCameraPos-pos); 49 | float3 distance = cross(tangent, aim_camera) * (g_width*0.5f); 50 | 51 | // right if vertex_id%2==0. otherwise left 52 | float rl = 1.0 - 2.0*(vertex_id & 1); 53 | pos += distance * rl; 54 | 55 | vp = mul(UNITY_MATRIX_VP, float4(pos, 1.0)); 56 | tc = tv.texcoord; 57 | tc.x = rl*0.5 + 0.5; 58 | } 59 | 60 | vs_out o; 61 | o.vertex = vp; 62 | o.texcoord = tc; 63 | o.color = _BaseColor * fade; 64 | 65 | return o; 66 | } 67 | 68 | ps_out frag(vs_out vo) 69 | { 70 | ps_out o; 71 | float ua = pow( 1.0 - abs(vo.texcoord.x*2.0f-1.0f)+0.0001, 0.5 ); 72 | float va = pow((vo.texcoord.y+0.0001), 0.5); 73 | float a = ua * va; 74 | o.color = vo.color; 75 | o.color.a *= a; 76 | return o; 77 | } 78 | 79 | #endif // Trail_h 80 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Shaders/MPGPTrail.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 301980876ab9c0745946c0dfa2b2a77f 3 | timeCreated: 1428290231 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Shaders/MPGPTrail.compute.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b596eef888b635744a94c082d506b6a8 3 | ComputeShaderImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Shaders/MPGPTrail_Transparent.shader: -------------------------------------------------------------------------------- 1 | Shader "GPUParticle/Trail Transparent" { 2 | 3 | Properties { 4 | _SrcBlend("SrcBlend", Int) = 5 5 | _DstBlend("DstBlend", Int) = 1 6 | _ZWrite("ZWrite", Int) = 0 7 | 8 | _BaseColor ("BaseColor", Color) = (0.15, 0.15, 0.2, 5.0) 9 | g_width ("Width", Float) = 0.2 10 | _FadeTime ("FadeTime", Float) = 0.1 11 | } 12 | Category { 13 | Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } 14 | Blend [_SrcBlend] [_DstBlend] 15 | AlphaTest Greater .01 16 | Cull Off 17 | Lighting Off 18 | ZWrite [_ZWrite] 19 | 20 | SubShader { 21 | Pass { 22 | CGPROGRAM 23 | #pragma target 5.0 24 | #pragma vertex vert 25 | #pragma fragment frag 26 | #include "MPGPTrail.cginc" 27 | ENDCG 28 | } 29 | } 30 | Fallback Off 31 | } 32 | } -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Shaders/MPGPTrail_Transparent.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 934f84913cdf7fc4395bfdf2abd1de58 3 | timeCreated: 1428484057 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Shaders/MPGPTransparent.shader: -------------------------------------------------------------------------------- 1 | Shader "GPUParticle/Transparent" { 2 | 3 | Properties { 4 | _SrcBlend("SrcBlend", Int) = 1 5 | _DstBlend("DstBlend", Int) = 1 6 | 7 | _MainTex ("Albedo", 2D) = "white" {} 8 | _Color("Albedo Color", Color) = (0.8, 0.8, 0.8, 1.0) 9 | _Emission("Emission Color", Color) = (0, 0, 0, 0) 10 | _Glossiness ("Smoothness", Range(0,1)) = 0.5 11 | _Metallic ("Metallic", Range(0,1)) = 0.0 12 | 13 | _HeatThreshold("Heat Threshold", Float) = 2.0 14 | _HeatIntensity("Heat Intensity", Float) = 1.0 15 | _HeatColor("Heat Color", Color) = (0.25, 0.05, 0.025, 0.0) 16 | 17 | g_size ("Particle Size", Float) = 0.2 18 | g_fade_time ("Fade Time", Float) = 0.3 19 | g_spin ("Spin", Float) = 0.0 20 | } 21 | 22 | SubShader { 23 | Tags { "RenderType"="Transparent" "Queue"="Transparent" } 24 | Blend[_SrcBlend][_DstBlend] 25 | 26 | Pass { 27 | CGPROGRAM 28 | #pragma target 5.0 29 | #pragma vertex vert 30 | #pragma fragment frag 31 | 32 | #define MPGP_TRANSPARENT 33 | #include "MPGPSurface.cginc" 34 | ENDCG 35 | } 36 | } 37 | 38 | 39 | FallBack Off 40 | } 41 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/MassParticle/GPUParticle/Shaders/MPGPTransparent.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0864173754d69e54497ac08e72e6d72d 3 | timeCreated: 1438758054 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Plugins.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3841de608e0a0454b8c7faa422e3f6d2 3 | folderAsset: yes 4 | timeCreated: 1448022691 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Plugins/x86.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 73e9e3719d6c1064c979a14ec250e130 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Plugins/x86/CopyToTexture.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/Assets/Ist/Plugins/x86/CopyToTexture.dll -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Plugins/x86/CopyToTexture.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 560fc116112e4b3409bd3e19508385e4 3 | PluginImporter: 4 | serializedVersion: 1 5 | iconMap: {} 6 | executionOrder: {} 7 | isPreloaded: 0 8 | platformData: 9 | Android: 10 | enabled: 0 11 | settings: 12 | CPU: AnyCPU 13 | Any: 14 | enabled: 0 15 | settings: {} 16 | Editor: 17 | enabled: 0 18 | settings: 19 | CPU: AnyCPU 20 | DefaultValueInitialized: true 21 | OS: AnyOS 22 | Linux: 23 | enabled: 1 24 | settings: 25 | CPU: x86 26 | Linux64: 27 | enabled: 1 28 | settings: 29 | CPU: x86_64 30 | LinuxUniversal: 31 | enabled: 1 32 | settings: 33 | CPU: AnyCPU 34 | OSXIntel: 35 | enabled: 1 36 | settings: 37 | CPU: AnyCPU 38 | OSXIntel64: 39 | enabled: 1 40 | settings: 41 | CPU: AnyCPU 42 | OSXUniversal: 43 | enabled: 1 44 | settings: 45 | CPU: AnyCPU 46 | SamsungTV: 47 | enabled: 0 48 | settings: 49 | STV_MODEL: STANDARD_13 50 | WP8: 51 | enabled: 0 52 | settings: 53 | CPU: AnyCPU 54 | DontProcess: False 55 | PlaceholderPath: 56 | Win: 57 | enabled: 1 58 | settings: 59 | CPU: AnyCPU 60 | Win64: 61 | enabled: 0 62 | settings: 63 | CPU: None 64 | WindowsStoreApps: 65 | enabled: 0 66 | settings: 67 | CPU: AnyCPU 68 | DontProcess: False 69 | PlaceholderPath: 70 | SDK: AnySDK 71 | iOS: 72 | enabled: 0 73 | settings: 74 | CompileFlags: 75 | FrameworkDependencies: 76 | userData: 77 | assetBundleName: 78 | assetBundleVariant: 79 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Plugins/x86/MassParticle.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/Assets/Ist/Plugins/x86/MassParticle.dll -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Plugins/x86/MassParticle.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d3eb399ba9acb7f4bb0dd7554389df4b 3 | PluginImporter: 4 | serializedVersion: 1 5 | iconMap: {} 6 | executionOrder: {} 7 | isPreloaded: 0 8 | platformData: 9 | Android: 10 | enabled: 0 11 | settings: 12 | CPU: AnyCPU 13 | Any: 14 | enabled: 0 15 | settings: {} 16 | Editor: 17 | enabled: 1 18 | settings: 19 | CPU: x86 20 | DefaultValueInitialized: true 21 | OS: Windows 22 | Linux: 23 | enabled: 1 24 | settings: 25 | CPU: x86 26 | Linux64: 27 | enabled: 1 28 | settings: 29 | CPU: None 30 | LinuxUniversal: 31 | enabled: 1 32 | settings: 33 | CPU: AnyCPU 34 | OSXIntel: 35 | enabled: 1 36 | settings: 37 | CPU: AnyCPU 38 | OSXIntel64: 39 | enabled: 1 40 | settings: 41 | CPU: None 42 | OSXUniversal: 43 | enabled: 1 44 | settings: 45 | CPU: AnyCPU 46 | SamsungTV: 47 | enabled: 0 48 | settings: 49 | STV_MODEL: STANDARD_13 50 | WP8: 51 | enabled: 0 52 | settings: 53 | CPU: AnyCPU 54 | DontProcess: False 55 | PlaceholderPath: 56 | Win: 57 | enabled: 1 58 | settings: 59 | CPU: AnyCPU 60 | Win64: 61 | enabled: 0 62 | settings: 63 | CPU: None 64 | WindowsStoreApps: 65 | enabled: 0 66 | settings: 67 | CPU: AnyCPU 68 | DontProcess: False 69 | PlaceholderPath: 70 | SDK: AnySDK 71 | iOS: 72 | enabled: 0 73 | settings: 74 | CompileFlags: 75 | FrameworkDependencies: 76 | userData: 77 | assetBundleName: 78 | assetBundleVariant: 79 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Plugins/x86/MassParticleHelper.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/Assets/Ist/Plugins/x86/MassParticleHelper.dll -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Plugins/x86/MassParticleHelper.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 195b3d3b148283b4ba6355976ec42b19 3 | PluginImporter: 4 | serializedVersion: 1 5 | iconMap: {} 6 | executionOrder: {} 7 | isPreloaded: 0 8 | platformData: 9 | Android: 10 | enabled: 0 11 | settings: 12 | CPU: AnyCPU 13 | Any: 14 | enabled: 0 15 | settings: {} 16 | Editor: 17 | enabled: 1 18 | settings: 19 | CPU: x86 20 | DefaultValueInitialized: true 21 | OS: Windows 22 | Linux: 23 | enabled: 1 24 | settings: 25 | CPU: x86 26 | Linux64: 27 | enabled: 1 28 | settings: 29 | CPU: None 30 | LinuxUniversal: 31 | enabled: 1 32 | settings: 33 | CPU: AnyCPU 34 | OSXIntel: 35 | enabled: 1 36 | settings: 37 | CPU: AnyCPU 38 | OSXIntel64: 39 | enabled: 1 40 | settings: 41 | CPU: None 42 | OSXUniversal: 43 | enabled: 1 44 | settings: 45 | CPU: AnyCPU 46 | SamsungTV: 47 | enabled: 0 48 | settings: 49 | STV_MODEL: STANDARD_13 50 | WP8: 51 | enabled: 0 52 | settings: 53 | CPU: AnyCPU 54 | DontProcess: False 55 | PlaceholderPath: 56 | Win: 57 | enabled: 1 58 | settings: 59 | CPU: AnyCPU 60 | Win64: 61 | enabled: 0 62 | settings: 63 | CPU: None 64 | WindowsStoreApps: 65 | enabled: 0 66 | settings: 67 | CPU: AnyCPU 68 | DontProcess: False 69 | PlaceholderPath: 70 | SDK: AnySDK 71 | iOS: 72 | enabled: 0 73 | settings: 74 | CompileFlags: 75 | FrameworkDependencies: 76 | userData: 77 | assetBundleName: 78 | assetBundleVariant: 79 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Plugins/x86/msvcp120.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/Assets/Ist/Plugins/x86/msvcp120.dll -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Plugins/x86/msvcp120.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 500b9c6446c16024a8fe6aa33eed755c 3 | timeCreated: 1439213623 4 | licenseType: Pro 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | platformData: 11 | Android: 12 | enabled: 0 13 | settings: 14 | CPU: AnyCPU 15 | Any: 16 | enabled: 0 17 | settings: {} 18 | Editor: 19 | enabled: 1 20 | settings: 21 | CPU: x86 22 | DefaultValueInitialized: true 23 | OS: Windows 24 | Linux: 25 | enabled: 0 26 | settings: 27 | CPU: x86 28 | Linux64: 29 | enabled: 0 30 | settings: 31 | CPU: x86_64 32 | LinuxUniversal: 33 | enabled: 0 34 | settings: 35 | CPU: None 36 | OSXIntel: 37 | enabled: 0 38 | settings: 39 | CPU: AnyCPU 40 | OSXIntel64: 41 | enabled: 0 42 | settings: 43 | CPU: AnyCPU 44 | OSXUniversal: 45 | enabled: 0 46 | settings: 47 | CPU: None 48 | SamsungTV: 49 | enabled: 0 50 | settings: 51 | STV_MODEL: STANDARD_13 52 | WP8: 53 | enabled: 0 54 | settings: 55 | CPU: AnyCPU 56 | DontProcess: False 57 | PlaceholderPath: 58 | Win: 59 | enabled: 1 60 | settings: 61 | CPU: AnyCPU 62 | Win64: 63 | enabled: 0 64 | settings: 65 | CPU: AnyCPU 66 | WindowsStoreApps: 67 | enabled: 0 68 | settings: 69 | CPU: AnyCPU 70 | DontProcess: False 71 | PlaceholderPath: 72 | SDK: AnySDK 73 | iOS: 74 | enabled: 0 75 | settings: 76 | CompileFlags: 77 | FrameworkDependencies: 78 | userData: 79 | assetBundleName: 80 | assetBundleVariant: 81 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Plugins/x86/msvcr120.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/Assets/Ist/Plugins/x86/msvcr120.dll -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Plugins/x86/msvcr120.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d178eb956792d1d469d6c844a19e5fd1 3 | timeCreated: 1439213623 4 | licenseType: Pro 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | platformData: 11 | Android: 12 | enabled: 0 13 | settings: 14 | CPU: AnyCPU 15 | Any: 16 | enabled: 0 17 | settings: {} 18 | Editor: 19 | enabled: 1 20 | settings: 21 | CPU: x86 22 | DefaultValueInitialized: true 23 | OS: Windows 24 | Linux: 25 | enabled: 0 26 | settings: 27 | CPU: x86 28 | Linux64: 29 | enabled: 0 30 | settings: 31 | CPU: x86_64 32 | LinuxUniversal: 33 | enabled: 0 34 | settings: 35 | CPU: None 36 | OSXIntel: 37 | enabled: 0 38 | settings: 39 | CPU: AnyCPU 40 | OSXIntel64: 41 | enabled: 0 42 | settings: 43 | CPU: AnyCPU 44 | OSXUniversal: 45 | enabled: 0 46 | settings: 47 | CPU: None 48 | SamsungTV: 49 | enabled: 0 50 | settings: 51 | STV_MODEL: STANDARD_13 52 | WP8: 53 | enabled: 0 54 | settings: 55 | CPU: AnyCPU 56 | DontProcess: False 57 | PlaceholderPath: 58 | Win: 59 | enabled: 1 60 | settings: 61 | CPU: AnyCPU 62 | Win64: 63 | enabled: 0 64 | settings: 65 | CPU: AnyCPU 66 | WindowsStoreApps: 67 | enabled: 0 68 | settings: 69 | CPU: AnyCPU 70 | DontProcess: False 71 | PlaceholderPath: 72 | SDK: AnySDK 73 | iOS: 74 | enabled: 0 75 | settings: 76 | CompileFlags: 77 | FrameworkDependencies: 78 | userData: 79 | assetBundleName: 80 | assetBundleVariant: 81 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Plugins/x86/tbb.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/Assets/Ist/Plugins/x86/tbb.dll -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Plugins/x86/tbb.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 136c76aa852e67245a9265d92b7a8c05 3 | PluginImporter: 4 | serializedVersion: 1 5 | iconMap: {} 6 | executionOrder: {} 7 | isPreloaded: 0 8 | platformData: 9 | Android: 10 | enabled: 0 11 | settings: 12 | CPU: AnyCPU 13 | Any: 14 | enabled: 0 15 | settings: {} 16 | Editor: 17 | enabled: 1 18 | settings: 19 | CPU: x86 20 | DefaultValueInitialized: true 21 | OS: Windows 22 | Linux: 23 | enabled: 1 24 | settings: 25 | CPU: x86 26 | Linux64: 27 | enabled: 1 28 | settings: 29 | CPU: None 30 | LinuxUniversal: 31 | enabled: 1 32 | settings: 33 | CPU: AnyCPU 34 | OSXIntel: 35 | enabled: 1 36 | settings: 37 | CPU: AnyCPU 38 | OSXIntel64: 39 | enabled: 1 40 | settings: 41 | CPU: None 42 | OSXUniversal: 43 | enabled: 1 44 | settings: 45 | CPU: AnyCPU 46 | SamsungTV: 47 | enabled: 0 48 | settings: 49 | STV_MODEL: STANDARD_13 50 | WP8: 51 | enabled: 0 52 | settings: 53 | CPU: AnyCPU 54 | DontProcess: False 55 | PlaceholderPath: 56 | Win: 57 | enabled: 1 58 | settings: 59 | CPU: AnyCPU 60 | Win64: 61 | enabled: 0 62 | settings: 63 | CPU: None 64 | WindowsStoreApps: 65 | enabled: 0 66 | settings: 67 | CPU: AnyCPU 68 | DontProcess: False 69 | PlaceholderPath: 70 | SDK: AnySDK 71 | iOS: 72 | enabled: 0 73 | settings: 74 | CompileFlags: 75 | FrameworkDependencies: 76 | userData: 77 | assetBundleName: 78 | assetBundleVariant: 79 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Plugins/x86_64.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 026173cbbe9959d48aa4d3ed0b425f57 3 | folderAsset: yes 4 | timeCreated: 1427857592 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Plugins/x86_64/CopyToTexture.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/Assets/Ist/Plugins/x86_64/CopyToTexture.dll -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Plugins/x86_64/CopyToTexture.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 513ff46d24813214792c53b5b18a5a42 3 | timeCreated: 1439565872 4 | licenseType: Pro 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | platformData: 11 | Android: 12 | enabled: 0 13 | settings: 14 | CPU: AnyCPU 15 | Any: 16 | enabled: 0 17 | settings: {} 18 | Editor: 19 | enabled: 1 20 | settings: 21 | CPU: x86_64 22 | DefaultValueInitialized: true 23 | OS: Windows 24 | Linux: 25 | enabled: 1 26 | settings: 27 | CPU: x86 28 | Linux64: 29 | enabled: 1 30 | settings: 31 | CPU: x86_64 32 | LinuxUniversal: 33 | enabled: 1 34 | settings: 35 | CPU: AnyCPU 36 | OSXIntel: 37 | enabled: 1 38 | settings: 39 | CPU: AnyCPU 40 | OSXIntel64: 41 | enabled: 1 42 | settings: 43 | CPU: AnyCPU 44 | OSXUniversal: 45 | enabled: 1 46 | settings: 47 | CPU: AnyCPU 48 | SamsungTV: 49 | enabled: 0 50 | settings: 51 | STV_MODEL: STANDARD_13 52 | WP8: 53 | enabled: 0 54 | settings: 55 | CPU: AnyCPU 56 | DontProcess: False 57 | PlaceholderPath: 58 | Win: 59 | enabled: 0 60 | settings: 61 | CPU: None 62 | Win64: 63 | enabled: 1 64 | settings: 65 | CPU: AnyCPU 66 | WindowsStoreApps: 67 | enabled: 0 68 | settings: 69 | CPU: AnyCPU 70 | DontProcess: False 71 | PlaceholderPath: 72 | SDK: AnySDK 73 | iOS: 74 | enabled: 0 75 | settings: 76 | CompileFlags: 77 | FrameworkDependencies: 78 | userData: 79 | assetBundleName: 80 | assetBundleVariant: 81 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Plugins/x86_64/MassParticle.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/Assets/Ist/Plugins/x86_64/MassParticle.dll -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Plugins/x86_64/MassParticle.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bcacee4699745be43b13e4c4b995dbc2 3 | timeCreated: 1427857592 4 | licenseType: Pro 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | platformData: 11 | Android: 12 | enabled: 0 13 | settings: 14 | CPU: AnyCPU 15 | Any: 16 | enabled: 0 17 | settings: {} 18 | Editor: 19 | enabled: 1 20 | settings: 21 | CPU: x86_64 22 | DefaultValueInitialized: true 23 | OS: Windows 24 | Linux: 25 | enabled: 1 26 | settings: 27 | CPU: None 28 | Linux64: 29 | enabled: 1 30 | settings: 31 | CPU: x86_64 32 | LinuxUniversal: 33 | enabled: 1 34 | settings: 35 | CPU: AnyCPU 36 | OSXIntel: 37 | enabled: 1 38 | settings: 39 | CPU: None 40 | OSXIntel64: 41 | enabled: 1 42 | settings: 43 | CPU: AnyCPU 44 | OSXUniversal: 45 | enabled: 1 46 | settings: 47 | CPU: AnyCPU 48 | SamsungTV: 49 | enabled: 0 50 | settings: 51 | STV_MODEL: STANDARD_13 52 | WP8: 53 | enabled: 0 54 | settings: 55 | CPU: AnyCPU 56 | DontProcess: False 57 | PlaceholderPath: 58 | Win: 59 | enabled: 0 60 | settings: 61 | CPU: None 62 | Win64: 63 | enabled: 1 64 | settings: 65 | CPU: AnyCPU 66 | WindowsStoreApps: 67 | enabled: 0 68 | settings: 69 | CPU: AnyCPU 70 | DontProcess: False 71 | PlaceholderPath: 72 | SDK: AnySDK 73 | iOS: 74 | enabled: 0 75 | settings: 76 | CompileFlags: 77 | FrameworkDependencies: 78 | userData: 79 | assetBundleName: 80 | assetBundleVariant: 81 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Plugins/x86_64/MassParticleHelper.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/Assets/Ist/Plugins/x86_64/MassParticleHelper.dll -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Plugins/x86_64/MassParticleHelper.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 38e9bbdf35f44534480d6ba12e51a38e 3 | timeCreated: 1427857592 4 | licenseType: Pro 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | platformData: 11 | Android: 12 | enabled: 0 13 | settings: 14 | CPU: AnyCPU 15 | Any: 16 | enabled: 0 17 | settings: {} 18 | Editor: 19 | enabled: 1 20 | settings: 21 | CPU: x86_64 22 | DefaultValueInitialized: true 23 | OS: Windows 24 | Linux: 25 | enabled: 1 26 | settings: 27 | CPU: None 28 | Linux64: 29 | enabled: 1 30 | settings: 31 | CPU: x86_64 32 | LinuxUniversal: 33 | enabled: 1 34 | settings: 35 | CPU: AnyCPU 36 | OSXIntel: 37 | enabled: 1 38 | settings: 39 | CPU: None 40 | OSXIntel64: 41 | enabled: 1 42 | settings: 43 | CPU: AnyCPU 44 | OSXUniversal: 45 | enabled: 1 46 | settings: 47 | CPU: AnyCPU 48 | SamsungTV: 49 | enabled: 0 50 | settings: 51 | STV_MODEL: STANDARD_13 52 | WP8: 53 | enabled: 0 54 | settings: 55 | CPU: AnyCPU 56 | DontProcess: False 57 | PlaceholderPath: 58 | Win: 59 | enabled: 0 60 | settings: 61 | CPU: None 62 | Win64: 63 | enabled: 1 64 | settings: 65 | CPU: AnyCPU 66 | WindowsStoreApps: 67 | enabled: 0 68 | settings: 69 | CPU: AnyCPU 70 | DontProcess: False 71 | PlaceholderPath: 72 | SDK: AnySDK 73 | iOS: 74 | enabled: 0 75 | settings: 76 | CompileFlags: 77 | FrameworkDependencies: 78 | userData: 79 | assetBundleName: 80 | assetBundleVariant: 81 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Plugins/x86_64/msvcp120.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/Assets/Ist/Plugins/x86_64/msvcp120.dll -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Plugins/x86_64/msvcp120.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4b66c376a2240824ca51dc4d10e8113e 3 | timeCreated: 1439213623 4 | licenseType: Pro 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | platformData: 11 | Android: 12 | enabled: 0 13 | settings: 14 | CPU: AnyCPU 15 | Any: 16 | enabled: 0 17 | settings: {} 18 | Editor: 19 | enabled: 1 20 | settings: 21 | CPU: x86_64 22 | DefaultValueInitialized: true 23 | OS: Windows 24 | Linux: 25 | enabled: 0 26 | settings: 27 | CPU: x86 28 | Linux64: 29 | enabled: 0 30 | settings: 31 | CPU: x86_64 32 | LinuxUniversal: 33 | enabled: 0 34 | settings: 35 | CPU: None 36 | OSXIntel: 37 | enabled: 0 38 | settings: 39 | CPU: AnyCPU 40 | OSXIntel64: 41 | enabled: 0 42 | settings: 43 | CPU: AnyCPU 44 | OSXUniversal: 45 | enabled: 0 46 | settings: 47 | CPU: None 48 | SamsungTV: 49 | enabled: 0 50 | settings: 51 | STV_MODEL: STANDARD_13 52 | WP8: 53 | enabled: 0 54 | settings: 55 | CPU: AnyCPU 56 | DontProcess: False 57 | PlaceholderPath: 58 | Win: 59 | enabled: 0 60 | settings: 61 | CPU: AnyCPU 62 | Win64: 63 | enabled: 1 64 | settings: 65 | CPU: AnyCPU 66 | WindowsStoreApps: 67 | enabled: 0 68 | settings: 69 | CPU: AnyCPU 70 | DontProcess: False 71 | PlaceholderPath: 72 | SDK: AnySDK 73 | iOS: 74 | enabled: 0 75 | settings: 76 | CompileFlags: 77 | FrameworkDependencies: 78 | userData: 79 | assetBundleName: 80 | assetBundleVariant: 81 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Plugins/x86_64/msvcr120.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/Assets/Ist/Plugins/x86_64/msvcr120.dll -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Plugins/x86_64/msvcr120.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 844c8169cd36bbf45a64e79d7112867c 3 | timeCreated: 1439213623 4 | licenseType: Pro 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | platformData: 11 | Android: 12 | enabled: 0 13 | settings: 14 | CPU: AnyCPU 15 | Any: 16 | enabled: 0 17 | settings: {} 18 | Editor: 19 | enabled: 1 20 | settings: 21 | CPU: x86_64 22 | DefaultValueInitialized: true 23 | OS: Windows 24 | Linux: 25 | enabled: 0 26 | settings: 27 | CPU: x86 28 | Linux64: 29 | enabled: 0 30 | settings: 31 | CPU: x86_64 32 | LinuxUniversal: 33 | enabled: 0 34 | settings: 35 | CPU: None 36 | OSXIntel: 37 | enabled: 0 38 | settings: 39 | CPU: AnyCPU 40 | OSXIntel64: 41 | enabled: 0 42 | settings: 43 | CPU: AnyCPU 44 | OSXUniversal: 45 | enabled: 0 46 | settings: 47 | CPU: None 48 | SamsungTV: 49 | enabled: 0 50 | settings: 51 | STV_MODEL: STANDARD_13 52 | WP8: 53 | enabled: 0 54 | settings: 55 | CPU: AnyCPU 56 | DontProcess: False 57 | PlaceholderPath: 58 | Win: 59 | enabled: 0 60 | settings: 61 | CPU: AnyCPU 62 | Win64: 63 | enabled: 1 64 | settings: 65 | CPU: AnyCPU 66 | WindowsStoreApps: 67 | enabled: 0 68 | settings: 69 | CPU: AnyCPU 70 | DontProcess: False 71 | PlaceholderPath: 72 | SDK: AnySDK 73 | iOS: 74 | enabled: 0 75 | settings: 76 | CompileFlags: 77 | FrameworkDependencies: 78 | userData: 79 | assetBundleName: 80 | assetBundleVariant: 81 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Plugins/x86_64/tbb.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/Assets/Ist/Plugins/x86_64/tbb.dll -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Plugins/x86_64/tbb.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d993eb22b480f28499ce63ee217c3e69 3 | timeCreated: 1427857592 4 | licenseType: Pro 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | platformData: 11 | Android: 12 | enabled: 0 13 | settings: 14 | CPU: AnyCPU 15 | Any: 16 | enabled: 0 17 | settings: {} 18 | Editor: 19 | enabled: 1 20 | settings: 21 | CPU: x86_64 22 | DefaultValueInitialized: true 23 | OS: Windows 24 | Linux: 25 | enabled: 1 26 | settings: 27 | CPU: None 28 | Linux64: 29 | enabled: 1 30 | settings: 31 | CPU: x86_64 32 | LinuxUniversal: 33 | enabled: 1 34 | settings: 35 | CPU: AnyCPU 36 | OSXIntel: 37 | enabled: 1 38 | settings: 39 | CPU: None 40 | OSXIntel64: 41 | enabled: 1 42 | settings: 43 | CPU: AnyCPU 44 | OSXUniversal: 45 | enabled: 1 46 | settings: 47 | CPU: AnyCPU 48 | SamsungTV: 49 | enabled: 0 50 | settings: 51 | STV_MODEL: STANDARD_13 52 | WP8: 53 | enabled: 0 54 | settings: 55 | CPU: AnyCPU 56 | DontProcess: False 57 | PlaceholderPath: 58 | Win: 59 | enabled: 0 60 | settings: 61 | CPU: None 62 | Win64: 63 | enabled: 1 64 | settings: 65 | CPU: AnyCPU 66 | WindowsStoreApps: 67 | enabled: 0 68 | settings: 69 | CPU: AnyCPU 70 | DontProcess: False 71 | PlaceholderPath: 72 | SDK: AnySDK 73 | iOS: 74 | enabled: 0 75 | settings: 76 | CompileFlags: 77 | FrameworkDependencies: 78 | userData: 79 | assetBundleName: 80 | assetBundleVariant: 81 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Utilities.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5a0788e1fa59db148b10d8490d09ea3a 3 | folderAsset: yes 4 | timeCreated: 1437671930 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Utilities/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5448922c40947214b9eba2004b7a354d 3 | folderAsset: yes 4 | timeCreated: 1437671930 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Utilities/Scripts/ICommandBufferRenderer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.Rendering; 5 | #if UNITY_EDITOR 6 | using UnityEditor; 7 | #endif // UNITY_EDITOR 8 | 9 | namespace Ist 10 | { 11 | 12 | public abstract class ICommandBufferRenderer : Singleton where T : MonoBehaviour 13 | { 14 | CommandBuffer m_commands; 15 | HashSet m_cameras = new HashSet(); 16 | int m_nth; 17 | 18 | void OnDisable() 19 | { 20 | if (m_commands != null) 21 | { 22 | foreach (var cam in m_cameras) 23 | { 24 | if (cam != null) 25 | { 26 | RemoveCommandBuffer(cam, m_commands); 27 | } 28 | } 29 | m_cameras.Clear(); 30 | } 31 | } 32 | 33 | 34 | public void _OnWillRenderObject() 35 | { 36 | if (!gameObject.activeInHierarchy && !enabled) { return; } 37 | 38 | if (m_nth++ == 0) 39 | { 40 | if (m_commands == null) 41 | { 42 | m_commands = new CommandBuffer(); 43 | m_commands.name = GetCommandBufferName(); 44 | } 45 | UpdateCommandBuffer(m_commands); 46 | } 47 | 48 | var cam = Camera.current; 49 | if (!cam) { return; } 50 | if (!m_cameras.Contains(cam)) 51 | { 52 | AddCommandBuffer(cam, m_commands); 53 | m_cameras.Add(cam); 54 | } 55 | } 56 | 57 | public void _OnRenderObject() 58 | { 59 | m_nth = 0; 60 | } 61 | 62 | protected virtual string GetCommandBufferName() { return typeof(T).Name; } 63 | protected abstract void AddCommandBuffer(Camera cam, CommandBuffer cb); 64 | protected abstract void RemoveCommandBuffer(Camera cam, CommandBuffer cb); 65 | protected abstract void UpdateCommandBuffer(CommandBuffer cb); 66 | } 67 | } -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Utilities/Scripts/ICommandBufferRenderer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 16b7d1f44844f3849931e2c3233ff04d 3 | timeCreated: 1437671930 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Utilities/Scripts/IcoSphere.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b1bcf87e4f65cb74fa619533df080a39 3 | timeCreated: 1438524765 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Utilities/Scripts/InstanceSet.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.Rendering; 5 | #if UNITY_EDITOR 6 | using UnityEditor; 7 | #endif // UNITY_EDITOR 8 | 9 | namespace Ist 10 | { 11 | 12 | public abstract class InstanceSet : MonoBehaviour where T : InstanceSet 13 | { 14 | #region static 15 | static HashSet s_instances; 16 | 17 | static public HashSet GetInstances() 18 | { 19 | if (s_instances == null) { s_instances = new HashSet(); } 20 | return s_instances; 21 | } 22 | #endregion 23 | 24 | 25 | public virtual void OnEnable() 26 | { 27 | GetInstances().Add(this as T); 28 | } 29 | 30 | public virtual void OnDisable() 31 | { 32 | GetInstances().Remove(this as T); 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Utilities/Scripts/InstanceSet.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 550d8ef88069efb4b9e0eabb859c17fa 3 | timeCreated: 1437586625 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Utilities/Scripts/MeshUtils.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ebb990f69f9544340b0c7701046da135 3 | timeCreated: 1437673199 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Utilities/Scripts/MouseCameraControl.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Threading; 5 | 6 | namespace Ist 7 | { 8 | [ExecuteInEditMode] 9 | public class MouseCameraControl : MonoBehaviour 10 | { 11 | public bool m_rotate_by_time = false; 12 | public float m_rotate_speed = -10.0f; 13 | public Camera m_camera; 14 | public Transform m_look_target; 15 | 16 | public float m_follow_strength = 0.2f; 17 | public Vector3 m_target_offset; 18 | Vector3 m_look_pos; 19 | 20 | void Awake() 21 | { 22 | m_look_pos = m_look_target.position; 23 | } 24 | 25 | void Update() 26 | { 27 | if (m_camera == null || m_look_target == null) return; 28 | Transform t = GetComponent(); 29 | Transform cam_t = m_camera.GetComponent(); 30 | 31 | if (Input.GetKeyUp(KeyCode.R)) { m_rotate_by_time = !m_rotate_by_time; } 32 | 33 | Vector3 pos = cam_t.position - m_look_target.position; 34 | if (m_rotate_by_time) 35 | { 36 | pos = Quaternion.Euler(0.0f, Time.deltaTime * m_rotate_speed, 0) * pos; 37 | } 38 | if (Input.GetMouseButton(0) || Input.GetMouseButton(1)) 39 | { 40 | float ry = Input.GetAxis("Mouse X") * 3.0f; 41 | float rxz = Input.GetAxis("Mouse Y") * 0.25f; 42 | pos = Quaternion.Euler(0.0f, ry, 0) * pos; 43 | pos.y += rxz; 44 | } 45 | { 46 | float wheel = Input.GetAxis("Mouse ScrollWheel"); 47 | pos += pos.normalized * wheel * 4.0f; 48 | } 49 | cam_t.position = pos + m_look_target.position; 50 | 51 | if (Input.GetMouseButton(2)) 52 | { 53 | float xz = Input.GetAxis("Mouse X") * -0.1f; 54 | float y = Input.GetAxis("Mouse Y") * -0.1f; 55 | var rel = m_camera.cameraToWorldMatrix * new Vector4(xz, y, 0.0f, 0.0f); 56 | t.position = t.position + (Vector3)rel; 57 | m_look_pos = m_look_pos + (Vector3)rel; 58 | } 59 | 60 | m_look_pos += (m_look_target.position - m_look_pos) * m_follow_strength; 61 | cam_t.transform.LookAt(m_look_pos + m_target_offset); 62 | 63 | 64 | if (Input.GetKeyUp(KeyCode.F1)) 65 | { 66 | Cursor.visible = !Cursor.visible; 67 | } 68 | } 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Utilities/Scripts/MouseCameraControl.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cbebbe0f7a8ad7b47a7ad82aed9d20d8 3 | timeCreated: 1426421297 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Utilities/Textures.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b5b077bbba51f4444835bba82ca1338b 3 | folderAsset: yes 4 | timeCreated: 1437843658 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Utilities/Textures/RandomVectors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/Assets/Ist/Utilities/Textures/RandomVectors.png -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/Ist/Utilities/Textures/RandomVectors.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 11acc7215703f614292e8fbdb3c6720b 3 | timeCreated: 1437843659 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | linearTexture: 0 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: .25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 8 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -3 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: -1 34 | mipBias: -1 35 | wrapMode: -1 36 | nPOTScale: 1 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 0 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: .5, y: .5} 46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 0 49 | textureType: -1 50 | buildTargetSettings: [] 51 | spriteSheet: 52 | sprites: [] 53 | spritePackingTag: 54 | userData: 55 | assetBundleName: 56 | assetBundleVariant: 57 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/TestColliderForGPUParticle.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/Assets/TestColliderForGPUParticle.unity -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/TestColliderForGPUParticle.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fadd1e9de7434a04586aed085724a2f5 3 | timeCreated: 1448022622 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/TestGBuffer.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/Assets/TestGBuffer.unity -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/TestGBuffer.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ccc801b1577aa75439abf6ad9ed72aa1 3 | timeCreated: 1447682772 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/TestRaycast.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/Assets/TestRaycast.unity -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/TestRaycast.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 21752820a63e704488f7b6a0f9e9617b 3 | timeCreated: 1445921516 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/UTJ.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c4182c62fe3929d478d4eddcd27c4b53 3 | folderAsset: yes 4 | timeCreated: 1492154231 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/UTJ/OSD.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d14b0fe2c8393374a82288c5bb377934 3 | folderAsset: yes 4 | timeCreated: 1492154231 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/UTJ/OSD/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2a2a0d78824af9a4abc65d9159dd955b 3 | folderAsset: yes 4 | timeCreated: 1492154231 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/UTJ/OSD/Editor/Misc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6d2655fa8837c87498708011bfec76e5 3 | folderAsset: yes 4 | timeCreated: 1492157391 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/UTJ/OSD/Editor/Misc/LayerSelectorDrawer.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | namespace UTJ.OSD 5 | { 6 | [CustomPropertyDrawer(typeof(LayerSelector))] 7 | class LayerSelectorDrawer : PropertyDrawer 8 | { 9 | public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) 10 | { 11 | EditorGUI.BeginProperty(position, label, property); 12 | position = EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), label); 13 | 14 | var indent = EditorGUI.indentLevel; 15 | EditorGUI.indentLevel = 0; 16 | 17 | var p = property.FindPropertyRelative("v"); 18 | int value = p.intValue; 19 | 20 | EditorGUI.BeginChangeCheck(); 21 | value = EditorGUI.LayerField(position, value); 22 | if (EditorGUI.EndChangeCheck()) 23 | { 24 | p.intValue = value; 25 | } 26 | 27 | EditorGUI.indentLevel = indent; 28 | EditorGUI.EndProperty(); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/UTJ/OSD/Editor/Misc/LayerSelectorDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 846328b2103a09148890f932a8a2ef71 3 | timeCreated: 1492157391 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/UTJ/OSD/Plugins.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 292b5d0c54eb22849acfea641c126c42 3 | folderAsset: yes 4 | timeCreated: 1492154261 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/UTJ/OSD/Plugins/x86_64.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 365ed8494918b284aa4faf9bd0ee211b 3 | folderAsset: yes 4 | timeCreated: 1492158379 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/UTJ/OSD/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 88cb81a35939bfb4aae9fc00e8f8a313 3 | folderAsset: yes 4 | timeCreated: 1492154231 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/UTJ/OSD/Scripts/Misc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d4743baf5f4257146be4829632bd4591 3 | folderAsset: yes 4 | timeCreated: 1492157391 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/UTJ/OSD/Scripts/Misc/LayerSelector.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace UTJ.OSD 5 | { 6 | [Serializable] 7 | public struct LayerSelector 8 | { 9 | [SerializeField] 10 | int v; 11 | public static implicit operator int(LayerSelector v) { return v.v; } 12 | public static implicit operator LayerSelector(int v) { LayerSelector r; r.v = v; return r; } 13 | } 14 | } -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/UTJ/OSD/Scripts/Misc/LayerSelector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b5af247f7e78c5a428dbc9a5a9cf762e 3 | timeCreated: 1492157391 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/UTJ/OSD/Scripts/SubdivisionRenderer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fa8f1b7b25f49f848b7f892341c70030 3 | timeCreated: 1492157198 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/UTJ/OSD/Shaders.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0f0030295c75bf34288a992276462e6a 3 | folderAsset: yes 4 | timeCreated: 1492154231 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/smcs.rsp: -------------------------------------------------------------------------------- 1 | -unsafe 2 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/Assets/smcs.rsp.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f73432db518d25146b218094a8305ee2 3 | timeCreated: 1447779787 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/ProjectSettings/AudioManager.asset -------------------------------------------------------------------------------- /OpenSubdivForUnity/ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/ProjectSettings/ClusterInputManager.asset -------------------------------------------------------------------------------- /OpenSubdivForUnity/ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/ProjectSettings/DynamicsManager.asset -------------------------------------------------------------------------------- /OpenSubdivForUnity/ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/ProjectSettings/EditorBuildSettings.asset -------------------------------------------------------------------------------- /OpenSubdivForUnity/ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/ProjectSettings/EditorSettings.asset -------------------------------------------------------------------------------- /OpenSubdivForUnity/ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/ProjectSettings/GraphicsSettings.asset -------------------------------------------------------------------------------- /OpenSubdivForUnity/ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/ProjectSettings/InputManager.asset -------------------------------------------------------------------------------- /OpenSubdivForUnity/ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/ProjectSettings/NavMeshAreas.asset -------------------------------------------------------------------------------- /OpenSubdivForUnity/ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/ProjectSettings/NetworkManager.asset -------------------------------------------------------------------------------- /OpenSubdivForUnity/ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/ProjectSettings/Physics2DSettings.asset -------------------------------------------------------------------------------- /OpenSubdivForUnity/ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/ProjectSettings/ProjectSettings.asset -------------------------------------------------------------------------------- /OpenSubdivForUnity/ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 5.6.0f3 2 | -------------------------------------------------------------------------------- /OpenSubdivForUnity/ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/ProjectSettings/QualitySettings.asset -------------------------------------------------------------------------------- /OpenSubdivForUnity/ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/ProjectSettings/TagManager.asset -------------------------------------------------------------------------------- /OpenSubdivForUnity/ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/ProjectSettings/TimeManager.asset -------------------------------------------------------------------------------- /OpenSubdivForUnity/ProjectSettings/UnityAdsSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/ProjectSettings/UnityAdsSettings.asset -------------------------------------------------------------------------------- /OpenSubdivForUnity/ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/OpenSubdivForUnity/ProjectSettings/UnityConnectSettings.asset -------------------------------------------------------------------------------- /Plugin/External/7z/7za.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/Plugin/External/7z/7za.exe -------------------------------------------------------------------------------- /Plugin/External/libs1.7z: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/i-saint/OpenSubdivForUnity/55b2a06d0b4c44fd081baf1a1b135a59b1d27b6d/Plugin/External/libs1.7z -------------------------------------------------------------------------------- /Plugin/osdi.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25123.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "osdi", "osdi.vcxproj", "{08361722-5520-47AC-A0C2-31E8A062B73F}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Master|x64 = Master|x64 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {08361722-5520-47AC-A0C2-31E8A062B73F}.Debug|x64.ActiveCfg = Master|x64 15 | {08361722-5520-47AC-A0C2-31E8A062B73F}.Debug|x64.Build.0 = Master|x64 16 | {08361722-5520-47AC-A0C2-31E8A062B73F}.Master|x64.ActiveCfg = Master|x64 17 | {08361722-5520-47AC-A0C2-31E8A062B73F}.Master|x64.Build.0 = Master|x64 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /Plugin/osdi.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | osdi 6 | 7 | 8 | osdi 9 | 10 | 11 | osdi\BezierPatch 12 | 13 | 14 | osdi\BezierPatch 15 | 16 | 17 | osdi\BezierPatch 18 | 19 | 20 | 21 | 22 | osdi 23 | 24 | 25 | osdi 26 | 27 | 28 | osdi 29 | 30 | 31 | osdi\BezierPatch 32 | 33 | 34 | osdi\BezierPatch 35 | 36 | 37 | osdi\BezierPatch 38 | 39 | 40 | 41 | 42 | {f44210f1-192b-4a77-ba1d-6607e886ec1b} 43 | 44 | 45 | {3629eddf-da68-425f-a8a9-492ff6970f20} 46 | 47 | 48 | -------------------------------------------------------------------------------- /Plugin/osdi/BezierPatch/BezierPatch.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace osdi { 4 | 5 | class BezierPatch 6 | { 7 | public: 8 | BezierPatch(); 9 | BezierPatch(const float3 *p); 10 | BezierPatch(const BezierPatch &other); 11 | BezierPatch(const BezierPatch &other, float u0, float u1, float v0, float v1); 12 | BezierPatch(const BezierPatch &other, const float3x3 &m); 13 | BezierPatch(const BezierPatch &other, const float4x4 &m); 14 | 15 | float3& operator[](int i) { return m_cp[i]; } 16 | const float3& operator[](int i) const { return m_cp[i]; } 17 | const float3& Get(int i, int j) const; 18 | void Set(int i, int j, const float3& v); 19 | 20 | float3 GetMin() const; 21 | float3 GetMax() const; 22 | void GetMinMax(float3 &o_min, float3 &o_max, float epsilon=0.0f) const; 23 | float3 GetRoughNormal() const; 24 | 25 | float3 Evaluate(const float2& uv) const; 26 | float3 EvaluateDu(const float2& uv) const; 27 | float3 EvaluateDv(const float2& uv) const; 28 | float3 EvaluateNormal(const float2& uv) const; 29 | void Split(BezierPatch &dst0, BezierPatch &dst1, BezierPatch &dst2, BezierPatch &dst3, const float2& uv) const; 30 | void SplitU(BezierPatch &dst0, BezierPatch &dst1, float u) const; 31 | void SplitV(BezierPatch &dst0, BezierPatch &dst1, float v) const; 32 | void Crop(BezierPatch &dst, const float2& uv0, const float2& uv1) const; 33 | void CropU(BezierPatch &dst, float u0, float u1) const; 34 | void CropV(BezierPatch &dst, float v0, float v1) const; 35 | float3 GetLv() const; 36 | float3 GetLu() const; 37 | 38 | void Transpose(); 39 | void Transform(const float3x3 &m); 40 | void Transform(const float4x4 &m); 41 | 42 | // F: [](float3 &control_point) -> void 43 | template 44 | void ForEach(const F &f) 45 | { 46 | for (int i = 0; i < 16; ++i) { f(m_cp[i]); } 47 | } 48 | 49 | private: 50 | float3 m_cp[16]; 51 | }; 52 | 53 | } // namespace osdi 54 | -------------------------------------------------------------------------------- /Plugin/osdi/BezierPatch/BezierPatchConverter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace osdi { 4 | 5 | class BezierPatchConverter 6 | { 7 | public: 8 | BezierPatchConverter(int num_vertices); 9 | ~BezierPatchConverter(); 10 | void Clear(); 11 | void Convert(int num_vertices, const float3 *vertices); 12 | void Convert(int num_indices, const float3 *vertices, const uint32_t *indices); 13 | void Convert(int num_indices, const float3 *vertices, const uint16_t *indices); 14 | 15 | const std::vector& GetBezierPatches() const; 16 | 17 | private: 18 | std::vector m_bezier_patches; 19 | std::vector m_sharpnesses; 20 | 21 | OpenSubdiv::Osd::CpuVertexBuffer *m_vertex_buffer; 22 | OpenSubdiv::Far::TopologyRefiner *m_topology_refiner; 23 | OpenSubdiv::Far::PatchTable *m_patch_table; 24 | const OpenSubdiv::Far::StencilTable *m_stencil_table; 25 | }; 26 | 27 | } // namespace osdi 28 | -------------------------------------------------------------------------------- /Plugin/osdi/BezierPatch/BezierPatchIntersection.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "BezierPatch.h" 4 | 5 | namespace osdi { 6 | 7 | struct Ray 8 | { 9 | float3 orig; 10 | float3 dir; 11 | }; 12 | 13 | struct BezierPatchHit 14 | { 15 | float2 uv; 16 | float t; 17 | uint32_t clip_level; 18 | }; 19 | 20 | bool BezierPatchRaycast(const BezierPatch &bp, const Ray &ray, float zmin, float zmax, float epsilon, BezierPatchHit &hit); 21 | bool BezierPatchRaycast(const BezierPatch &bp, const float4x4 &trans, const Ray &ray, float zmin, float zmax, float epsilon, BezierPatchHit &hit); 22 | 23 | } // namespace osdi 24 | -------------------------------------------------------------------------------- /Plugin/osdi/osdi.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef _MSC_VER 4 | #define osdiAPI extern "C" __declspec(dllexport) 5 | #else 6 | #define osdiAPI extern "C" __attribute__((visibility("default"))) 7 | #endif 8 | 9 | namespace osdi { 10 | class Context; 11 | struct BezierPatch; 12 | struct BezierPatchHit; 13 | struct Ray; 14 | } // namespace osdi 15 | 16 | struct cfloat2 { float v[2]; }; // to shut up compiler 17 | struct cfloat3 { float v[3]; }; // 18 | struct cfloat4 { float v[4]; }; // 19 | 20 | osdiAPI osdi::Context* osdiCreateContext(); 21 | osdiAPI void osdiDestroyContext(osdi::Context* ctx); 22 | 23 | 24 | 25 | osdiAPI void osdiBPGetMinMax(const osdi::BezierPatch *bp, float3 *omin, float3 *omax, float eps); 26 | osdiAPI cfloat3 osdiBPGetRoughNormal(const osdi::BezierPatch *bp); 27 | osdiAPI cfloat3 osdiBPEvaluate(const osdi::BezierPatch *bp, const float2 *uv); 28 | osdiAPI cfloat3 osdiBPEvaluateNormal(const osdi::BezierPatch *bp, const float2 *uv); 29 | osdiAPI void osdiBPSplit(const osdi::BezierPatch *bp, osdi::BezierPatch *dst0, osdi::BezierPatch *dst1, osdi::BezierPatch *dst2, osdi::BezierPatch *dst3, const float2 *uv); 30 | osdiAPI void osdiBPSplitU(const osdi::BezierPatch *bp, osdi::BezierPatch *dst0, osdi::BezierPatch *dst1, float u); 31 | osdiAPI void osdiBPSplitV(const osdi::BezierPatch *bp, osdi::BezierPatch *dst0, osdi::BezierPatch *dst1, float v); 32 | osdiAPI void osdiBPCrop(const osdi::BezierPatch *bp, osdi::BezierPatch *dst, const float2 *uv0, const float2 *uv1); 33 | osdiAPI void osdiBPCropU(const osdi::BezierPatch *bp, osdi::BezierPatch *dst, float u0, float u1); 34 | osdiAPI void osdiBPCropV(const osdi::BezierPatch *bp, osdi::BezierPatch *dst, float v0, float v1); 35 | osdiAPI void osdiBPTransform(osdi::BezierPatch *bp, float4x4 *mat); 36 | 37 | osdiAPI bool osdiBPRaycast(const osdi::BezierPatch *bp, const float3 *orig, const float3 *dir, float zmin, float zmax, float epsilon, osdi::BezierPatchHit *hit); 38 | osdiAPI bool osdiBPRaycastWithTransform(const osdi::BezierPatch *bp, const float4x4 *trans, const float3 *orig, const float3 *dir, float zmin, float zmax, float epsilon, osdi::BezierPatchHit *hit); 39 | -------------------------------------------------------------------------------- /Plugin/osdi/osuInternal.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef _WIN32 4 | #define osuWindows 5 | #endif // _WIN32 6 | 7 | 8 | #ifdef osuDebug 9 | void osuDebugLogImpl(const char* fmt, ...); 10 | #define osuDebugLog(...) osuDebugLogImpl(__VA_ARGS__) 11 | #ifdef osuVerboseDebug 12 | #define osuDebugLogVerbose(...) osuDebugLogImpl(__VA_ARGS__) 13 | #else 14 | #define osuDebugLogVerbose(...) 15 | #endif 16 | #else 17 | #define osuDebugLog(...) 18 | #define osuDebugLogVerbose(...) 19 | #endif 20 | 21 | typedef glm::vec2 float2; 22 | typedef glm::vec3 float3; 23 | typedef glm::vec4 float4; 24 | typedef glm::mat2x2 float2x2; 25 | typedef glm::mat3x3 float3x3; 26 | typedef glm::mat4x4 float4x4; 27 | -------------------------------------------------------------------------------- /Plugin/osdi/pch.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | -------------------------------------------------------------------------------- /Plugin/osdi/pch.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | 11 | 12 | #ifdef _MSC_VER 13 | #define and && 14 | #define and_eq &= 15 | #define bitand & 16 | #define bitor | 17 | #define compl ~ 18 | #define not ! 19 | #define not_eq != 20 | #define or || 21 | #define or_eq |= 22 | #define xor ^ 23 | #define xor_eq ^= 24 | #endif 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | 39 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # OpenSubdivForUnity 2 | work in progress. 3 | - [x] implement [Direct Ray Tracing of Full-Featured Subdivision Surfaces with Bezier Clipping](http://jcgt.org/published/0004/01/04/) 4 | - [ ] implement mesh -> bezier pacthes converter by using [OpenSubdiv](http://graphics.pixar.com/opensubdiv/) 5 | - [ ] implement [Alembic](http://www.alembic.io/) SubD loader (almost done in [AlembicImporter](https://github.com/unity3d-jp/AlembicImporter)) 6 | - [ ] implement normal (= non raytracer) subdivisiom mesh renderer 7 | -------------------------------------------------------------------------------- /setup.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | cd Plugin\external 4 | 7z\7za.exe x -aos libs1.7z 5 | --------------------------------------------------------------------------------