added TNTC paint system shader

This commit is contained in:
André Cardoso 2021-02-22 19:20:18 +01:00
parent c34062c024
commit 687e053e5f
49 changed files with 17229 additions and 840 deletions

View File

@ -109,7 +109,7 @@ Material:
m_Colors:
- _BaseColor: {r: 0.9339623, g: 0.9339623, b: 0.9339623, a: 1}
- _Color: {r: 0.9339623, g: 0.9339623, b: 0.9339623, a: 1}
- _EmissionColor: {r: 0, g: 4.317409, b: 5.9190283, a: 1}
- _EmissionColor: {r: 0, g: 5.82606, b: 15.804736, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
--- !u!114 &8885697949594529575

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6f05e4ffa2fdec34492fc1ec1f6570a4
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,69 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: PaintableWall
m_Shader: {fileID: -6465566751694194690, guid: d720082e5b71004498653db605c207b2, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- Texture2D_1e8bf045296a4f2fa636cd34c4384e49:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- Texture2D_3c9e15eb8c374e0495f36ea3d57473ab:
m_Texture: {fileID: 2800000, guid: fab85e0cacda9644a99e5182a86b71f5, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- Texture2D_41271c3c5f484ca2a435c65087a81705:
m_Texture: {fileID: 2800000, guid: 87ce03bd447ccce48bbff87ac0d8355f, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- Texture2D_9b6a369b9e8747268b99217d44bc2166:
m_Texture: {fileID: 2800000, guid: 35add2fc28f438c4da2c9a3a720ac55e, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MaskTexture:
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_Floats:
- BOOLEAN_7537779AF731407FB2B8FA45F3CE7497: 0
- Vector1_0de750b9c41b4a5daef844a1599f5ac7: 0.01
- Vector1_2871f666316541908d110962eef07f02: 80
- Vector1_2c6f3ce4bba145b09c0a22fced0d7f85: 0
- Vector1_7bf270fe91494824b4209d2dc1faae23: 0.9
- Vector1_8e760635099b4147956bb9600d13cac2: 0.2
- Vector1_b160a6374fb04a77b114bb611b8c55e4: 0
- Vector1_b5cc7f6f25194a778cb438f45fbbce66: 10
- Vector1_dcd729e4cd23406784678484c17def53: 1
m_Colors:
- Color_24a50704e3864d6797516f661edd7e3e: {r: 1, g: 0, b: 0, a: 0}
- Color_863351f5ceea4c998ef51baab6dd758b: {r: 1, g: 1, b: 1, a: 1}
- Color_d4f8c892e7d64512950150bf7ed32110: {r: 0.15395562, g: 1, b: 0.08962262, a: 0}
- Color_f80f35f483824d26a852f2ee81312a1a: {r: 0.3160377, g: 0.7127229, b: 1, a: 0}
m_BuildTextureStacks: []

View File

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

View File

@ -25,7 +25,7 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 2800000, guid: fab85e0cacda9644a99e5182a86b71f5, type: 3}
m_Texture: {fileID: 2800000, guid: 35add2fc28f438c4da2c9a3a720ac55e, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
@ -79,7 +79,7 @@ Material:
m_Floats:
- _AlphaClip: 0
- _Blend: 0
- _BumpScale: 1
- _BumpScale: 0.2
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
@ -104,7 +104,7 @@ Material:
- _WorkflowMode: 0
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 0, b: 0.26219988, a: 1}
- _BaseColor: {r: 1, g: 0.21226418, b: 0.4903099, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.103773594, g: 0.103773594, b: 0.103773594, a: 1}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b16a04feb9c7b87478011e54f21d9d70
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 00c653e06dde0b148ba9f2ac34bf1be0
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 112000000
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -0,0 +1,144 @@
fileFormatVersion: 2
guid: 242dbb0a79674fc40b038842c90f6135
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
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
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 1
seamlessCubemap: 1
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 2
aniso: 0
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 2
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 100
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: iPhone
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Windows Store Apps
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -0,0 +1,144 @@
fileFormatVersion: 2
guid: e4c3863a5e9b56942baed2ea1b952545
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
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
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 1
seamlessCubemap: 1
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 2
aniso: 0
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 2
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 100
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: iPhone
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Windows Store Apps
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

10715
Assets/Scenes/Paint TNTC.unity Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: df17bb02999771a45948c56ed8e85383
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -8,7 +8,7 @@ LightingSettings:
m_PrefabAsset: {fileID: 0}
m_Name: SampleSceneLightingSettings
serializedVersion: 3
m_GIWorkflowMode: 0
m_GIWorkflowMode: 1
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 0
m_RealtimeEnvironmentLighting: 0
@ -16,7 +16,7 @@ LightingSettings:
m_AlbedoBoost: 1
m_IndirectOutputScale: 1
m_UsingShadowmask: 0
m_BakeBackend: 1
m_BakeBackend: 2
m_LightmapMaxSize: 512
m_BakeResolution: 32
m_Padding: 2

View File

@ -0,0 +1,17 @@
using UnityEngine;
public class CollisionPainter : MonoBehaviour{
public Color paintColor;
public float radius = 1;
public float strength = 1;
public float hardness = 1;
private void OnCollisionStay(Collision other) {
Paintable p = other.collider.GetComponent<Paintable>();
if(p != null){
Vector3 pos = other.contacts[0].point;
PaintManager.instance.paint(p, pos, radius, hardness, strength, paintColor);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 2be8a48416f841d4fac024c4f1994147
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,36 @@
using UnityEngine;
public class MousePainter : MonoBehaviour{
public Camera cam;
[Space]
public bool mouseSingleClick;
[Space]
public Color paintColor;
public float radius = 1;
public float strength = 1;
public float hardness = 1;
void Update(){
bool click;
click = mouseSingleClick ? Input.GetMouseButtonDown(0) : Input.GetMouseButton(0);
if (click){
Vector3 position = Input.mousePosition;
Ray ray = cam.ScreenPointToRay(position);
RaycastHit hit;
if (Physics.Raycast(ray, out hit, 100.0f)){
Debug.DrawRay(ray.origin, hit.point - ray.origin, Color.red);
transform.position = hit.point;
Paintable p = hit.collider.GetComponent<Paintable>();
if(p != null){
PaintManager.instance.paint(p, hit.point, radius, hardness, strength, paintColor);
}
}
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 1abde833d7186b14285c3eb5913989ea
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,56 @@
using UnityEngine;
using UnityEngine.Rendering;
public class PaintManager : Singleton<PaintManager>{
public Shader texturePaint;
public Shader extendIslands;
int positionID = Shader.PropertyToID("_PainterPosition");
int hardnessID = Shader.PropertyToID("_Hardness");
int strengthID = Shader.PropertyToID("_Strength");
int radiusID = Shader.PropertyToID("_Radius");
int blendOpID = Shader.PropertyToID("_BlendOp");
int colorID = Shader.PropertyToID("_PainterColor");
int textureID = Shader.PropertyToID("_MainTex");
Material paintMaterial;
Material extendMaterial;
CommandBuffer command;
void Start(){
paintMaterial = new Material(texturePaint);
extendMaterial = new Material(extendIslands);
command = new CommandBuffer();
command.name = "CommmandBuffer - " + gameObject.name;
}
public void paint(Paintable paintable, Vector3 pos, float radius = 1f, float hardness = .5f, float strength = .5f, Color? color = null){
RenderTexture mask = paintable.getMask();
RenderTexture extend = paintable.getExtend();
RenderTexture support = paintable.getSupport();
Renderer rend = paintable.getRenderer();
paintMaterial.SetVector(positionID, pos);
paintMaterial.SetFloat(hardnessID, hardness);
paintMaterial.SetFloat(strengthID, strength);
paintMaterial.SetFloat(radiusID, radius);
paintMaterial.SetTexture(textureID, support);
paintMaterial.SetColor(colorID, color ?? Color.red);
command.SetRenderTarget(mask);
command.DrawRenderer(rend, paintMaterial, 0);
command.SetRenderTarget(support);
command.Blit(mask, support);
command.SetRenderTarget(extend);
command.Blit(mask, extend, extendMaterial);
Graphics.ExecuteCommandBuffer(command);
command.Clear();
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 97807551a49343d4a84e6d24e81cff4f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,45 @@
using UnityEngine;
using UnityEngine.Rendering;
public class Paintable : MonoBehaviour {
const int TEXTURE_SIZE = 1024;
RenderTexture extendIslandsRenderTexture;
RenderTexture maskRenderTexture;
RenderTexture supportTexture;
Renderer rend;
int maskTextureID = Shader.PropertyToID("_MaskTexture");
public RenderTexture getMask() => maskRenderTexture;
public RenderTexture getExtend() => extendIslandsRenderTexture;
public RenderTexture getSupport() => supportTexture;
public Renderer getRenderer() => rend;
void Start() {
maskRenderTexture = new RenderTexture(TEXTURE_SIZE, TEXTURE_SIZE, 0);
extendIslandsRenderTexture = new RenderTexture(TEXTURE_SIZE, TEXTURE_SIZE, 0);
extendIslandsRenderTexture.filterMode = FilterMode.Bilinear;
supportTexture = new RenderTexture(TEXTURE_SIZE, TEXTURE_SIZE, 0);
supportTexture.filterMode = FilterMode.Bilinear;
rend = GetComponent<Renderer>();
rend.material.SetTexture(maskTextureID, extendIslandsRenderTexture);
CommandBuffer command = new CommandBuffer();
command.name = "CommandBuffer - " + gameObject.name;
command.SetRenderTarget(maskRenderTexture);
command.SetRenderTarget(extendIslandsRenderTexture);
command.SetRenderTarget(supportTexture);
Graphics.ExecuteCommandBuffer(command);
}
void OnDisable(){
maskRenderTexture.Release();
extendIslandsRenderTexture.Release();
supportTexture.Release();
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 0c3ea44eef20b0b4396ebe666c9a6eeb
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,36 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ParticlesController: MonoBehaviour{
public Color paintColor;
public float minRadius = 0.05f;
public float maxRadius = 0.2f;
public float strength = 1;
public float hardness = 1;
[Space]
ParticleSystem part;
List<ParticleCollisionEvent> collisionEvents;
void Start(){
part = GetComponent<ParticleSystem>();
collisionEvents = new List<ParticleCollisionEvent>();
var pr = part.GetComponent<ParticleSystemRenderer>();
Color c = new Color(pr.material.color.r, pr.material.color.g, pr.material.color.b, .8f);
paintColor = c;
}
void OnParticleCollision(GameObject other) {
int numCollisionEvents = part.GetCollisionEvents(other, collisionEvents);
Paintable p = other.GetComponent<Paintable>();
if(p != null){
for (int i = 0; i< numCollisionEvents; i++){
Vector3 pos = collisionEvents[i].intersection;
float radius = Random.Range(minRadius, maxRadius);
PaintManager.instance.paint(p, pos, radius, hardness, strength, paintColor);
}
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a81a5c75c78d6364ea8c1a6f121e3a6c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 607eab570f0165c429ab607f92c6f610
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,52 @@
using UnityEngine;
public class Singleton<T> : MonoBehaviour where T: MonoBehaviour{
public static bool verbose = false;
public static bool keepAlive = true;
private static T _instance = null;
public static T instance {
get {
if(_instance == null){
_instance = GameObject.FindObjectOfType<T>();
if(_instance == null){
var singletonObj = new GameObject();
singletonObj.name = typeof(T).ToString();
_instance = singletonObj.AddComponent<T>();
}
}
return _instance;
}
}
static public bool isInstanceAlive{
get { return _instance != null; }
}
public virtual void Awake(){
if (_instance != null){
if(verbose)
Debug.Log("SingleAccessPoint, Destroy duplicate instance " + name + " of " + instance.name);
Destroy(gameObject);
return;
}
_instance = GetComponent<T>();
if(keepAlive){
DontDestroyOnLoad(gameObject);
}
if (_instance == null){
if(verbose)
Debug.LogError("SingleAccessPoint<" + typeof(T).Name + "> Instance null in Awake");
return;
}
if(verbose)
Debug.Log("SingleAccessPoint instance found " + instance.GetType().Name);
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a81968a323aba6a44b0bb536a20ba0ce
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -28,8 +28,8 @@ MonoBehaviour:
min: 0
max: 1
clamp:
m_OverrideState: 0
m_Value: 65472
m_OverrideState: 1
m_Value: 20
min: 0
tint:
m_OverrideState: 0
@ -134,7 +134,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c01700fd266d6914ababb731e09af2eb, type: 3}
m_Name: DepthOfField
m_EditorClassIdentifier:
active: 1
active: 0
m_AdvancedMode: 0
mode:
m_OverrideState: 1
@ -157,11 +157,11 @@ MonoBehaviour:
m_Value: 0
focusDistance:
m_OverrideState: 1
m_Value: 10
m_Value: 4.58
min: 0.1
aperture:
m_OverrideState: 1
m_Value: 5.6
m_Value: 1.8
min: 1
max: 32
focalLength:

8
Assets/Shaders.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 9e56053243baf614e8b8b2500b721cbe
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,58 @@
Shader "TNTC/ExtendIslands"{
Properties{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader{
Tags { "RenderType"="Opaque" }
LOD 100
Pass{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma target 3.0
#include "UnityCG.cginc"
struct appdata{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
};
sampler2D _MainTex;
float4 _MainTex_ST;
float4 _MainTex_TexelSize;
v2f vert (appdata v){
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
return o;
}
fixed4 frag (v2f i) : SV_Target{
float2 offsets[8] = {float2(-1,0), float2(1,0), float2(0,1), float2(0,-1), float2(-1,1), float2(1,1), float2(1,-1), float2(-1,-1)};
float2 uv = i.uv;
float4 color = tex2D(_MainTex, uv);
float4 extendedColor = color;
for (int i = 0; i < offsets.Length; i++){
float2 currentUV = uv + offsets[i] * _MainTex_TexelSize.xy;
float4 offsettedColor = tex2D(_MainTex, currentUV);
extendedColor = max(offsettedColor, extendedColor);
}
color = extendedColor;
return color;
}
ENDCG
}
}
}

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 30512f6167fa0784ab310b688406279d
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: d720082e5b71004498653db605c207b2
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}

View File

@ -0,0 +1,61 @@
Shader "TNTC/TexturePainter"{
Properties{
_PainterColor ("Painter Color", Color) = (0, 0, 0, 0)
}
SubShader{
Cull Off ZWrite Off ZTest Off
Pass{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
sampler2D _MainTex;
float4 _MainTex_ST;
float3 _PainterPosition;
float _Radius;
float _Hardness;
float _Strength;
float4 _PainterColor;
struct appdata{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f{
float4 vertex : SV_POSITION;
float2 uv : TEXCOORD0;
float4 worldPos : TEXCOORD1;
};
float mask(float3 position, float3 center, float radius, float hardness){
float m = distance(center, position);
return 1 - smoothstep(radius * hardness, radius, m);
}
v2f vert (appdata v){
v2f o;
o.worldPos = mul(unity_ObjectToWorld, v.vertex);
o.uv = v.uv;
float4 uv = float4(0, 0, 0, 1);
uv.xy = float2(1, _ProjectionParams.x) * (v.uv.xy * float2( 2, 2) - float2(1, 1));
o.vertex = uv;
return o;
}
fixed4 frag (v2f i) : SV_Target{
float4 col = tex2D(_MainTex, i.uv);
float f = mask(i.worldPos, _PainterPosition, _Radius, _Hardness);
float edge = f * _Strength;
return lerp(col, _PainterColor, edge);
}
ENDCG
}
}
}

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 9472ed3696ab33d4ab23fb2a11915e0c
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@ -34,6 +34,8 @@ public class ShootingSystem : MonoBehaviour
Vector3 localPos = parentController.localPosition;
parentController.DOLocalMove(localPos - new Vector3(0, 0, .1f), .03f)
.OnComplete(() => parentController.DOLocalMove(localPos,.1f).SetEase(Ease.OutSine));
freeLookCamera.GetComponent<CinemachineImpulseSource>().GenerateImpulse();
}
if (!DOTween.IsTweening(splatGunNozzle))

8
Assets/Textures.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 12e94df998e2b5b409b9528b9a59b37e
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

View File

@ -0,0 +1,96 @@
fileFormatVersion: 2
guid: a3e168dcdf5f56f44aad44b52c87e64b
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
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
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 KiB

View File

@ -0,0 +1,108 @@
fileFormatVersion: 2
guid: 915fce885e7a6a541b08b09e903e8a15
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 0
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
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 1
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

View File

@ -0,0 +1,96 @@
fileFormatVersion: 2
guid: 35add2fc28f438c4da2c9a3a720ac55e
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 0
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
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 1
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -6,6 +6,6 @@ EditorBuildSettings:
serializedVersion: 2
m_Scenes:
- enabled: 1
path: Assets/Scenes/SampleScene.unity
path: Assets/Scenes/MixAndJam.unity
guid: d1c3109bdb54ad54c8a2b2838528e640
m_configObjects: {}

View File

@ -6,8 +6,20 @@ EditorUserSettings:
serializedVersion: 4
m_ConfigSettings:
RecentlyUsedScenePath-0:
value: 22424703114646680e0b0227036c72111f19563f22213229
flags: 0
RecentlyUsedScenePath-1:
value: 22424703114646680e0b0227036c6c111b07142f1f2b233e2867083debf42d
flags: 0
UnityEditor.ShaderGraph.FloatingWindowsLayout2:
value: 181344140043005e1a220d3b1f364b524c0c5a27130c293326201334cee5322ca0bd30e8eb293a707b0fd0180b3d0a36fc0d3d04e649500d1002ee0b5dbd1d2c27c00ad113cb1e10e41f1addc80993b98d9884a69ae6d8f0d1cda9e8fbfefaf9f9dea3fdb9ade882f0f7b0e1e380cafbf2c3adc18e9cd285a2908b82ec869c8395949c9483d68a8e97ddbd90eed2a5a892a2af949aa48bafb19f85bd75a7ed3a7d25658598b7b58bb4b76aaf777690ca2863946c72c6cd81b6b6708f9f879f88769589d91c9d9b97729b01dc6c705666734161566b54406a5d7a694a1f37713d756a66771753783a27353f4c504172674347264e2e7a16016a711e4d7d5f686758400216064d1b4f4878757a576d726f6b3f577c7e477a6579002d00
flags: 0
UnityEditor.ShaderGraph.InspectorWindow:
value: 18135939215a0a5004000b0e15254b524c1119263f2d6a722016393ce1eb3d36e5d339f9a5602b2e2c07a37e0901373ae01e0008f707250d171df81a53a5485d41895ac825e0100ec20313c0d91cddccd3d0c7efcca9bd80908fecb0f9cfddf1eff4e7a1b1eae482f0fcaee1e1928b86d888ed909c968797a7cf
flags: 0
UnityEditor.ShaderGraph.ToggleSettings:
value: 18135d1527590858060c032302276919051e1a26296a7c243f3c187fa0e92708f0e220e0e22d09352a0bed30017c5b2be01f0c47b40219221f1ded0b12eb1f0127cc0bcc18c41a5e910d0edbc85193e0dadadbf8e8f9e8ced7dba5e0b6aaaca4dbfeabfef4eae1
flags: 0
vcSharedLogLevel:
value: 0d5e400f0650
flags: 0