master
uc-hoba 8 years ago
parent bdf9359e78
commit b3e32dd017
  1. 2634
      Unity_2018_Frozen/Assets/Frozen/Frozen Flow.unity
  2. 9
      Unity_2018_Frozen/Assets/Frozen/Frozen Flow.unity.meta
  3. 1287
      Unity_2018_Frozen/Assets/Frozen/Frozen.unity
  4. 30
      Unity_2018_Frozen/Assets/Frozen/FrozenParticleUniforms.asset
  5. 10
      Unity_2018_Frozen/Assets/Frozen/FrozenParticleUniforms.asset.meta
  6. 6
      Unity_2018_Frozen/Assets/Frozen/Material/Point.mat
  7. 76
      Unity_2018_Frozen/Assets/Frozen/Material/Space.mat
  8. 10
      Unity_2018_Frozen/Assets/Frozen/Material/Space.mat.meta
  9. 76
      Unity_2018_Frozen/Assets/Frozen/PostProcessingProfile.asset
  10. 120
      Unity_2018_Frozen/Assets/Frozen/Script/DFVolumeParticleUpdater.cs
  11. 13
      Unity_2018_Frozen/Assets/Frozen/Script/DFVolumeParticleUpdater.cs.meta
  12. 4
      Unity_2018_Frozen/Assets/Frozen/Script/SnowflakeParticleUpdater.cs
  13. 146
      Unity_2018_Frozen/Assets/Frozen/Script/SpaceMeshGenerator.cs
  14. 13
      Unity_2018_Frozen/Assets/Frozen/Script/SpaceMeshGenerator.cs.meta
  15. 221
      Unity_2018_Frozen/Assets/Frozen/Shader/DFVolumeParticleUpdate.compute
  16. 10
      Unity_2018_Frozen/Assets/Frozen/Shader/DFVolumeParticleUpdate.compute.meta
  17. 4
      Unity_2018_Frozen/Assets/Frozen/Shader/FrozenParticleUnlitPoint.shader
  18. 50
      Unity_2018_Frozen/Assets/Frozen/Shader/SnowflakeParticleUpdate.compute
  19. 6
      Unity_2018_Frozen/Assets/Frozen/Texture/RenderTexture-Final.renderTexture
  20. 10
      Unity_2018_Frozen/Assets/Frozen/Texture/RenderTexture-Final.renderTexture.meta
  21. 33
      Unity_2018_Frozen/Assets/Frozen/Texture/RenderTexture-Particle.renderTexture
  22. 0
      Unity_2018_Frozen/Assets/Frozen/Texture/RenderTexture-Particle.renderTexture.meta
  23. 33
      Unity_2018_Frozen/Assets/Frozen/Texture/RenderTexture-Scene.renderTexture
  24. 10
      Unity_2018_Frozen/Assets/Frozen/Texture/RenderTexture-Scene.renderTexture.meta
  25. 3
      Unity_2018_Frozen/Assets/Frozen/Texture/frozen_checker.png
  26. 97
      Unity_2018_Frozen/Assets/Frozen/Texture/frozen_checker.png.meta
  27. 3
      Unity_2018_Frozen/Assets/Frozen/Texture/space-dark-mountain-v1.png
  28. 97
      Unity_2018_Frozen/Assets/Frozen/Texture/space-dark-mountain-v1.png.meta
  29. 3
      Unity_2018_Frozen/Assets/Frozen/Texture/space-ice-forest-v1.png
  30. 97
      Unity_2018_Frozen/Assets/Frozen/Texture/space-ice-forest-v1.png.meta
  31. 4
      Unity_2018_Frozen/Assets/ParticleWorks/Script/ParticleViewerProcedural.cs
  32. 16
      Unity_2018_Frozen/ProjectSettings/QualitySettings.asset
  33. 4
      Unity_2018_Frozen/ProjectSettings/TagManager.asset

File diff suppressed because it is too large Load Diff

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: a170ccfe16afc4e468c54ba020aca432
timeCreated: 1519717513
licenseType: Free
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

@ -0,0 +1,30 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 852ced439e5120c44bd352e9c29a164f, type: 3}
m_Name: FrozenParticleUniforms
m_EditorClassIdentifier:
numRate: 1
movement: 1
geomSize: 0.074
velocityDamping: 0.95
lifeDuration: 10
lifeVariation: 0
convergence: 0
homeStrength: 0
noiseStrength: 0.055
noiseSeed: 0.5
noiseTimeScale: 1
noiseFrequency: 0.731
forceDirection: {x: 0, y: 0, z: 1}
forceStrength: 0
impulsePosition: {x: 0, y: 0, z: 0}
impulseRadius: 3
impulseStrength: 0.06

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 43a114cac50c03e4ea881a51dbb6e7bd
timeCreated: 1513320663
licenseType: Free
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

@ -69,7 +69,7 @@ Material:
- _DistortionStrength: 1 - _DistortionStrength: 1
- _DistortionStrengthScaled: 0 - _DistortionStrengthScaled: 0
- _DstBlend: 0 - _DstBlend: 0
- _Emission: 5 - _Emission: 0
- _EmissionEnabled: 0 - _EmissionEnabled: 0
- _FlipbookMode: 0 - _FlipbookMode: 0
- _GlossMapScale: 1 - _GlossMapScale: 1
@ -81,7 +81,7 @@ Material:
- _Mode: 0 - _Mode: 0
- _OcclusionStrength: 1 - _OcclusionStrength: 1
- _Parallax: 0.02 - _Parallax: 0.02
- _Size: 0.003 - _Size: 0.005
- _SmoothnessTextureChannel: 0 - _SmoothnessTextureChannel: 0
- _SoftParticlesEnabled: 0 - _SoftParticlesEnabled: 0
- _SoftParticlesFarFadeDistance: 1 - _SoftParticlesFarFadeDistance: 1
@ -92,7 +92,7 @@ Material:
- _ZWrite: 1 - _ZWrite: 1
m_Colors: m_Colors:
- _CameraFadeParams: {r: 0, g: Infinity, b: 0, a: 0} - _CameraFadeParams: {r: 0, g: Infinity, b: 0, a: 0}
- _Color: {r: 0.7132353, g: 0.9620458, b: 1, a: 1} - _Color: {r: 0.24699998, g: 0.534646, b: 1, a: 1}
- _ColorAddSubDiff: {r: 0, g: 0, b: 0, a: 0} - _ColorAddSubDiff: {r: 0, g: 0, b: 0, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SoftParticleFadeParams: {r: 0, g: 0, b: 0, a: 0} - _SoftParticleFadeParams: {r: 0, g: 0, b: 0, a: 0}

@ -0,0 +1,76 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Space
m_Shader: {fileID: 10752, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 7ec1ec22e0e868244b68c7c04331baea, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: c1451959794f55e4e90241e1720a9e08
timeCreated: 1521000028
licenseType: Free
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

@ -14,8 +14,6 @@ MonoBehaviour:
settings: settings:
- {fileID: 114067151945234240} - {fileID: 114067151945234240}
- {fileID: 114157877957889540} - {fileID: 114157877957889540}
- {fileID: 114891676506052672}
- {fileID: 114967782660637982}
--- !u!114 &114067151945234240 --- !u!114 &114067151945234240
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 3 m_ObjectHideFlags: 3
@ -33,7 +31,7 @@ MonoBehaviour:
value: 1 value: 1
intensity: intensity:
overrideState: 1 overrideState: 1
value: 1 value: 20
threshold: threshold:
overrideState: 1 overrideState: 1
value: 1.1 value: 1.1
@ -47,16 +45,16 @@ MonoBehaviour:
overrideState: 0 overrideState: 0
value: 0 value: 0
color: color:
overrideState: 0 overrideState: 1
value: {r: 1, g: 1, b: 1, a: 1} value: {r: 1, g: 1, b: 1, a: 1}
fastMode: fastMode:
overrideState: 0 overrideState: 0
value: 0 value: 0
dirtTexture: dirtTexture:
overrideState: 1 overrideState: 0
value: {fileID: 2800000, guid: 3884f7a2d04ffe8409ad9200b275896f, type: 3} value: {fileID: 2800000, guid: 3884f7a2d04ffe8409ad9200b275896f, type: 3}
dirtIntensity: dirtIntensity:
overrideState: 1 overrideState: 0
value: 1 value: 1
--- !u!114 &114157877957889540 --- !u!114 &114157877957889540
MonoBehaviour: MonoBehaviour:
@ -125,11 +123,11 @@ MonoBehaviour:
overrideState: 0 overrideState: 0
value: 0 value: 0
postExposure: postExposure:
overrideState: 0 overrideState: 1
value: 0 value: 0
contrast: contrast:
overrideState: 0 overrideState: 1
value: 0 value: 17
mixerRedOutRedIn: mixerRedOutRedIn:
overrideState: 0 overrideState: 0
value: 100 value: 100
@ -310,63 +308,3 @@ MonoBehaviour:
m_Loop: 0 m_Loop: 0
m_ZeroValue: 0.5 m_ZeroValue: 0.5
m_Range: 1 m_Range: 1
--- !u!114 &114891676506052672
MonoBehaviour:
m_ObjectHideFlags: 3
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6050e2d5de785ce4d931e4dbdbf2d755, type: 3}
m_Name: ChromaticAberration
m_EditorClassIdentifier:
active: 1
enabled:
overrideState: 1
value: 1
spectralLut:
overrideState: 0
value: {fileID: 0}
intensity:
overrideState: 1
value: 0.181
fastMode:
overrideState: 0
value: 0
--- !u!114 &114967782660637982
MonoBehaviour:
m_ObjectHideFlags: 3
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 7a34fa72bd4185749832024e9c8010bf, type: 3}
m_Name: ScreenSpaceReflections
m_EditorClassIdentifier:
active: 0
enabled:
overrideState: 1
value: 1
preset:
overrideState: 0
value: 2
maximumIterationCount:
overrideState: 0
value: 16
resolution:
overrideState: 0
value: 0
thickness:
overrideState: 0
value: 8
maximumMarchDistance:
overrideState: 0
value: 100
distanceFade:
overrideState: 0
value: 0.5
vignette:
overrideState: 0
value: 0.5

@ -0,0 +1,120 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace UltraCombos.Frozen
{
public class DFVolumeParticleUpdater : MonoBehaviour
{
public bool reset = false;
[Range(1, 1 << 20)]
public int maxParticles = 1 << 15;
public StructuredBuffer particleBuffer = null;
List<Particle> buffer_data = null;
public ComputeShader shader = null;
ComputeBuffer args_buffer = null;
public UniformStructuredBuffer uniformBuffer;
ParticleUniforms uniforms = null;
public Klak.Chromatics.CosineGradient cosineGradient = null;
bool is_initialized = false;
[SerializeField]
KinectOpticalFlow kinectOpticalFlow;
[SerializeField]
FluidSim3DProject.SmokeFluidSim smokeFluidSim;
[SerializeField]
ParticleViewerMesh particleViewerMesh;
[SerializeField]
[Range(0, 1)]
public float rate = 1.0f;
[SerializeField] DFVolume.VolumeData volumeData;
[SerializeField, Range(0, 1)]
float value = 0;
[SerializeField]
string debug;
private void Start()
{
uniforms = uniformBuffer.uniform as ParticleUniforms;
particleViewerMesh.BufferCount = (int)(maxParticles * rate);
StartCoroutine(Initialize());
}
private void FixedUpdate()
{
if (is_initialized == false)
return;
if (reset)
{
reset = false;
OnReset();
}
UpdateParticle(Time.fixedDeltaTime);
}
private void OnDestroy()
{
Utilities.Release(ref args_buffer);
}
private void OnReset()
{
particleBuffer.SetData(buffer_data);
}
private IEnumerator Initialize()
{
{
args_buffer = shader.CreateIndirectComputeArgsBuffer(maxParticles, 1, 1);
}
{
buffer_data = new List<Particle>();
yield return Utilities.GetRandomParticleData(maxParticles, buffer_data);
}
is_initialized = true;
OnReset();
}
private void UpdateParticle(float time_step)
{
{
shader.SetFloat("timeStep", time_step);
shader.SetFloat("timeValue", Utilities.GetTimeValue());
shader.SetInt("home_count", kinectOpticalFlow.HomeCount);
shader.SetFloat("bufferCount", particleBuffer.count);
if (cosineGradient != null)
{
shader.SetVector("coeffsA", cosineGradient.coeffsA);
shader.SetVector("coeffsB", cosineGradient.coeffsB);
shader.SetVector("coeffsC", cosineGradient.coeffsC2);
shader.SetVector("coeffsD", cosineGradient.coeffsD2);
}
shader.SetVector("FluidGridDim", smokeFluidSim.GridDim);
shader.SetVector("FluidGridRoot", smokeFluidSim.GridRoot);
shader.SetVector("FluidGridSize", smokeFluidSim.GridSize);
shader.SetBuffer(0, particleBuffer.bufferName, particleBuffer.obj);
shader.SetBuffer(0, uniformBuffer.bufferName, uniformBuffer.obj);
shader.SetBuffer(0, "home_position_buffer", kinectOpticalFlow.HomePositionBuffer);
shader.SetBuffer(0, "home_velocity_buffer", kinectOpticalFlow.HomeVelocityBuffer);
shader.SetBuffer(0, "fluid_velocity_buffer", smokeFluidSim.VelocityBuffer);
shader.SetTexture(0, "DFVolume", volumeData.texture);
shader.DispatchIndirect(0, args_buffer);
}
}
}
}

@ -0,0 +1,13 @@
fileFormatVersion: 2
guid: 73561edc8add6a84082d5ef8c1bb6b71
timeCreated: 1519889674
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

@ -32,8 +32,6 @@ namespace UltraCombos.Frozen
[Range(0, 1)] [Range(0, 1)]
public float rate = 1.0f; public float rate = 1.0f;
[SerializeField] DFVolume.VolumeData volumeData;
[SerializeField, Range(0, 1)] [SerializeField, Range(0, 1)]
float value = 0; float value = 0;
[SerializeField] [SerializeField]
@ -111,8 +109,6 @@ namespace UltraCombos.Frozen
shader.SetBuffer(0, "home_velocity_buffer", kinectOpticalFlow.HomeVelocityBuffer); shader.SetBuffer(0, "home_velocity_buffer", kinectOpticalFlow.HomeVelocityBuffer);
shader.SetBuffer(0, "fluid_velocity_buffer", smokeFluidSim.VelocityBuffer); shader.SetBuffer(0, "fluid_velocity_buffer", smokeFluidSim.VelocityBuffer);
shader.SetTexture(0, "DFVolume", volumeData.texture);
shader.DispatchIndirect(0, args_buffer); shader.DispatchIndirect(0, args_buffer);
} }
} }

@ -0,0 +1,146 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace UltraCombos.Frozen
{
[ExecuteInEditMode]
public class SpaceMeshGenerator : MonoBehaviour
{
[SerializeField]
bool update = false;
[SerializeField]
int width = 1;
[SerializeField]
int depth = 1;
[SerializeField]
int height = 1;
private void Update()
{
var mesh_filter = GetComponent<MeshFilter>();
if (update)
{
update = false;
if (Application.isPlaying)
Destroy(mesh_filter.sharedMesh);
else
DestroyImmediate(mesh_filter.sharedMesh);
mesh_filter.sharedMesh = null;
}
if (mesh_filter.sharedMesh == null)
{
mesh_filter.sharedMesh = CreateMesh();
}
}
private void OnDrawGizmosSelected()
{
var size = new Vector3(width, height, depth);
var center = transform.position;
center.y += size.y * 0.5f;
var c = Gizmos.color;
Gizmos.color = Color.cyan;
Gizmos.DrawWireCube(center, size);
Gizmos.color = c;
}
private Mesh CreateMesh()
{
var size = new Vector3(width, height, depth);
var half_size = size * 0.5f;
var tex_size = new Vector2(depth * 2.0f + width, depth + height);
var points = new List<Vector3>();
points.Add(new Vector3(-half_size.x, 0.0f, -half_size.z));
points.Add(new Vector3(-half_size.x, 0.0f, +half_size.z));
points.Add(new Vector3(+half_size.x, 0.0f, -half_size.z));
points.Add(new Vector3(+half_size.x, 0.0f, +half_size.z));
points.Add(new Vector3(-half_size.x, size.y, -half_size.z));
points.Add(new Vector3(-half_size.x, size.y, +half_size.z));
points.Add(new Vector3(+half_size.x, size.y, -half_size.z));
points.Add(new Vector3(+half_size.x, size.y, +half_size.z));
var vertices = new List<Vector3>();
var uvs = new List<Vector2>();
var indices = new List<int>();
var normals = new List<Vector3>();
// Ground
AddIndexAndNormal(indices, vertices.Count, normals, new Vector3(0, 1, 0));
vertices.Add(points[0]);
vertices.Add(points[1]);
vertices.Add(points[2]);
vertices.Add(points[3]);
uvs.Add(new Vector2(depth / tex_size.x, 0.0f));
uvs.Add(new Vector2(depth / tex_size.x, depth / tex_size.y));
uvs.Add(new Vector2((depth + width) / tex_size.x, 0.0f));
uvs.Add(new Vector2((depth + width) / tex_size.x, depth / tex_size.y));
// Front
AddIndexAndNormal(indices, vertices.Count, normals, new Vector3(0, 0, -1));
vertices.Add(points[1]);
vertices.Add(points[5]);
vertices.Add(points[3]);
vertices.Add(points[7]);
uvs.Add(new Vector2(depth / tex_size.x, depth / tex_size.y));
uvs.Add(new Vector2(depth / tex_size.x, (depth + height) / tex_size.y));
uvs.Add(new Vector2((depth + width) / tex_size.x, depth / tex_size.y));
uvs.Add(new Vector2((depth + width) / tex_size.x, (depth + height) / tex_size.y));
// Left
AddIndexAndNormal(indices, vertices.Count, normals, new Vector3(1, 0, 0));
vertices.Add(points[0]);
vertices.Add(points[4]);
vertices.Add(points[1]);
vertices.Add(points[5]);
uvs.Add(new Vector2(0.0f, depth / tex_size.y));
uvs.Add(new Vector2(0.0f, (depth + height) / tex_size.y));
uvs.Add(new Vector2(depth / tex_size.x, depth / tex_size.y));
uvs.Add(new Vector2(depth / tex_size.x, (depth + height) / tex_size.y));
// Right
AddIndexAndNormal(indices, vertices.Count, normals, new Vector3(-1, 0, 0));
vertices.Add(points[3]);
vertices.Add(points[7]);
vertices.Add(points[2]);
vertices.Add(points[6]);
uvs.Add(new Vector2((depth + width) / tex_size.x, depth / tex_size.y));
uvs.Add(new Vector2((depth + width) / tex_size.x, (depth + height) / tex_size.y));
uvs.Add(new Vector2((depth * 2.0f + width) / tex_size.x, depth / tex_size.y));
uvs.Add(new Vector2((depth * 2.0f + width) / tex_size.x, (depth + height) / tex_size.y));
var mesh = new Mesh();
mesh.name = string.Format("Space Mesh: ({0}x{1}x{2})", width, depth, height);
mesh.SetVertices(vertices);
mesh.SetUVs(0, uvs);
mesh.SetNormals(normals);
mesh.SetIndices(indices.ToArray(), MeshTopology.Triangles, 0);
mesh.UploadMeshData(true);
return mesh;
}
private void AddIndexAndNormal(List<int> indices, int index, List<Vector3> normals, Vector3 normal)
{
indices.Add(index + 0);
indices.Add(index + 1);
indices.Add(index + 2);
indices.Add(index + 1);
indices.Add(index + 3);
indices.Add(index + 2);
normals.Add(normal);
normals.Add(normal);
normals.Add(normal);
normals.Add(normal);
}
}
}

@ -0,0 +1,13 @@
fileFormatVersion: 2
guid: 16e57166815b2534daf1be5fd19595f2
timeCreated: 1521011481
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,221 @@
#pragma kernel CSMain
#include "UnityCG.cginc"
#include "../../ParticleWorks/Shader/Inc/Defines.cginc"
#include "../../ParticleWorks/Shader/Inc/Math.cginc"
#include "../../ParticleWorks/Shader/Noise/noise3Dgrad.cginc"
#include "../../ParticleWorks/Shader/ParticleUniforms.cginc"
CBUFFER_START(Variables)
float timeStep;
float timeValue;
float bufferCount;
int home_count;
float3 coeffsA;
float3 coeffsB;
float3 coeffsC;
float3 coeffsD;
float4 FluidGridDim;
float4 FluidGridRoot;
float4 FluidGridSize;
CBUFFER_END
RWStructuredBuffer<Particle> ssbo;
RWStructuredBuffer<ParticleUniforms> uniform_buffer;
RWStructuredBuffer<float4> home_position_buffer;
RWStructuredBuffer<float4> home_velocity_buffer;
RWStructuredBuffer<float3> fluid_velocity_buffer;
Texture3D<float4> DFVolume;
SamplerState samplerDFVolume;
float4 SampleVolume(float3 p)
{
return DFVolume.SampleLevel(samplerDFVolume, p, 0);
}
[numthreads(WORK_GROUP_SIZE, 1, 1)]
void CSMain(uint3 id : SV_DispatchThreadID)
{
uint idx = id.x;
Particle p = ssbo[idx];
float4 home_position = (home_count > 0) ? home_position_buffer[p.seed * home_count] : float4(0, 0, 0, 1);
float4 home_velocity = (home_count > 0) ? home_velocity_buffer[p.seed * home_count] : float4(0, 0, 0, 1);
ParticleUniforms uni = uniform_buffer[0];
float factor = p.color.a;
float3 acc = float3(0, 0, 0);
float3 F = float3(0, 0, 0);
if (home_count > 0)
{
float duration = uni.lifeDuration * (1.0f + factor * uni.lifeVariation);
float current_life = p.life * duration + timeStep;
//bool is_reset = false;
//if (current_life > duration)
//{
// current_life -= duration;
// is_reset = true;
//}
//if (is_reset || p.life < 0.0f)
if (current_life > duration && uni.lifeDuration > 0.1f)
{
current_life -= duration;
//if (isEmit == 0 && current_life > 0.0) current_life -= duration;
p.position = home_position.xyz;
p.color.rgb = float3(1, 1, 1);
p.velocity = home_velocity.xyz * 20.0f * pow(length(home_velocity.xyz), 2.0f);
//p.velocity = forceDirection * 3.0f;
}
p.life = current_life / duration;
}
// noise
{
//float n_seed = p.seed * 0.12f;
//float time_seed = timeValue * noiseTimeScale;
float3 np = p.position * uni.noiseFrequency;
float3 n1, n2;
snoise(np, n1);
snoise(np + float3(uni.noiseSeed, p.seed * 0.12f, timeValue * uni.noiseTimeScale), n2);
F = cross(n1, n2);
acc += F * uni.noiseStrength;
}
// convergence
{
F = -p.position;
acc += F * uni.convergence;
}
// home as tangential
{
F = cross(p.position, float3(0, 1, 0));
float d = clamp(abs(p.position.y), 1, 100);
F = normalize(F) * 10.0f / pow(d, 2 * 2);
acc += F * uni.homeStrength;
}
// force
{
F = float3(0, 0, 0);
if (length(uni.forceDirection) > 0.1f)
F = normalize(uni.forceDirection) * 10.0f;
acc += F * uni.forceStrength;
}
// impulse
{
//F = uni.impulsePosition - p.position;
//float mag = F.x*F.x + F.y*F.y + F.z*F.z;
//float rad2 = uni.impulseRadius * uni.impulseRadius;
//acc += F * exp(-mag / rad2) * uni.impulseStrength;
}
// fluid
{
float3 dim = ((p.position - FluidGridRoot) / FluidGridSize) * FluidGridDim;
dim = clamp(dim, float3(0, 0, 0), FluidGridDim - 1);
int idx = (int)dim.x + (int)dim.y * FluidGridDim.x + (int)dim.z * FluidGridDim.x * FluidGridDim.y;
float3 F = fluid_velocity_buffer[idx].xyz * 5.0f;
acc += F * uni.impulseStrength;
}
float3 volume_cc = float3(0.0, 0.424, 2.853);
// volume
{
//float3 volume_dim = float3(50, 50, 50);
//float3 dim = ((p.position - FluidGridRoot) / FluidGridSize) * volume_dim;
//dim = clamp(dim, float3(0, 0, 0), volume_dim - 1);
//int idx = (int)dim.x + (int)dim.y * volume_dim.x + (int)dim.z * volume_dim.x * volume_dim.y;
float4 df = SampleVolume((p.position - FluidGridRoot) / FluidGridSize);
float3 F = -df.xyz * pow(saturate(df.w / 1.0), 1.0 / 2.2) * 0.9;
float3 np = p.position * uni.noiseFrequency;
float3 n1 = float3(0, 0, 0);
snoise(np + float3(uni.noiseSeed, p.seed, timeValue * 5.0), n1);
//F = float3(0, 0, 0);
//F += cross(-df.xyz, float3(0, -1, 0)) * (1.0 - saturate(df.w / 0.1)) * 0.95;
F += cross(-df.xyz, n1) * (1.0 - saturate(df.w / 0.1)) * 0.15;
//float4 data = volume_data[idx];
//float3 F = -data.xyz * pow(data.w, 2.2);
//F += cross(-data.xyz, float3(1, 0, 0)) * (1.0 - saturate(data.w)) * 0.1;
//if (data.w < 0.1) F += data.xyz * 10.0;
//float3 F = lerp(cross(data.xyz, p.velocity), -data.xyz, saturate(data.w));
acc += F * 10.0;
//float th = 0.01;
//acc += float3(1, 0, 0) * (1.0 - saturate(df.w / th)) * 12.0;
if (abs(p.position.z - volume_cc.z) < 0.8)
acc += float3(1, 0, 0) * 7.0;
}
acc *= uni.movement;
p.velocity += acc * timeStep;
{
float4 df = SampleVolume((p.position - FluidGridRoot) / FluidGridSize);
float th = 0.01;
float3 dp = p.position - df.xyz * df.w;
p.velocity = lerp(df.xyz, p.velocity, saturate(df.w / th));
if (dot(p.position - dp, volume_cc - dp) > 0.0) p.position = dp + df.xyz * th;
}
p.position += p.velocity * timeStep;
//float damping = lerp(0.965f, 0.985f, p.seed) * velocityDamping;
p.velocity *= lerp(0.965f, 0.985f, p.seed) * uni.velocityDamping;
// calculate rotate quat
{
float vel = length(p.velocity);
float a = (1 + factor) * vel * 0.05f;
float4 q = quat_from_axis_angle(normalize(p.velocity + float3(0, FLT_EPSILON, 0)), a);
q = quat_mult(p.quat, q);
q = normalize(q);
p.quat = lerp(p.quat, q, saturate(vel - 0.01f));
}
// calculate model matrix
{
float size = uni.geomSize * lerp(1, pow(1.0f - saturate(p.life), 1.0f / 2.2f), any(uni.lifeDuration));
size *= lerp(0.5, 1.0, p.seed);
if (idx > (uint)(uni.numRate * bufferCount) || (p.life < 0.0f && uni.lifeDuration > 0.1f))
{
size = 0.0f;
}
float4x4 mat = make_translation_matrix(p.position);
mat = mul(mat, quat_to_rotation_matrix(p.quat));
mat = mul(mat, make_scaling_matrix(size));
p.model_matrix = mat;
}
// ground collision
{
float3 pos = mul(p.model_matrix, float4(p.position, 1.0f)).xyz;
pos = p.position;
if (pos.y < 0.0f)
{
p.velocity.y = abs(p.velocity.y) * 0.8f;
p.position.y = 0.0f;
}
}
// cosine gradient
{
float t = (uni.lifeDuration > 0.1f) ? clamp(p.life, 0.0f, 1.0f) : factor;
half3 rgb = cosine_gradient(coeffsA, coeffsB, coeffsC, coeffsD, t);
#if !defined(UNITY_COLORSPACE_GAMMA)
rgb = GammaToLinearSpace(rgb);
#endif
p.color.rgb = rgb;
}
ssbo[id.x] = p;
}

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 8233b22e9c5d09d43ab3350ff5ed572a
timeCreated: 1513318067
licenseType: Free
ComputeShaderImporter:
externalObjects: {}
currentAPIMask: 4
userData:
assetBundleName:
assetBundleVariant:

@ -12,7 +12,8 @@
{ {
Tags{ "RenderType" = "Opaque" } Tags{ "RenderType" = "Opaque" }
LOD 100 LOD 100
Blend One One Blend OneMinusDstColor One
//Blend One One
Pass Pass
{ {
@ -104,6 +105,7 @@
clip(0.5f / sqrt(2.0f) - length(i.uv - float2(0.5f, 0.5f))); clip(0.5f / sqrt(2.0f) - length(i.uv - float2(0.5f, 0.5f)));
fixed4 col = tex2D(_MainTex, i.uv) * _Color; fixed4 col = tex2D(_MainTex, i.uv) * _Color;
//fixed4 col = _Color;
col.rgb *= 1 + _Emission; col.rgb *= 1 + _Emission;
UNITY_APPLY_FOG(i.fogCoord, col); UNITY_APPLY_FOG(i.fogCoord, col);
return col; return col;

@ -26,14 +26,6 @@ RWStructuredBuffer<float4> home_position_buffer;
RWStructuredBuffer<float4> home_velocity_buffer; RWStructuredBuffer<float4> home_velocity_buffer;
RWStructuredBuffer<float3> fluid_velocity_buffer; RWStructuredBuffer<float3> fluid_velocity_buffer;
Texture3D<float4> DFVolume;
SamplerState samplerDFVolume;
float4 SampleVolume(float3 p)
{
return DFVolume.SampleLevel(samplerDFVolume, p, 0);
}
[numthreads(WORK_GROUP_SIZE, 1, 1)] [numthreads(WORK_GROUP_SIZE, 1, 1)]
void CSMain(uint3 id : SV_DispatchThreadID) void CSMain(uint3 id : SV_DispatchThreadID)
{ {
@ -121,51 +113,9 @@ void CSMain(uint3 id : SV_DispatchThreadID)
acc += F * uni.impulseStrength; acc += F * uni.impulseStrength;
} }
float3 volume_cc = float3(0.0, 0.424, 2.853);
// volume
{
//float3 volume_dim = float3(50, 50, 50);
//float3 dim = ((p.position - FluidGridRoot) / FluidGridSize) * volume_dim;
//dim = clamp(dim, float3(0, 0, 0), volume_dim - 1);
//int idx = (int)dim.x + (int)dim.y * volume_dim.x + (int)dim.z * volume_dim.x * volume_dim.y;
float4 df = SampleVolume((p.position - FluidGridRoot) / FluidGridSize);
float3 F = -df.xyz * pow(saturate(df.w / 1.0), 1.0 / 2.2) * 0.9;
float3 np = p.position * uni.noiseFrequency;
float3 n1 = float3(0, 0, 0);
snoise(np + float3(uni.noiseSeed, p.seed, timeValue * 5.0), n1);
//F = float3(0, 0, 0);
//F += cross(-df.xyz, float3(0, -1, 0)) * (1.0 - saturate(df.w / 0.1)) * 0.95;
F += cross(-df.xyz, n1) * (1.0 - saturate(df.w / 0.1)) * 0.15;
//float4 data = volume_data[idx];
//float3 F = -data.xyz * pow(data.w, 2.2);
//F += cross(-data.xyz, float3(1, 0, 0)) * (1.0 - saturate(data.w)) * 0.1;
//if (data.w < 0.1) F += data.xyz * 10.0;
//float3 F = lerp(cross(data.xyz, p.velocity), -data.xyz, saturate(data.w));
acc += F * 10.0;
//float th = 0.01;
//acc += float3(1, 0, 0) * (1.0 - saturate(df.w / th)) * 12.0;
if (abs(p.position.z - volume_cc.z) < 0.8)
acc += float3(1, 0, 0) * 7.0;
}
acc *= uni.movement; acc *= uni.movement;
p.velocity += acc * timeStep; p.velocity += acc * timeStep;
{
float4 df = SampleVolume((p.position - FluidGridRoot) / FluidGridSize);
float th = 0.01;
float3 dp = p.position - df.xyz * df.w;
p.velocity = lerp(df.xyz, p.velocity, saturate(df.w / th));
if (dot(p.position - dp, volume_cc - dp) > 0.0) p.position = dp + df.xyz * th;
}
p.position += p.velocity * timeStep; p.position += p.velocity * timeStep;
//float damping = lerp(0.965f, 0.985f, p.seed) * velocityDamping; //float damping = lerp(0.965f, 0.985f, p.seed) * velocityDamping;

@ -5,14 +5,14 @@ RenderTexture:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0} m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0} m_PrefabInternal: {fileID: 0}
m_Name: FrozenCanvas m_Name: RenderTexture-Final
m_ImageContentsHash: m_ImageContentsHash:
serializedVersion: 2 serializedVersion: 2
Hash: 00000000000000000000000000000000 Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4 m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0 m_DownscaleFallback: 0
m_Width: 2048 m_Width: 5040
m_Height: 2048 m_Height: 3200
m_AntiAliasing: 1 m_AntiAliasing: 1
m_DepthFormat: 0 m_DepthFormat: 0
m_ColorFormat: 0 m_ColorFormat: 0

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: e222b09ab4f80eb4eae6760ed0503d87
timeCreated: 1521000544
licenseType: Free
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 8400000
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,33 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!84 &8400000
RenderTexture:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: RenderTexture-Particle
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
m_Width: 5040
m_Height: 5040
m_AntiAliasing: 1
m_DepthFormat: 0
m_ColorFormat: 0
m_MipMap: 0
m_GenerateMips: 1
m_SRGB: 0
m_UseDynamicScale: 0
m_BindMS: 0
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 1
m_Aniso: 0
m_MipBias: 0
m_WrapU: 1
m_WrapV: 1
m_WrapW: 1
m_Dimension: 2
m_VolumeDepth: 1

@ -0,0 +1,33 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!84 &8400000
RenderTexture:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: RenderTexture-Scene
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
m_Width: 5040
m_Height: 5040
m_AntiAliasing: 1
m_DepthFormat: 0
m_ColorFormat: 0
m_MipMap: 0
m_GenerateMips: 1
m_SRGB: 0
m_UseDynamicScale: 0
m_BindMS: 0
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 1
m_Aniso: 0
m_MipBias: 0
m_WrapU: 1
m_WrapV: 1
m_WrapW: 1
m_Dimension: 2
m_VolumeDepth: 1

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 1ded3bafa85a18b4f87c48288b4439a1
timeCreated: 1521000544
licenseType: Free
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 8400000
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:14777962fe44cf23944d361a8b868e2313140a9ea416ac8b6140340ac3c06ada
size 1353162

@ -0,0 +1,97 @@
fileFormatVersion: 2
guid: 7dd5a0e785793aa48b130a09c564d854
timeCreated: 1521018676
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -1
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- buildTarget: Standalone
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- buildTarget: WebGL
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:63ad8f5e1cb1cc00f42a3e4436df7b4537d57426866125b0ae0064abe39a0019
size 19376075

@ -0,0 +1,97 @@
fileFormatVersion: 2
guid: 7ec1ec22e0e868244b68c7c04331baea
timeCreated: 1521094630
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -1
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- buildTarget: Standalone
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- buildTarget: WebGL
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:564bf9df2e7911fe910ff0d9364faa471f194eb33bbbf0ad51547039a3e1ee38
size 16846022

@ -0,0 +1,97 @@
fileFormatVersion: 2
guid: b248fc4a19e53484f99da9aaa77dbdf8
timeCreated: 1520999835
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -1
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- buildTarget: Standalone
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- buildTarget: WebGL
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

@ -9,6 +9,7 @@ namespace UltraCombos
ComputeBuffer args_buffer = null; ComputeBuffer args_buffer = null;
public int VertexCount { set { vertex_count = value; } } public int VertexCount { set { vertex_count = value; } }
int vertex_count = -1; int vertex_count = -1;
public bool cullingMask = false;
private void OnRenderObject() private void OnRenderObject()
{ {
@ -16,6 +17,9 @@ namespace UltraCombos
return; return;
if (Utilities.SkipCamera(Camera.current.name)) if (Utilities.SkipCamera(Camera.current.name))
return; return;
int mask = Camera.current.cullingMask;
if (cullingMask && mask > -1 && mask != 1 << gameObject.layer)
return;
material.SetPass(0); material.SetPass(0);
material.SetMatrix("model_matrix", transform.localToWorldMatrix); material.SetMatrix("model_matrix", transform.localToWorldMatrix);

@ -174,18 +174,4 @@ QualitySettings:
asyncUploadBufferSize: 4 asyncUploadBufferSize: 4
resolutionScalingFixedDPIFactor: 1 resolutionScalingFixedDPIFactor: 1
excludedTargetPlatforms: [] excludedTargetPlatforms: []
m_PerPlatformDefaultQuality: m_PerPlatformDefaultQuality: {}
Android: 2
Nintendo 3DS: 5
Nintendo Switch: 5
PS4: 5
PSM: 5
PSP2: 2
Standalone: 5
Tizen: 2
WebGL: 3
WiiU: 5
Windows Store Apps: 5
XboxOne: 5
iPhone: 2
tvOS: 2

@ -13,8 +13,8 @@ TagManager:
- UI - UI
- -
- -
- - Scene
- - Particle
- -
- -
- -

Loading…
Cancel
Save