ball visuals

main
Benjamin Kraft 1 year ago
parent 78be656b18
commit dbe1638985
  1. 47
      Assets/Materials/Ball.mat
  2. 8
      Assets/Materials/Ball.mat.meta
  3. 4
      Assets/Prefabs/Ball.prefab
  4. 16
      Assets/Scenes/Game.unity
  5. 0
      Assets/Shaders/BloomDefault.shadergraph
  6. 0
      Assets/Shaders/BloomDefault.shadergraph.meta
  7. 188
      Assets/Shaders/BloomSprites.shader
  8. 3
      Assets/Shaders/BloomSprites.shader.meta

@ -0,0 +1,47 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Ball
m_Shader: {fileID: 4800000, guid: da25e23f4bce4102a45b0743b67525c4, type: 3}
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _AlphaTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MaskTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- PixelSnap: 0
- _EnableExternalAlpha: 0
m_Colors:
- _Color: {r: 0.740121, g: 1.9565982, b: 2.037736, a: 1}
- _Flip: {r: 1, g: 1, b: 1, a: 1}
- _RendererColor: {r: 1, g: 1, b: 1, a: 1}
m_BuildTextureStacks: []

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 953bc0fd08d8200e9aebd8f91fd0bcf1
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

@ -58,7 +58,7 @@ SpriteRenderer:
m_RenderingLayerMask: 1 m_RenderingLayerMask: 1
m_RendererPriority: 0 m_RendererPriority: 0
m_Materials: m_Materials:
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} - {fileID: 2100000, guid: 953bc0fd08d8200e9aebd8f91fd0bcf1, type: 2}
m_StaticBatchInfo: m_StaticBatchInfo:
firstSubMesh: 0 firstSubMesh: 0
subMeshCount: 0 subMeshCount: 0
@ -80,7 +80,7 @@ SpriteRenderer:
m_SortingLayer: 0 m_SortingLayer: 0
m_SortingOrder: 0 m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: 47e353a78c92b9838963e533e37462e5, type: 3} m_Sprite: {fileID: 21300000, guid: 47e353a78c92b9838963e533e37462e5, type: 3}
m_Color: {r: 0.6415094, g: 0.30562478, b: 0.30562478, a: 1} m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0 m_FlipX: 0
m_FlipY: 0 m_FlipY: 0
m_DrawMode: 0 m_DrawMode: 0

@ -648,7 +648,7 @@ SpriteRenderer:
m_FlipX: 0 m_FlipX: 0
m_FlipY: 0 m_FlipY: 0
m_DrawMode: 2 m_DrawMode: 2
m_Size: {x: 20, y: 35} m_Size: {x: 34.728683, y: 35}
m_AdaptiveModeThreshold: 0.5 m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0 m_SpriteTileMode: 0
m_WasSpriteAssigned: 1 m_WasSpriteAssigned: 1
@ -937,7 +937,7 @@ Camera:
far clip plane: 1000 far clip plane: 1000
field of view: 60 field of view: 60
orthographic: 1 orthographic: 1
orthographic size: 27.6875 orthographic size: 23.152454
m_Depth: 0 m_Depth: 0
m_CullingMask: m_CullingMask:
serializedVersion: 2 serializedVersion: 2
@ -1010,11 +1010,11 @@ PrefabInstance:
m_Modifications: m_Modifications:
- target: {fileID: 4540566536649322900, guid: b4033513367475439bfcd048b5d376a6, type: 3} - target: {fileID: 4540566536649322900, guid: b4033513367475439bfcd048b5d376a6, type: 3}
propertyPath: m_Size.x propertyPath: m_Size.x
value: 20 value: 34.728683
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4540566536649322900, guid: b4033513367475439bfcd048b5d376a6, type: 3} - target: {fileID: 4540566536649322900, guid: b4033513367475439bfcd048b5d376a6, type: 3}
propertyPath: m_Size.y propertyPath: m_Size.y
value: 10.1875 value: 5.6524544
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4540566536649322901, guid: b4033513367475439bfcd048b5d376a6, type: 3} - target: {fileID: 4540566536649322901, guid: b4033513367475439bfcd048b5d376a6, type: 3}
propertyPath: m_Name propertyPath: m_Name
@ -1030,7 +1030,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4540566536649322903, guid: b4033513367475439bfcd048b5d376a6, type: 3} - target: {fileID: 4540566536649322903, guid: b4033513367475439bfcd048b5d376a6, type: 3}
propertyPath: m_LocalPosition.y propertyPath: m_LocalPosition.y
value: -22.59375 value: -20.326227
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4540566536649322903, guid: b4033513367475439bfcd048b5d376a6, type: 3} - target: {fileID: 4540566536649322903, guid: b4033513367475439bfcd048b5d376a6, type: 3}
propertyPath: m_LocalPosition.z propertyPath: m_LocalPosition.z
@ -1149,11 +1149,11 @@ PrefabInstance:
m_Modifications: m_Modifications:
- target: {fileID: 4540566536649322900, guid: b4033513367475439bfcd048b5d376a6, type: 3} - target: {fileID: 4540566536649322900, guid: b4033513367475439bfcd048b5d376a6, type: 3}
propertyPath: m_Size.x propertyPath: m_Size.x
value: 20 value: 34.728683
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4540566536649322900, guid: b4033513367475439bfcd048b5d376a6, type: 3} - target: {fileID: 4540566536649322900, guid: b4033513367475439bfcd048b5d376a6, type: 3}
propertyPath: m_Size.y propertyPath: m_Size.y
value: 10.1875 value: 5.6524544
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4540566536649322901, guid: b4033513367475439bfcd048b5d376a6, type: 3} - target: {fileID: 4540566536649322901, guid: b4033513367475439bfcd048b5d376a6, type: 3}
propertyPath: m_Name propertyPath: m_Name
@ -1169,7 +1169,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4540566536649322903, guid: b4033513367475439bfcd048b5d376a6, type: 3} - target: {fileID: 4540566536649322903, guid: b4033513367475439bfcd048b5d376a6, type: 3}
propertyPath: m_LocalPosition.y propertyPath: m_LocalPosition.y
value: 22.59375 value: 20.326227
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4540566536649322903, guid: b4033513367475439bfcd048b5d376a6, type: 3} - target: {fileID: 4540566536649322903, guid: b4033513367475439bfcd048b5d376a6, type: 3}
propertyPath: m_LocalPosition.z propertyPath: m_LocalPosition.z

@ -0,0 +1,188 @@
Shader "BloomSprites"
{
Properties
{
_MainTex ("Sprite Texture", 2D) = "white" {}
// Legacy properties. They're here so that materials using this shader can gracefully fallback to the legacy sprite shader.
[HDR] _Color ("Tint", Color) = (1,1,1,1)
[HideInInspector] PixelSnap ("Pixel snap", Float) = 0
[HideInInspector] _RendererColor ("RendererColor", Color) = (1,1,1,1)
[HideInInspector] _Flip ("Flip", Vector) = (1,1,1,1)
[HideInInspector] _AlphaTex ("External Alpha", 2D) = "white" {}
[HideInInspector] _EnableExternalAlpha ("Enable External Alpha", Float) = 0
}
SubShader
{
Tags {"Queue" = "Transparent" "RenderType" = "Transparent" "RenderPipeline" = "UniversalPipeline" }
Blend SrcAlpha OneMinusSrcAlpha
Cull Off
ZWrite Off
Pass
{
Tags { "LightMode" = "Universal2D" }
HLSLPROGRAM
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#if defined(DEBUG_DISPLAY)
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/InputData2D.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/SurfaceData2D.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Debug/Debugging2D.hlsl"
#endif
#pragma vertex UnlitVertex
#pragma fragment UnlitFragment
#pragma multi_compile _ DEBUG_DISPLAY
struct Attributes
{
float3 positionOS : POSITION;
float4 color : COLOR;
float2 uv : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct Varyings
{
float4 positionCS : SV_POSITION;
half4 color : COLOR;
float2 uv : TEXCOORD0;
#if defined(DEBUG_DISPLAY)
float3 positionWS : TEXCOORD2;
#endif
UNITY_VERTEX_OUTPUT_STEREO
};
TEXTURE2D(_MainTex);
SAMPLER(sampler_MainTex);
half4 _MainTex_ST;
float4 _Color;
half4 _RendererColor;
Varyings UnlitVertex(Attributes v)
{
Varyings o = (Varyings)0;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
o.positionCS = TransformObjectToHClip(v.positionOS);
#if defined(DEBUG_DISPLAY)
o.positionWS = TransformObjectToWorld(v.positionOS);
#endif
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
o.color = v.color * _Color * _RendererColor;
return o;
}
half4 UnlitFragment(Varyings i) : SV_Target
{
float4 mainTex = i.color * SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, i.uv);
#if defined(DEBUG_DISPLAY)
SurfaceData2D surfaceData;
InputData2D inputData;
half4 debugColor = 0;
InitializeSurfaceData(mainTex.rgb, mainTex.a, surfaceData);
InitializeInputData(i.uv, inputData);
SETUP_DEBUG_DATA_2D(inputData, i.positionWS);
if(CanDebugOverrideOutputColor(surfaceData, inputData, debugColor))
{
return debugColor;
}
#endif
return mainTex;
}
ENDHLSL
}
Pass
{
Tags { "LightMode" = "UniversalForward" "Queue"="Transparent" "RenderType"="Transparent"}
HLSLPROGRAM
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#if defined(DEBUG_DISPLAY)
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/InputData2D.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/SurfaceData2D.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Debug/Debugging2D.hlsl"
#endif
#pragma vertex UnlitVertex
#pragma fragment UnlitFragment
#pragma multi_compile_fragment _ DEBUG_DISPLAY
struct Attributes
{
float3 positionOS : POSITION;
float4 color : COLOR;
float2 uv : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct Varyings
{
float4 positionCS : SV_POSITION;
float4 color : COLOR;
float2 uv : TEXCOORD0;
#if defined(DEBUG_DISPLAY)
float3 positionWS : TEXCOORD2;
#endif
UNITY_VERTEX_OUTPUT_STEREO
};
TEXTURE2D(_MainTex);
SAMPLER(sampler_MainTex);
float4 _MainTex_ST;
float4 _Color;
half4 _RendererColor;
Varyings UnlitVertex(Attributes attributes)
{
Varyings o = (Varyings)0;
UNITY_SETUP_INSTANCE_ID(attributes);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
o.positionCS = TransformObjectToHClip(attributes.positionOS);
#if defined(DEBUG_DISPLAY)
o.positionWS = TransformObjectToWorld(attributes.positionOS);
#endif
o.uv = TRANSFORM_TEX(attributes.uv, _MainTex);
o.color = attributes.color * _Color * _RendererColor;
return o;
}
float4 UnlitFragment(Varyings i) : SV_Target
{
float4 mainTex = i.color * SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, i.uv);
#if defined(DEBUG_DISPLAY)
SurfaceData2D surfaceData;
InputData2D inputData;
half4 debugColor = 0;
InitializeSurfaceData(mainTex.rgb, mainTex.a, surfaceData);
InitializeInputData(i.uv, inputData);
SETUP_DEBUG_DATA_2D(inputData, i.positionWS);
if(CanDebugOverrideOutputColor(surfaceData, inputData, debugColor))
{
return debugColor;
}
#endif
return mainTex;
}
ENDHLSL
}
}
Fallback "Sprites/Default"
}

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: da25e23f4bce4102a45b0743b67525c4
timeCreated: 1681496561
Loading…
Cancel
Save