修改水
This commit is contained in:
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f31685c4cf95048ceb543a69d4f84ff4
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b8d28b0e0918140d8b8ee3388bff5ec2
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1a08e3a8d3c4f4d3b90eb00e408b5f5d
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5741e12d1b7644a1ea6e9239027b476b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,10 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4df17ed533d3349a194f3bb8c89dcf5d
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}
|
||||
@@ -1,33 +0,0 @@
|
||||
#ifndef PROCEDURAL_INCLUDED
|
||||
#define PROCEDURAL_INCLUDED
|
||||
|
||||
#define UNITY_INDIRECT_DRAW_ARGS IndirectDrawIndexedArgs
|
||||
#include "UnityIndirect.cginc"
|
||||
|
||||
StructuredBuffer<float4x4> _InstanceTransforms;
|
||||
StructuredBuffer<float4x4> _InvInstanceTransforms;
|
||||
StructuredBuffer<float4> _Colors;
|
||||
|
||||
#if UNITY_ANY_INSTANCING_ENABLED
|
||||
// Based on :
|
||||
// https://github.com/Unity-Technologies/Graphics/blob/master/com.unity.shadergraph/Editor/Generation/Targets/BuiltIn/ShaderLibrary/ParticlesInstancing.hlsl
|
||||
// and/or
|
||||
// https://github.com/TwoTailsGames/Unity-Built-in-Shaders/blob/master/CGIncludes/UnityStandardParticleInstancing.cginc
|
||||
|
||||
void vertInstancingSetup() {
|
||||
}
|
||||
#endif
|
||||
|
||||
void GetInstanceData_float(uint svInstanceID, float3 pos, out float3 outPos, out float4 color)
|
||||
{
|
||||
InitIndirectDrawArgs(0);
|
||||
uint instanceID = GetIndirectInstanceID_Base(svInstanceID);
|
||||
|
||||
unity_ObjectToWorld = _InstanceTransforms[instanceID];
|
||||
unity_WorldToObject = _InvInstanceTransforms[instanceID];
|
||||
color = _Colors[instanceID];
|
||||
|
||||
outPos = pos;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9d77a2f1bd0624d4aa045916cb0955c9
|
||||
ShaderIncludeImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,106 +0,0 @@
|
||||
#ifndef OBIELLIPSOIDS_INCLUDED
|
||||
#define OBIELLIPSOIDS_INCLUDED
|
||||
|
||||
// Eye ray origin in world space.
|
||||
// Works both for orthographic and perspective cameras.
|
||||
float3 WorldEye(float3 worldPos){
|
||||
if ((UNITY_MATRIX_P[3].x == 0.0) && (UNITY_MATRIX_P[3].y == 0.0) && (UNITY_MATRIX_P[3].z == 0.0)){
|
||||
return mul(UNITY_MATRIX_I_V,float4(mul(UNITY_MATRIX_V, float4(worldPos,1)).xy,0,1)).xyz;
|
||||
}else
|
||||
return _WorldSpaceCameraPos;
|
||||
}
|
||||
|
||||
// Returns visible ellipsoid radius and offset from center, given the eye position in parameter space.
|
||||
// Works both for orthographic and perspective cameras.
|
||||
float VisibleEllipsoidCircleRadius(float3 eye, out float3 m){
|
||||
if ((UNITY_MATRIX_P[3].x == 0.0) && (UNITY_MATRIX_P[3].y == 0.0) && (UNITY_MATRIX_P[3].z == 0.0)){
|
||||
m = float3(0,0,0);
|
||||
return 1;
|
||||
}else{
|
||||
float t = 1/dot(eye,eye);
|
||||
m = t * eye;
|
||||
return sqrt(1-t);
|
||||
}
|
||||
}
|
||||
|
||||
// Performs accurate raycasting of a spherical impostor.
|
||||
// Works both for orthographic and perspective cameras.
|
||||
void IntersectEllipsoid_float(float3 v, float4 mapping, float3 a2, float3 a3, out float3 eyePos, out float3 eyeNormal, out float thickness, out float clipThreshold)
|
||||
{
|
||||
float r2 = dot(mapping.xy, mapping.xy);
|
||||
|
||||
// clip if the ray does not intersect the sphere.
|
||||
clipThreshold = r2/mapping.w;
|
||||
float iq = 1 - clipThreshold;
|
||||
|
||||
float sqrtiq = sqrt(iq);
|
||||
float lambda = 1/(1 + mapping.z * sqrtiq);
|
||||
|
||||
eyePos = lambda * v;
|
||||
eyeNormal = normalize(a2 + lambda * a3);
|
||||
|
||||
// return gaussian-falloff thickness.
|
||||
thickness = 2 * sqrtiq * exp(-r2*2.0f);
|
||||
|
||||
clipThreshold = (1 - clipThreshold > 0) ? 0 : 1.01;
|
||||
}
|
||||
|
||||
void BuildVelocityStretchedBasis_float(float3 velocity, float stretchIntensity, float radius, out float4 t0, out float4 t1, out float4 t2)
|
||||
{
|
||||
t0 = float4(UNITY_MATRIX_V[0].xyz, radius); // camera right vector
|
||||
t2 = float4(UNITY_MATRIX_V[2].xyz, radius); // camera forward vector
|
||||
|
||||
float3 eyeVel = velocity - dot(velocity, t2.xyz) * t2.xyz;
|
||||
float velNorm = length(eyeVel);
|
||||
float stretchAmount = velNorm * stretchIntensity;
|
||||
|
||||
// use it to lerp between velocity vector and camera right:
|
||||
t0 = float4(velNorm > 0.00001 ? eyeVel / velNorm : t0.xyz, radius * (1 + stretchAmount));
|
||||
t1 = float4(normalize(cross(t0.xyz,t2.xyz)), radius);
|
||||
}
|
||||
|
||||
void BuildParameterSpaceMatrices_float(float4 t0, float4 t1, float4 t2, float radiusScale, out float3x3 P, out float3x3 IP)
|
||||
{
|
||||
// build 3x3 orientation matrix and its inverse;
|
||||
float3x3 IO = float3x3(t0.xyz,t1.xyz,t2.xyz);
|
||||
float3x3 O = transpose(IO);
|
||||
|
||||
// build 3x3 scaling matrix and its inverse:
|
||||
float3x3 S = float3x3(radiusScale*t0.w,0,0,0,radiusScale*t1.w,0,0,0,radiusScale*t2.w);
|
||||
float3x3 IS = float3x3(1/(radiusScale*t0.w),0,0,0,1/(radiusScale*t1.w),0,0,0,1/(radiusScale*t2.w));
|
||||
|
||||
// build 3x3 transformation matrix and its inverse:
|
||||
P = mul((float3x3)UNITY_MATRIX_M, mul(O,mul(S,IO)) );
|
||||
IP = mul(mul(mul(O,IS),IO), (float3x3)UNITY_MATRIX_I_M);
|
||||
}
|
||||
|
||||
void BuildEllipsoidBillboard_float(float3 center, float3 corner, float3x3 P, float3x3 IP, out float3 worldPos, out float3 view, out float3 eye, out float radius)
|
||||
{
|
||||
// eye position and quad vectors in parameter space:
|
||||
eye = mul(IP,WorldEye(center) - center);
|
||||
float3 u = normalize(cross(-eye,UNITY_MATRIX_V[1].xyz));
|
||||
float3 k = normalize(cross(-eye,u));
|
||||
|
||||
// visible circle radius and offset from center in the direction of the view ray:
|
||||
float3 m;
|
||||
radius = VisibleEllipsoidCircleRadius(eye,m);
|
||||
|
||||
// world position of the billboard corner, and view vector to it:
|
||||
worldPos = center + mul(P, m) + radius * (mul(P,u)* corner.x + mul(P,k)* corner.y);
|
||||
view = worldPos - WorldEye(worldPos);
|
||||
}
|
||||
|
||||
void BuildAuxiliaryNormalVectors_float(float3 center, float3 worldPos, float3 view, float3x3 P, float3x3 IP, out float3 a2, out float3 a3)
|
||||
{
|
||||
// calculate T^-2 in object space, then multiply by
|
||||
// inverse transpose of modelview to rotate normal from object to eye.
|
||||
// This way the normal calculated in IntersectEllipsoid() is already in view space.
|
||||
IP = mul((float3x3)UNITY_MATRIX_M,IP);
|
||||
float3x3 IT_MV = transpose(mul((float3x3)UNITY_MATRIX_I_V, (float3x3)UNITY_MATRIX_I_M));
|
||||
float3x3 IP2 = mul(IT_MV, mul((float3x3)UNITY_MATRIX_I_M,mul (IP, IP))); // UNITY_MATRIX_IT_MV
|
||||
|
||||
a2 = mul(IP2,WorldEye(worldPos) - center); //T^-2 * (eye - center)
|
||||
a3 = mul(IP2,view); //T^-2 * A[0]
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bc807595df1f54350ac0027aaf7cb91b
|
||||
ShaderIncludeImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,10 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 99a2f8857960c44ca980d85023572447
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}
|
||||
@@ -1,204 +0,0 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &-5466045192948715276
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 11
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 639247ca83abc874e893eb93af2b5e44, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 0
|
||||
--- !u!114 &-5150015107491739568
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 11
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: da692e001514ec24dbc4cca1949ff7e8, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Unity.RenderPipelines.HighDefinition.Editor::UnityEditor.Rendering.HighDefinition.AssetVersion
|
||||
version: 13
|
||||
hdPluginSubTargetMaterialVersions:
|
||||
m_Keys: []
|
||||
m_Values:
|
||||
--- !u!114 &-4382110247035737841
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 11
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 10
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Particles
|
||||
m_Shader: {fileID: -6465566751694194690, guid: 99a2f8857960c44ca980d85023572447, type: 3}
|
||||
m_Parent: {fileID: 0}
|
||||
m_ModifiedSerializedProperties: 0
|
||||
m_ValidKeywords:
|
||||
- _DEPTHOFFSET_ON
|
||||
- _DISABLE_DECALS
|
||||
- _DISABLE_SSR_TRANSPARENT
|
||||
m_InvalidKeywords:
|
||||
- _EMISSION
|
||||
m_LightmapFlags: 3
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: 2000
|
||||
stringTagMap:
|
||||
MotionVector: User
|
||||
disabledShaderPasses:
|
||||
- MOTIONVECTORS
|
||||
- TransparentDepthPrepass
|
||||
- TransparentDepthPostpass
|
||||
- TransparentBackface
|
||||
- RayTracingPrepass
|
||||
m_LockedProperties:
|
||||
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: 10300, guid: 0000000000000000f000000000000000, type: 0}
|
||||
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}
|
||||
- unity_Lightmaps:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_LightmapsInd:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_ShadowMasks:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Ints: []
|
||||
m_Floats:
|
||||
- _AddPrecomputedVelocity: 0
|
||||
- _AlphaCutoffEnable: 0
|
||||
- _AlphaDstBlend: 0
|
||||
- _AlphaSrcBlend: 1
|
||||
- _BUILTIN_QueueControl: 0
|
||||
- _BUILTIN_QueueOffset: 0
|
||||
- _BlendMode: 0
|
||||
- _BumpScale: 1
|
||||
- _ConservativeDepthOffsetEnable: 0
|
||||
- _CullMode: 2
|
||||
- _CullModeForward: 2
|
||||
- _Cutoff: 0.5
|
||||
- _DepthOffsetEnable: 1
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DoubleSidedEnable: 0
|
||||
- _DoubleSidedGIMode: 0
|
||||
- _DoubleSidedNormalMode: 2
|
||||
- _DstBlend: 0
|
||||
- _DstBlend2: 0
|
||||
- _EnableBlendModePreserveSpecularLighting: 1
|
||||
- _EnableFogOnTransparent: 1
|
||||
- _ExcludeFromTUAndAA: 0
|
||||
- _Glossiness: 0.5
|
||||
- _InvFade: 1
|
||||
- _MaterialID: 1
|
||||
- _MaterialTypeMask: 2
|
||||
- _Metallic: 0
|
||||
- _Mode: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _OpaqueCullMode: 2
|
||||
- _Parallax: 0.02
|
||||
- _PerPixelSorting: 0
|
||||
- _QueueControl: 0
|
||||
- _QueueOffset: 0
|
||||
- _RadiusScale: 1
|
||||
- _RayTracing: 0
|
||||
- _ReceivesSSR: 1
|
||||
- _ReceivesSSRTransparent: 0
|
||||
- _RefractionModel: 0
|
||||
- _RenderQueueType: 1
|
||||
- _RequireSplitLighting: 0
|
||||
- _Smoothness: 0.6
|
||||
- _SrcBlend: 1
|
||||
- _StencilRef: 0
|
||||
- _StencilRefDepth: 8
|
||||
- _StencilRefDistortionVec: 4
|
||||
- _StencilRefGBuffer: 10
|
||||
- _StencilRefMV: 40
|
||||
- _StencilWriteMask: 6
|
||||
- _StencilWriteMaskDepth: 9
|
||||
- _StencilWriteMaskDistortionVec: 4
|
||||
- _StencilWriteMaskGBuffer: 15
|
||||
- _StencilWriteMaskMV: 41
|
||||
- _SupportDecals: 0
|
||||
- _SurfaceType: 0
|
||||
- _TransmissionEnable: 1
|
||||
- _TransparentBackfaceEnable: 0
|
||||
- _TransparentCullMode: 2
|
||||
- _TransparentDepthPostpassEnable: 0
|
||||
- _TransparentDepthPrepassEnable: 0
|
||||
- _TransparentSortPriority: 0
|
||||
- _TransparentWritingMotionVec: 0
|
||||
- _TransparentZWrite: 0
|
||||
- _UVSec: 0
|
||||
- _UseShadowThreshold: 0
|
||||
- _ZTestDepthEqualForOpaque: 3
|
||||
- _ZTestGBuffer: 4
|
||||
- _ZTestTransparent: 4
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
|
||||
- _EmissionColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _ParticleColor: {r: 1, g: 1, b: 1, a: 0}
|
||||
- _TintColor: {r: 0.5, g: 0.5, b: 0.5, a: 0.5}
|
||||
m_BuildTextureStacks: []
|
||||
m_AllowLocking: 1
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fb88690dea2394644849cde5abd037f9
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: aacd9fe47bf4d416d883fd99066cf37e
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,18 +1,5 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &-2963227855003104821
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 11
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 639247ca83abc874e893eb93af2b5e44, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 0
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
@@ -20,8 +7,8 @@ Material:
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: ProceduralInstanced
|
||||
m_Shader: {fileID: -6465566751694194690, guid: 4df17ed533d3349a194f3bb8c89dcf5d, type: 3}
|
||||
m_Name: InstancedStandard
|
||||
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_Parent: {fileID: 0}
|
||||
m_ModifiedSerializedProperties: 0
|
||||
m_ValidKeywords: []
|
||||
@@ -74,8 +61,6 @@ Material:
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Ints: []
|
||||
m_Floats:
|
||||
- _BUILTIN_QueueControl: 0
|
||||
- _BUILTIN_QueueOffset: 0
|
||||
- _BumpScale: 1
|
||||
- _Cutoff: 0.5
|
||||
- _DetailNormalMapScale: 1
|
||||
@@ -1,13 +1,15 @@
|
||||
#ifndef OBIELLIPSOIDS_INCLUDED
|
||||
#define OBIELLIPSOIDS_INCLUDED
|
||||
|
||||
float _RadiusScale;
|
||||
|
||||
// Eye ray origin in world space.
|
||||
// Works both for orthographic and perspective cameras.
|
||||
float3 WorldEye(float3 worldPos){
|
||||
if ((UNITY_MATRIX_P[3].x == 0.0) && (UNITY_MATRIX_P[3].y == 0.0) && (UNITY_MATRIX_P[3].z == 0.0)){
|
||||
return mul(UNITY_MATRIX_I_V,float4(mul(UNITY_MATRIX_V, float4(worldPos,1)).xy,0,1)).xyz;
|
||||
}else
|
||||
return _WorldSpaceCameraPos;
|
||||
return UNITY_MATRIX_I_V._m03_m13_m23;
|
||||
}
|
||||
|
||||
// Returns visible ellipsoid radius and offset from center, given the eye position in parameter space.
|
||||
@@ -41,20 +43,6 @@ float IntersectEllipsoid(float3 v, float4 mapping, float3 a2, float3 a3, out flo
|
||||
return 2 * sqrtiq * exp(-r2*2.0f);
|
||||
}
|
||||
|
||||
void BuildVelocityStretchedBasis(float3 velocity, float stretchIntensity, float radius, out float4 t0, out float4 t1, out float4 t2)
|
||||
{
|
||||
t0 = float4(UNITY_MATRIX_V[0].xyz, radius); // camera right vector
|
||||
t2 = float4(UNITY_MATRIX_V[2].xyz, radius); // camera forward vector
|
||||
|
||||
float3 eyeVel = velocity - dot(velocity, t2.xyz) * t2.xyz;
|
||||
float velNorm = length(eyeVel);
|
||||
float stretchAmount = velNorm * stretchIntensity;
|
||||
|
||||
// use it to lerp between velocity vector and camera right:
|
||||
t0 = float4(velNorm > 0.00001 ? eyeVel / velNorm : t0, radius * (1 + stretchAmount));
|
||||
t1 = float4(normalize(cross(t0.xyz,t2.xyz)), radius);
|
||||
}
|
||||
|
||||
void BuildParameterSpaceMatrices(float4 t0, float4 t1, float4 t2, out float3x3 P, out float3x3 IP)
|
||||
{
|
||||
// build 3x3 orientation matrix and its inverse;
|
||||
@@ -62,18 +50,18 @@ void BuildParameterSpaceMatrices(float4 t0, float4 t1, float4 t2, out float3x3 P
|
||||
float3x3 O = transpose(IO);
|
||||
|
||||
// build 3x3 scaling matrix and its inverse:
|
||||
float3x3 S = float3x3(t0.w,0,0,0,t1.w,0,0,0,t2.w);
|
||||
float3x3 IS = float3x3(1/t0.w,0,0,0,1/t1.w,0,0,0,1/t2.w);
|
||||
float3x3 S = float3x3(_RadiusScale*t0.w,0,0,0,_RadiusScale*t1.w,0,0,0,_RadiusScale*t2.w);
|
||||
float3x3 IS = float3x3(1/(_RadiusScale*t0.w),0,0,0,1/(_RadiusScale*t1.w),0,0,0,1/(_RadiusScale*t2.w));
|
||||
|
||||
// build 3x3 transformation matrix and its inverse:
|
||||
P = mul((float3x3)unity_ObjectToWorld, mul(O,mul(S,IO)) );
|
||||
IP = mul(mul(mul(O,IS),IO), (float3x3)unity_WorldToObject);
|
||||
P = mul(mul(O,S),IO);
|
||||
IP = mul(mul(O,IS),IO);
|
||||
}
|
||||
|
||||
float BuildEllipsoidBillboard(float3 center, float3 corner, float3x3 P, float3x3 IP, out float3 worldPos, out float3 view, out float3 eye)
|
||||
{
|
||||
// eye position and quad vectors in parameter space:
|
||||
eye = mul(IP, WorldEye(center) - center);
|
||||
eye = mul(IP,WorldEye(center) - center);
|
||||
float3 u = normalize(cross(-eye,UNITY_MATRIX_V[1].xyz));
|
||||
float3 k = normalize(cross(-eye,u));
|
||||
|
||||
@@ -90,14 +78,8 @@ float BuildEllipsoidBillboard(float3 center, float3 corner, float3x3 P, float3x3
|
||||
|
||||
void BuildAuxiliaryNormalVectors(float3 center, float3 worldPos, float3 view, float3x3 P, float3x3 IP, out float3 a2, out float3 a3)
|
||||
{
|
||||
// calculate T^-2 in object space, then multiply by
|
||||
// inverse transpose of modelview to rotate normal from object to eye.
|
||||
// This way the normal calculated in IntersectEllipsoid() is already in view space.
|
||||
IP = mul((float3x3)unity_ObjectToWorld,IP);
|
||||
float3x3 IP2 = mul((float3x3)UNITY_MATRIX_IT_MV, mul((float3x3)unity_WorldToObject,mul (IP, IP)));
|
||||
|
||||
a2 = mul(IP2,WorldEye(worldPos) - center); //T^-2 * (eye - center)
|
||||
a3 = mul(IP2,view); //T^-2 * A[0]
|
||||
a2 = mul((float3x3)UNITY_MATRIX_V,mul(IP,mul(IP,WorldEye(worldPos) - center))); //T^-2 * (eye - center)
|
||||
a3 = mul((float3x3)UNITY_MATRIX_V,mul(IP,mul(IP,view))); //T^-2 * A[0]
|
||||
}
|
||||
|
||||
#endif
|
||||
19
Assets/Obi/Resources/ObiMaterials/ObiLightingBuiltIn.cginc
Normal file
19
Assets/Obi/Resources/ObiMaterials/ObiLightingBuiltIn.cginc
Normal file
@@ -0,0 +1,19 @@
|
||||
#ifndef OBILIGHTINGBUILTIN_INCLUDED
|
||||
#define OBILIGHTINGBUILTIN_INCLUDED
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
#include "UnityStandardUtils.cginc"
|
||||
#include "AutoLight.cginc"
|
||||
|
||||
half3 SampleSphereAmbient(float3 eyeNormal, float3 eyePos)
|
||||
{
|
||||
#if UNITY_SHOULD_SAMPLE_SH
|
||||
half3 worldNormal = mul(transpose((float3x3)UNITY_MATRIX_V),eyeNormal);
|
||||
half3 worldPos = mul(_Camera_to_World,half4(eyePos,1.0));
|
||||
return ShadeSHPerPixel(half4(worldNormal, 1.0),half3(0,0,0),worldPos);
|
||||
#else
|
||||
return UNITY_LIGHTMODEL_AMBIENT;
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 135872c7cdf2b43bf89b8c57d067d4de
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
24
Assets/Obi/Resources/ObiMaterials/ObiParticles.cginc
Normal file
24
Assets/Obi/Resources/ObiMaterials/ObiParticles.cginc
Normal file
@@ -0,0 +1,24 @@
|
||||
#ifndef OBIPARTICLES_INCLUDED
|
||||
#define OBIPARTICLES_INCLUDED
|
||||
|
||||
float _RadiusScale;
|
||||
|
||||
float3 BillboardSphereNormals(float2 texcoords)
|
||||
{
|
||||
float3 n;
|
||||
n.xy = texcoords*2.0-1.0;
|
||||
float r2 = dot(n.xy, n.xy);
|
||||
clip (1 - r2); // clip pixels outside circle
|
||||
n.z = sqrt(1.0 - r2);
|
||||
return n;
|
||||
}
|
||||
|
||||
float BillboardSphereThickness(float2 texcoords)
|
||||
{
|
||||
float2 n = texcoords*2.0-1.0;
|
||||
float r2 = dot(n.xy, n.xy);
|
||||
clip (1 - r2); // clip pixels outside circle
|
||||
return sqrt(1.0 - r2)*2.0f*exp(-r2*2.0f);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e4575c757879646c793ff2b434b83e74
|
||||
timeCreated: 1445285630
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -7,14 +7,14 @@ Material:
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Instanced
|
||||
m_Shader: {fileID: 4800000, guid: 301c97d7892714ada9887f712bed2d53, type: 3}
|
||||
m_Name: Particle
|
||||
m_Shader: {fileID: 4800000, guid: 87908c483837f4df49e97fa1aa0dacda, type: 3}
|
||||
m_Parent: {fileID: 0}
|
||||
m_ModifiedSerializedProperties: 0
|
||||
m_ValidKeywords: []
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 1
|
||||
m_LightmapFlags: 5
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap: {}
|
||||
@@ -44,21 +44,13 @@ Material:
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Texture: {fileID: 10300, guid: 0000000000000000f000000000000000, type: 0}
|
||||
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}
|
||||
- _Normal:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _Occlusion:
|
||||
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}
|
||||
@@ -67,74 +59,25 @@ Material:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_Lightmaps:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_LightmapsInd:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_ShadowMasks:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Ints: []
|
||||
m_Floats:
|
||||
- _AlphaClip: 0
|
||||
- _BUILTIN_AlphaClip: 0
|
||||
- _BUILTIN_Blend: 0
|
||||
- _BUILTIN_CullMode: 2
|
||||
- _BUILTIN_DstBlend: 0
|
||||
- _BUILTIN_QueueControl: 0
|
||||
- _BUILTIN_QueueOffset: 0
|
||||
- _BUILTIN_SrcBlend: 1
|
||||
- _BUILTIN_Surface: 0
|
||||
- _BUILTIN_ZTest: 4
|
||||
- _BUILTIN_ZWrite: 1
|
||||
- _BUILTIN_ZWriteControl: 0
|
||||
- _Blend: 0
|
||||
- _BumpScale: 1
|
||||
- _CastShadows: 1
|
||||
- _Cull: 2
|
||||
- _Cutoff: 0.5
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0.5
|
||||
- _GlossyReflections: 1
|
||||
- _InvFade: 1
|
||||
- _Metallic: 0
|
||||
- _Mode: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _PROCEDURAL_INSTANCING: 1
|
||||
- _Parallax: 0.02
|
||||
- _QueueControl: 0
|
||||
- _QueueOffset: 0
|
||||
- _ReceiveShadows: 1
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _RadiusScale: 1
|
||||
- _SrcBlend: 1
|
||||
- _Surface: 0
|
||||
- _UVSec: 0
|
||||
- _WorkflowMode: 1
|
||||
- _ZTest: 4
|
||||
- _ZWrite: 1
|
||||
- _ZWriteControl: 0
|
||||
m_Colors:
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _TintColor: {r: 0.5, g: 0.5, b: 0.5, a: 0.5}
|
||||
m_BuildTextureStacks: []
|
||||
m_AllowLocking: 1
|
||||
--- !u!114 &3510638688362179069
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 11
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 639247ca83abc874e893eb93af2b5e44, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 0
|
||||
@@ -1,8 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6380c47a989d54146bef5f3bac933a56
|
||||
guid: fb972beb020dd4ff5ab78835f4393522
|
||||
timeCreated: 1444705309
|
||||
licenseType: Store
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
215
Assets/Obi/Resources/ObiMaterials/ParticleShader.shader
Normal file
215
Assets/Obi/Resources/ObiMaterials/ParticleShader.shader
Normal file
@@ -0,0 +1,215 @@
|
||||
Shader "Obi/Particles" {
|
||||
|
||||
Properties {
|
||||
_Color ("Particle color", Color) = (1,1,1,1)
|
||||
_RadiusScale("Radius scale",float) = 1
|
||||
}
|
||||
|
||||
SubShader {
|
||||
|
||||
Pass {
|
||||
|
||||
Name "ParticleFwdBase"
|
||||
Tags {"Queue"="Geometry" "IgnoreProjector"="True" "RenderType"="Opaque" "LightMode" = "ForwardBase"}
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma fragmentoption ARB_precision_hint_fastest
|
||||
|
||||
#pragma multi_compile_fwdbase nolightmap
|
||||
|
||||
#include "ObiEllipsoids.cginc"
|
||||
#include "ObiUtils.cginc"
|
||||
#include "ObiLightingBuiltIn.cginc"
|
||||
|
||||
fixed4 _Color;
|
||||
fixed4 _LightColor0;
|
||||
|
||||
struct vin{
|
||||
float4 vertex : POSITION;
|
||||
float3 corner : NORMAL;
|
||||
fixed4 color : COLOR;
|
||||
|
||||
float4 t0 : TEXCOORD0; // ellipsoid t1 vector
|
||||
float4 t1 : TEXCOORD1; // ellipsoid t2 vector
|
||||
float4 t2 : TEXCOORD2; // ellipsoid t3 vector
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float4 pos : SV_POSITION;
|
||||
fixed4 color : COLOR;
|
||||
float4 mapping : TEXCOORD0;
|
||||
float3 viewRay : TEXCOORD1;
|
||||
float3 lightDir : TEXCOORD2;
|
||||
float3 a2 : TEXCOORD3;
|
||||
float3 a3 : TEXCOORD4;
|
||||
LIGHTING_COORDS(5,6)
|
||||
};
|
||||
|
||||
struct fout
|
||||
{
|
||||
half4 color : SV_Target;
|
||||
float depth : SV_Depth;
|
||||
};
|
||||
|
||||
v2f vert(vin v)
|
||||
{
|
||||
float3x3 P, IP;
|
||||
BuildParameterSpaceMatrices(v.t0,v.t1,v.t2,P,IP);
|
||||
|
||||
float3 worldPos;
|
||||
float3 view;
|
||||
float3 eye;
|
||||
float radius = BuildEllipsoidBillboard(v.vertex,v.corner,P,IP,worldPos,view,eye);
|
||||
|
||||
v2f o;
|
||||
o.pos = mul(UNITY_MATRIX_VP, float4(worldPos,v.vertex.w));
|
||||
o.mapping = float4(v.corner.xy,1/length(eye),radius); // A[1]
|
||||
o.viewRay = mul((float3x3)UNITY_MATRIX_V,view); // A[0]
|
||||
o.color = v.color * _Color;
|
||||
|
||||
BuildAuxiliaryNormalVectors(v.vertex,worldPos,view,P,IP,o.a2,o.a3);
|
||||
|
||||
o.lightDir = mul((float3x3)UNITY_MATRIX_MV, ObjSpaceLightDir(v.vertex));
|
||||
TRANSFER_VERTEX_TO_FRAGMENT(o);
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
fout frag(v2f i)
|
||||
{
|
||||
fout fo;
|
||||
|
||||
fo.color = half4(0,0,0,i.color.a);
|
||||
|
||||
// generate sphere normals:
|
||||
float3 p,n;
|
||||
IntersectEllipsoid(i.viewRay,i.mapping, i.a2,i.a3,p, n);
|
||||
|
||||
// clip space position:
|
||||
float4 pos = mul(UNITY_MATRIX_P,float4(p,1.0));
|
||||
|
||||
// simple lighting: ambient
|
||||
half3 amb = SampleSphereAmbient(n,p);
|
||||
|
||||
// simple lighting: diffuse
|
||||
float ndotl = saturate( dot( n, normalize(i.lightDir) ) );
|
||||
UNITY_LIGHT_ATTENUATION(atten,i,0);
|
||||
|
||||
// final lit color:
|
||||
fo.color.rgb = i.color * (_LightColor0 * ndotl * atten + amb);
|
||||
|
||||
// normalized device coordinates:
|
||||
fo.depth = pos.z/pos.w;
|
||||
|
||||
// in openGL calculated depth range is <-1,1> map it to <0,1>
|
||||
#if SHADER_API_OPENGL || SHADER_API_GLCORE || SHADER_API_GLES || SHADER_API_GLES3
|
||||
fo.depth = 0.5*fo.depth + 0.5;
|
||||
#endif
|
||||
|
||||
return fo;
|
||||
}
|
||||
|
||||
ENDCG
|
||||
|
||||
}
|
||||
|
||||
Pass {
|
||||
Name "ShadowCaster"
|
||||
Tags { "LightMode" = "ShadowCaster" }
|
||||
Offset 1, 1
|
||||
|
||||
Fog {Mode Off}
|
||||
ZWrite On ZTest LEqual
|
||||
|
||||
CGPROGRAM
|
||||
|
||||
#pragma vertex ellipsoidShadowVS
|
||||
#pragma fragment frag
|
||||
#pragma fragmentoption ARB_precision_hint_fastest
|
||||
|
||||
#pragma multi_compile_shadowcaster nolightmap
|
||||
|
||||
#include "ObiEllipsoids.cginc"
|
||||
#include "ObiUtils.cginc"
|
||||
#include "ObiLightingBuiltIn.cginc"
|
||||
|
||||
sampler3D _DitherMaskLOD;
|
||||
fixed4 _Color;
|
||||
|
||||
struct vin{
|
||||
float4 vertex : POSITION;
|
||||
float3 corner : NORMAL;
|
||||
fixed4 color : COLOR;
|
||||
|
||||
float4 t0 : TEXCOORD0; // ellipsoid t1 vector
|
||||
float4 t1 : TEXCOORD1; // ellipsoid t2 vector
|
||||
float4 t2 : TEXCOORD2; // ellipsoid t3 vector
|
||||
};
|
||||
|
||||
struct v2f {
|
||||
fixed4 color : COLOR;
|
||||
float4 mapping : TEXCOORD0;
|
||||
float3 viewRay : TEXCOORD1;
|
||||
};
|
||||
|
||||
struct fout
|
||||
{
|
||||
half4 color : SV_Target;
|
||||
float depth : SV_Depth;
|
||||
};
|
||||
|
||||
v2f ellipsoidShadowVS( vin v , out float4 outpos : SV_POSITION )// clip space position output
|
||||
{
|
||||
float3x3 P, IP;
|
||||
BuildParameterSpaceMatrices(v.t0,v.t1,v.t2,P,IP);
|
||||
|
||||
float3 worldPos;
|
||||
float3 view;
|
||||
float3 eye;
|
||||
float radius = BuildEllipsoidBillboard(v.vertex,v.corner,P,IP,worldPos,view,eye);
|
||||
|
||||
v2f o;
|
||||
outpos = mul(UNITY_MATRIX_VP, float4(worldPos,v.vertex.w));
|
||||
o.mapping = float4(v.corner.xy,1/length(eye),radius); // A[1]
|
||||
o.viewRay = mul((float3x3)UNITY_MATRIX_V,view); // A[0]
|
||||
o.color = v.color * _Color;
|
||||
return o;
|
||||
}
|
||||
|
||||
fout frag( v2f i , UNITY_VPOS_TYPE vpos : VPOS)
|
||||
{
|
||||
fout fo;
|
||||
|
||||
float3 p,n;
|
||||
IntersectEllipsoid(i.viewRay,i.mapping, float3(0,0,0),float3(0,0,0),p, n);
|
||||
|
||||
// project camera space position.
|
||||
float4 pos = UnityApplyLinearShadowBias( mul(UNITY_MATRIX_P,float4(p,1.0)) );
|
||||
|
||||
fo.color = pos.z/pos.w; //similar to what SHADOW_CASTER_FRAGMENT does in case there's no depth buffer.
|
||||
fo.depth = pos.z/pos.w;
|
||||
|
||||
// in openGL calculated depth range is <-1,1> map it to <0,1>
|
||||
#if SHADER_API_OPENGL || SHADER_API_GLCORE || SHADER_API_GLES || SHADER_API_GLES3
|
||||
fo.depth = fo.depth*0.5+0.5;
|
||||
#endif
|
||||
|
||||
// Use dither mask for alpha blended shadows, based on pixel position xy
|
||||
// and alpha level. Our dither texture is 4x4x16.
|
||||
half alphaRef = tex3D(_DitherMaskLOD, float3(vpos.xy*0.25,i.color.a*0.9375)).a;
|
||||
clip (alphaRef - 0.01);
|
||||
|
||||
return fo;
|
||||
}
|
||||
ENDCG
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
FallBack "Diffuse"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 801733041f66b49e1b3c2101471db877
|
||||
timeCreated: 1438934781
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
131
Assets/Obi/Resources/ObiMaterials/SimpleParticleShader.shader
Normal file
131
Assets/Obi/Resources/ObiMaterials/SimpleParticleShader.shader
Normal file
@@ -0,0 +1,131 @@
|
||||
Shader "Obi/Simple Particles" {
|
||||
|
||||
Properties {
|
||||
_Color ("Particle color", Color) = (1,1,1,1)
|
||||
}
|
||||
|
||||
SubShader {
|
||||
|
||||
Pass {
|
||||
|
||||
Name "ParticleFwdBase"
|
||||
Tags {"Queue"="Geometry" "IgnoreProjector"="True" "RenderType"="Opaque" "LightMode" = "ForwardBase"}
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma fragmentoption ARB_precision_hint_fastest
|
||||
|
||||
#pragma multi_compile_fwdbase nolightmap
|
||||
|
||||
#include "ObiParticles.cginc"
|
||||
#include "ObiUtils.cginc"
|
||||
#include "ObiLightingBuiltIn.cginc"
|
||||
|
||||
fixed4 _Color;
|
||||
fixed4 _LightColor0;
|
||||
|
||||
struct vin{
|
||||
float4 vertex : POSITION;
|
||||
float3 corner : NORMAL;
|
||||
fixed4 color : COLOR;
|
||||
float4 t0 : TEXCOORD0; // ellipsoid t1 vector
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float4 pos : POSITION;
|
||||
fixed4 color : COLOR;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
float3 lightDir : TEXCOORD1;
|
||||
LIGHTING_COORDS(3,4)
|
||||
};
|
||||
|
||||
v2f vert(vin v)
|
||||
{
|
||||
v2f o;
|
||||
|
||||
// particle positions are passed in world space, no need to use modelview matrix, just view.
|
||||
float radius = v.t0.w * _RadiusScale;
|
||||
float4 viewpos = mul(UNITY_MATRIX_V, v.vertex) + float4(v.corner.x, v.corner.y, 0, 0) * radius; // multiply by size.
|
||||
o.pos = mul(UNITY_MATRIX_P, viewpos);
|
||||
o.texcoord = float3(v.corner.x*0.5+0.5, v.corner.y*0.5+0.5, radius);
|
||||
o.color = v.color * _Color;
|
||||
|
||||
o.lightDir = mul ((float3x3)UNITY_MATRIX_MV, ObjSpaceLightDir(v.vertex));
|
||||
|
||||
TRANSFER_VERTEX_TO_FRAGMENT(o);
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
fixed4 frag(v2f i) : SV_Target
|
||||
{
|
||||
// generate sphere normals:
|
||||
float3 n = BillboardSphereNormals(i.texcoord);
|
||||
|
||||
// simple lighting: diffuse
|
||||
float ndotl = saturate( dot( n, normalize(i.lightDir) ) );
|
||||
|
||||
// final lit color:
|
||||
return fixed4(i.color.rgb * (_LightColor0 * ndotl + UNITY_LIGHTMODEL_AMBIENT),i.color.a);
|
||||
}
|
||||
|
||||
ENDCG
|
||||
|
||||
}
|
||||
|
||||
Pass {
|
||||
Name "ShadowCaster"
|
||||
Tags { "LightMode" = "ShadowCaster" }
|
||||
Offset 1, 1
|
||||
|
||||
Fog {Mode Off}
|
||||
ZWrite On ZTest LEqual
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma fragmentoption ARB_precision_hint_fastest
|
||||
|
||||
#pragma multi_compile_shadowcaster nolightmap
|
||||
|
||||
#include "ObiParticles.cginc"
|
||||
|
||||
struct vin{
|
||||
float4 vertex : POSITION;
|
||||
float3 corner : NORMAL;
|
||||
float4 t0 : TEXCOORD0; // ellipsoid t1 vector
|
||||
};
|
||||
|
||||
struct v2f {
|
||||
float4 pos : POSITION;
|
||||
float3 texcoord : TEXCOORD0;
|
||||
};
|
||||
|
||||
v2f vert( vin v )
|
||||
{
|
||||
v2f o;
|
||||
|
||||
float radius = v.t0.w * _RadiusScale;
|
||||
float4 viewpos = mul(UNITY_MATRIX_V, v.vertex) + float4(v.corner.x, v.corner.y, 0, 0) * radius;
|
||||
o.pos = mul(UNITY_MATRIX_P, viewpos);
|
||||
o.texcoord = float3(v.corner.x*0.5+0.5, v.corner.y*0.5+0.5, radius);
|
||||
return o;
|
||||
}
|
||||
|
||||
fixed4 frag( v2f i ) : SV_Target
|
||||
{
|
||||
float3 n = BillboardSphereNormals(i.texcoord);
|
||||
|
||||
return fixed4(0,0,0,0);
|
||||
}
|
||||
ENDCG
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
FallBack "Diffuse"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 87908c483837f4df49e97fa1aa0dacda
|
||||
timeCreated: 1489574725
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 63dbef444f58449a5b4786567ee38655
|
||||
guid: 7377795ea5bbd404ba97de2909380e01
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
36
Assets/Obi/Resources/ObiMaterials/URP/ObiLightingURP.cginc
Normal file
36
Assets/Obi/Resources/ObiMaterials/URP/ObiLightingURP.cginc
Normal file
@@ -0,0 +1,36 @@
|
||||
#ifndef OBILIGHTINGBUILTURP_INCLUDED
|
||||
#define OBILIGHTINGBUILTURP_INCLUDED
|
||||
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
|
||||
#include "Packages/com.unity.render-pipelines.universal/Shaders/LitInput.hlsl"
|
||||
|
||||
half3 SampleSphereAmbient(float3 eyeNormal)
|
||||
{
|
||||
half3 worldNormal = mul(UNITY_MATRIX_I_V,half4(eyeNormal,0.0));
|
||||
return SampleSH(worldNormal);
|
||||
}
|
||||
|
||||
float3 ObjSpaceLightDir(in float4 modelPos)
|
||||
{
|
||||
float3 lightPos = mul(unity_WorldToObject,_MainLightPosition).xyz;
|
||||
float3 lightVector = lightPos.xyz - modelPos * _MainLightPosition.w;
|
||||
return lightVector;
|
||||
}
|
||||
|
||||
float3 WorldSpaceLightDir(in float4 modelPos)
|
||||
{
|
||||
float3 vertexPos = mul(unity_ObjectToWorld, modelPos).xyz;
|
||||
float3 lightVector = _MainLightPosition.xyz - vertexPos * _MainLightPosition.w;
|
||||
return lightVector;
|
||||
}
|
||||
|
||||
half Attenuation(float3 eyePos)
|
||||
{
|
||||
half3 worldPos = mul(UNITY_MATRIX_I_V,half4(eyePos,1.0));
|
||||
float4 shadowCoord = TransformWorldToShadowCoord(worldPos);
|
||||
Light mainLight = GetMainLight(shadowCoord);
|
||||
return mainLight.shadowAttenuation * mainLight.distanceAttenuation;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2231c15aefcd6484e9857cbb64ad8cd7
|
||||
timeCreated: 1445285630
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
236
Assets/Obi/Resources/ObiMaterials/URP/ParticleShaderURP.shader
Normal file
236
Assets/Obi/Resources/ObiMaterials/URP/ParticleShaderURP.shader
Normal file
@@ -0,0 +1,236 @@
|
||||
Shader "Obi/URP/Particles" {
|
||||
|
||||
Properties {
|
||||
_Color ("Particle color", Color) = (1,1,1,1)
|
||||
_RadiusScale("Radius scale",float) = 1
|
||||
}
|
||||
|
||||
SubShader {
|
||||
|
||||
Tags{"RenderPipeline" = "UniversalRenderPipeline"}
|
||||
|
||||
Pass {
|
||||
|
||||
Name "ParticleFwdBase"
|
||||
Tags {"Queue"="Geometry" "IgnoreProjector"="True" "RenderType"="Opaque" "LightMode" = "UniversalForward"}
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
|
||||
HLSLPROGRAM
|
||||
|
||||
#pragma prefer_hlslcc gles
|
||||
#pragma exclude_renderers d3d11_9x
|
||||
#pragma target 2.0
|
||||
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma fragmentoption ARB_precision_hint_fastest
|
||||
|
||||
#pragma multi_compile _ _MAIN_LIGHT_SHADOWS
|
||||
#pragma multi_compile _ _MAIN_LIGHT_SHADOWS_CASCADE
|
||||
#pragma multi_compile _ _SHADOWS_SOFT
|
||||
|
||||
#include "../ObiUtils.cginc"
|
||||
#include "ObiLightingURP.cginc"
|
||||
#include "../ObiEllipsoids.cginc"
|
||||
|
||||
float4 _Color;
|
||||
float4 _LightColor0;
|
||||
|
||||
struct vin{
|
||||
float4 vertex : POSITION;
|
||||
float3 corner : NORMAL;
|
||||
float4 color : COLOR;
|
||||
float4 t0 : TEXCOORD0; // ellipsoid t1 vector
|
||||
float4 t1 : TEXCOORD1; // ellipsoid t2 vector
|
||||
float4 t2 : TEXCOORD2; // ellipsoid t3 vector
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float4 pos : SV_POSITION;
|
||||
float4 color : COLOR;
|
||||
float4 mapping : TEXCOORD0;
|
||||
float3 viewRay : TEXCOORD1;
|
||||
float3 lightDir : TEXCOORD2;
|
||||
float3 a2 : TEXCOORD3;
|
||||
float3 a3 : TEXCOORD4;
|
||||
};
|
||||
|
||||
struct fout
|
||||
{
|
||||
half4 color : SV_Target;
|
||||
float depth : SV_Depth;
|
||||
};
|
||||
|
||||
v2f vert(vin v)
|
||||
{
|
||||
float3x3 P, IP;
|
||||
BuildParameterSpaceMatrices(v.t0,v.t1,v.t2,P,IP);
|
||||
|
||||
float3 worldPos;
|
||||
float3 view;
|
||||
float3 eye;
|
||||
float radius = BuildEllipsoidBillboard(v.vertex,v.corner,P,IP,worldPos,view,eye);
|
||||
|
||||
v2f o;
|
||||
o.pos = mul(UNITY_MATRIX_VP, float4(worldPos,v.vertex.w));
|
||||
o.mapping = float4(v.corner.xy,1/length(eye),radius); // A[1]
|
||||
o.viewRay = mul((float3x3)UNITY_MATRIX_V,view); // A[0]
|
||||
o.color = v.color * _Color;
|
||||
|
||||
BuildAuxiliaryNormalVectors(v.vertex,worldPos,view,P,IP,o.a2,o.a3);
|
||||
|
||||
o.lightDir = mul((float3x3)UNITY_MATRIX_MV, ObjSpaceLightDir(v.vertex));
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
fout frag(v2f i)
|
||||
{
|
||||
fout fo;
|
||||
|
||||
fo.color = half4(0,0,0,i.color.a);
|
||||
|
||||
// generate sphere normals:
|
||||
float3 p,n;
|
||||
IntersectEllipsoid(i.viewRay,i.mapping, i.a2,i.a3, p, n);
|
||||
|
||||
// clip space position:
|
||||
float4 pos = mul(UNITY_MATRIX_P,float4(p,1.0));
|
||||
|
||||
// simple lighting: ambient
|
||||
half3 amb = SampleSphereAmbient(n);
|
||||
|
||||
// simple lighting: diffuse
|
||||
float ndotl = saturate( dot( n, normalize(i.lightDir) ) );
|
||||
float atten = Attenuation(p);
|
||||
|
||||
// final lit color:
|
||||
fo.color.rgb = i.color * (_LightColor0 * ndotl * atten + amb);
|
||||
|
||||
// normalized device coordinates:
|
||||
fo.depth = pos.z/pos.w;
|
||||
|
||||
// in openGL calculated depth range is <-1,1> map it to <0,1>
|
||||
#if SHADER_API_OPENGL || SHADER_API_GLCORE || SHADER_API_GLES || SHADER_API_GLES3
|
||||
fo.depth = 0.5 * fo.depth + 0.5;
|
||||
#endif
|
||||
|
||||
return fo;
|
||||
}
|
||||
|
||||
ENDHLSL
|
||||
|
||||
}
|
||||
|
||||
Pass {
|
||||
|
||||
Name "ShadowCaster"
|
||||
Tags { "LightMode" = "ShadowCaster" }
|
||||
Offset 1, 1
|
||||
|
||||
Fog {Mode Off}
|
||||
ZWrite On ZTest LEqual
|
||||
|
||||
HLSLPROGRAM
|
||||
|
||||
#pragma prefer_hlslcc gles
|
||||
#pragma exclude_renderers d3d11_9x
|
||||
#pragma target 2.0
|
||||
|
||||
#pragma vertex ellipsoidShadowVS
|
||||
#pragma fragment frag
|
||||
#pragma fragmentoption ARB_precision_hint_fastest
|
||||
|
||||
#pragma multi_compile_shadowcaster
|
||||
|
||||
#include "../ObiUtils.cginc"
|
||||
#include "ObiLightingURP.cginc"
|
||||
#include "../ObiEllipsoids.cginc"
|
||||
|
||||
sampler3D _DitherMaskLOD;
|
||||
float4 _Color;
|
||||
|
||||
struct vin{
|
||||
float4 vertex : POSITION;
|
||||
float3 corner : NORMAL;
|
||||
float4 color : COLOR;
|
||||
float4 t0 : TEXCOORD0; // ellipsoid t1 vector
|
||||
float4 t1 : TEXCOORD1; // ellipsoid t2 vector
|
||||
float4 t2 : TEXCOORD2; // ellipsoid t3 vector
|
||||
};
|
||||
|
||||
struct v2f {
|
||||
float4 color : COLOR;
|
||||
float4 mapping : TEXCOORD0;
|
||||
float3 viewRay : TEXCOORD1;
|
||||
float3 lightDir : TEXCOORD2;
|
||||
float3 a2 : TEXCOORD3;
|
||||
float3 a3 : TEXCOORD4;
|
||||
};
|
||||
|
||||
struct fout
|
||||
{
|
||||
half4 color : SV_Target;
|
||||
float depth : SV_Depth;
|
||||
};
|
||||
|
||||
v2f ellipsoidShadowVS( vin v , out float4 outpos : SV_POSITION )// clip space position output
|
||||
{
|
||||
float3x3 P, IP;
|
||||
BuildParameterSpaceMatrices(v.t0,v.t1,v.t2,P,IP);
|
||||
|
||||
float3 worldPos;
|
||||
float3 view;
|
||||
float3 eye;
|
||||
float radius = BuildEllipsoidBillboard(v.vertex,v.corner,P,IP,worldPos,view,eye);
|
||||
|
||||
v2f o;
|
||||
outpos = mul(UNITY_MATRIX_VP, float4(worldPos,v.vertex.w));
|
||||
o.mapping = float4(v.corner.xy,1/length(eye),radius); // A[1]
|
||||
o.viewRay = mul((float3x3)UNITY_MATRIX_V,view); // A[0]
|
||||
o.color = v.color * _Color;
|
||||
|
||||
BuildAuxiliaryNormalVectors(v.vertex,worldPos,view,P,IP,o.a2,o.a3);
|
||||
|
||||
o.lightDir = WorldSpaceLightDir(v.vertex);
|
||||
return o;
|
||||
}
|
||||
|
||||
fout frag( v2f i )
|
||||
{
|
||||
fout fo;
|
||||
|
||||
float3 p,n;
|
||||
IntersectEllipsoid(i.viewRay,i.mapping,i.a2,i.a3,p, n);
|
||||
|
||||
// calculate world space position and normal:
|
||||
float4 wnormal = mul(UNITY_MATRIX_I_V,float4(n,0));
|
||||
float4 wpos = mul(UNITY_MATRIX_I_V,float4(p,1));
|
||||
|
||||
// calculate clip space position.
|
||||
float4 clipPos = TransformWorldToHClip(ApplyShadowBias(wpos, wnormal, normalize(i.lightDir)));
|
||||
|
||||
#if UNITY_REVERSED_Z
|
||||
clipPos.z = min(clipPos.z, clipPos.w * UNITY_NEAR_CLIP_VALUE);
|
||||
#else
|
||||
clipPos.z = max(clipPos.z, clipPos.w * UNITY_NEAR_CLIP_VALUE);
|
||||
#endif
|
||||
|
||||
fo.color = clipPos.z/clipPos.w; //similar to what SHADOW_CASTER_FRAGMENT does in case there's no depth buffer.
|
||||
fo.depth = clipPos.z/clipPos.w;
|
||||
|
||||
// in openGL calculated depth range is <-1,1> map it to <0,1>
|
||||
#if SHADER_API_OPENGL || SHADER_API_GLCORE || SHADER_API_GLES || SHADER_API_GLES3
|
||||
fo.depth = fo.depth*0.5+0.5;
|
||||
#endif
|
||||
|
||||
return fo;
|
||||
}
|
||||
ENDHLSL
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 28641a0edd6e047c6af7e3c6b342c81a
|
||||
timeCreated: 1438934781
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,145 @@
|
||||
Shader "Obi/URP/Simple Particles" {
|
||||
|
||||
Properties {
|
||||
_Color ("Particle color", Color) = (1,1,1,1)
|
||||
}
|
||||
|
||||
SubShader {
|
||||
|
||||
Tags{"RenderPipeline" = "UniversalRenderPipeline"}
|
||||
|
||||
Pass {
|
||||
|
||||
Name "ParticleFwdBase"
|
||||
Tags {"Queue"="Geometry" "IgnoreProjector"="True" "RenderType"="Opaque" "LightMode" = "UniversalForward"}
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
|
||||
HLSLPROGRAM
|
||||
|
||||
#pragma prefer_hlslcc gles
|
||||
#pragma exclude_renderers d3d11_9x
|
||||
#pragma target 2.0
|
||||
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma fragmentoption ARB_precision_hint_fastest
|
||||
|
||||
#pragma multi_compile _ _MAIN_LIGHT_SHADOWS
|
||||
#pragma multi_compile _ _MAIN_LIGHT_SHADOWS_CASCADE
|
||||
#pragma multi_compile _ _SHADOWS_SOFT
|
||||
|
||||
#include "../ObiUtils.cginc"
|
||||
#include "ObiLightingURP.cginc"
|
||||
#include "../ObiParticles.cginc"
|
||||
|
||||
float4 _Color;
|
||||
float4 _LightColor0;
|
||||
|
||||
struct vin{
|
||||
float4 vertex : POSITION;
|
||||
float3 corner : NORMAL;
|
||||
float4 color : COLOR;
|
||||
float4 t0 : TEXCOORD0; // ellipsoid t1 vector
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float4 pos : POSITION;
|
||||
float4 color : COLOR;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
float3 lightDir : TEXCOORD1;
|
||||
};
|
||||
|
||||
v2f vert(vin v)
|
||||
{
|
||||
v2f o;
|
||||
|
||||
// particle positions are passed in world space, no need to use modelview matrix, just view.
|
||||
float radius = v.t0.w * _RadiusScale;
|
||||
float4 viewpos = mul(UNITY_MATRIX_V, v.vertex) + float4(v.corner.x, v.corner.y, 0, 0) * radius; // multiply by size.
|
||||
o.pos = mul(UNITY_MATRIX_P, viewpos);
|
||||
o.texcoord = float3(v.corner.x*0.5+0.5, v.corner.y*0.5+0.5, radius);
|
||||
o.color = v.color * _Color;
|
||||
|
||||
o.lightDir = mul ((float3x3)UNITY_MATRIX_MV, ObjSpaceLightDir(v.vertex));
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
float4 frag(v2f i) : SV_Target
|
||||
{
|
||||
// generate sphere normals:
|
||||
float3 n = BillboardSphereNormals(i.texcoord);
|
||||
|
||||
// simple lighting: ambient
|
||||
half3 amb = SampleSphereAmbient(n);
|
||||
|
||||
// simple lighting: diffuse
|
||||
float ndotl = saturate( dot( n, normalize(i.lightDir) ) );
|
||||
|
||||
// final lit color:
|
||||
return float4(i.color.rgb * (_LightColor0 * ndotl + amb),i.color.a);
|
||||
}
|
||||
|
||||
ENDHLSL
|
||||
|
||||
}
|
||||
|
||||
Pass {
|
||||
Name "ShadowCaster"
|
||||
Tags { "LightMode" = "ShadowCaster" }
|
||||
Offset 1, 1
|
||||
|
||||
Fog {Mode Off}
|
||||
ZWrite On ZTest LEqual
|
||||
|
||||
HLSLPROGRAM
|
||||
#pragma prefer_hlslcc gles
|
||||
#pragma exclude_renderers d3d11_9x
|
||||
#pragma target 2.0
|
||||
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma fragmentoption ARB_precision_hint_fastest
|
||||
|
||||
#pragma multi_compile_shadowcaster
|
||||
|
||||
#include "../ObiUtils.cginc"
|
||||
#include "ObiLightingURP.cginc"
|
||||
#include "../ObiParticles.cginc"
|
||||
|
||||
struct vin{
|
||||
float4 vertex : POSITION;
|
||||
float3 corner : NORMAL;
|
||||
float4 t0 : TEXCOORD0; // ellipsoid t1 vector
|
||||
};
|
||||
|
||||
struct v2f {
|
||||
float4 pos : POSITION;
|
||||
float3 texcoord : TEXCOORD0;
|
||||
};
|
||||
|
||||
v2f vert( vin v )
|
||||
{
|
||||
v2f o;
|
||||
|
||||
float radius = v.t0.w * _RadiusScale;
|
||||
float4 viewpos = mul(UNITY_MATRIX_V, v.vertex) + float4(v.corner.x, v.corner.y, 0, 0) * radius;
|
||||
o.pos = mul(UNITY_MATRIX_P, viewpos);
|
||||
o.texcoord = float3(v.corner.x*0.5+0.5, v.corner.y*0.5+0.5, radius);
|
||||
return o;
|
||||
}
|
||||
|
||||
float4 frag( v2f i ) : SV_Target
|
||||
{
|
||||
float3 n = BillboardSphereNormals(i.texcoord);
|
||||
|
||||
return float4(0,0,0,0);
|
||||
}
|
||||
ENDHLSL
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a8c46db5ccc10489cba075e7a9172ca6
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
Reference in New Issue
Block a user