Dan
5 年前
当前提交
f2790ab7
共有 17 个文件被更改,包括 424 次插入 和 14 次删除
-
29Assets/AR Sample Objects/CoffeeMaker/Materials/CoffeeMaker_Base.mat
-
33Assets/AR Sample Objects/CoffeeMaker/Materials/CoffeeMaker_Kettle.mat
-
29Assets/AR Sample Objects/CoffeeMaker/Materials/CoffeeMaker_LED.mat
-
34Assets/AR Sample Objects/CoffeeMaker/Materials/CoffeeMaker_LEDGlass.mat
-
29Assets/AR Sample Objects/CoffeeMaker/Materials/CoffeeMaker_PowerButton.mat
-
29Assets/AR Sample Objects/CoffeeMaker/Materials/CoffeeMaker_PowerLight.mat
-
26Assets/AR Sample Objects/CoffeeMaker/Prefab/CoffeeMaker.prefab
-
12Assets/Common/Scripts/ProbePlacement.cs
-
2Assets/Shaders/Materials/CameraGrainMat.mat
-
2Assets/UX/Scenes/UXManagerScene.unity
-
52Assets/Shaders/Scripts/CameraGrainMultiMaterial.cs
-
11Assets/Shaders/Scripts/CameraGrainMultiMaterial.cs.meta
-
8Assets/Shaders/Textures.meta
-
10Assets/Shaders/Textures/GrainTexture.png
-
132Assets/Shaders/Textures/GrainTexture.png.meta
|
|||
using System; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
using UnityEngine.XR.ARFoundation; |
|||
|
|||
public class CameraGrainMultiMaterial : MonoBehaviour |
|||
{ |
|||
[SerializeField] |
|||
ARCameraManager m_CameraManager; |
|||
|
|||
public ARCameraManager cameraManager |
|||
{ |
|||
get => m_CameraManager; |
|||
set => m_CameraManager = value; |
|||
} |
|||
|
|||
[SerializeField] |
|||
List<Material> m_GrainMaterials; |
|||
|
|||
public List<Material> grainMaterials |
|||
{ |
|||
get => m_GrainMaterials; |
|||
set => m_GrainMaterials = value; |
|||
} |
|||
|
|||
void OnEnable() |
|||
{ |
|||
if(m_CameraManager == null) |
|||
{ |
|||
m_CameraManager = FindObjectOfType<ARCameraManager>(); |
|||
} |
|||
|
|||
m_CameraManager.frameReceived += OnReceivedFrame; |
|||
} |
|||
|
|||
void OnDisable() |
|||
{ |
|||
m_CameraManager.frameReceived -= OnReceivedFrame; |
|||
} |
|||
|
|||
void OnReceivedFrame(ARCameraFrameEventArgs eventArgs) |
|||
{ |
|||
#if UNITY_IOS
|
|||
for(int i = 0; i < m_GrainMaterials.Count; i++) |
|||
{ |
|||
m_GrainMaterials[i].SetTexture("_NoiseTex", eventArgs.cameraGrainTexture); |
|||
m_GrainMaterials[i].SetFloat("_NoiseIntensity", eventArgs.noiseIntensity); |
|||
} |
|||
#endif
|
|||
} |
|||
|
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: c3c759edd2c6d49bda80a810122bc4d9 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 2fcc4a1eb45eb4d9d9bfb02084cc09fb |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 623074edba20a4c239bad1bd7ce0293f |
|||
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: 8 |
|||
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 |
|||
- serializedVersion: 3 |
|||
buildTarget: iPhone |
|||
maxTextureSize: 2048 |
|||
resizeAlgorithm: 0 |
|||
textureFormat: 3 |
|||
textureCompression: 1 |
|||
compressionQuality: 50 |
|||
crunchedCompression: 0 |
|||
allowsAlphaSplitting: 0 |
|||
overridden: 1 |
|||
androidETC2FallbackOverride: 0 |
|||
forceMaximumCompressionQuality_BC6H_BC7: 0 |
|||
- serializedVersion: 3 |
|||
buildTarget: Android |
|||
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: |
撰写
预览
正在加载...
取消
保存
Reference in new issue