浏览代码
Solved culling issue by having skybox follow camera, downside is shader code(world position etc)
/feature-new-clouds
Solved culling issue by having skybox follow camera, downside is shader code(world position etc)
/feature-new-clouds
André McGrail
4 年前
当前提交
b3469914
共有 7 个文件被更改,包括 1331 次插入 和 116 次删除
-
44Assets/Data/UniversalRP/BoatDemoRenderer.asset
-
359Assets/Objects/environment/Clouds/Clouds.shadergraph
-
16Assets/Objects/environment/Clouds/Shader Graphs_Clouds.mat
-
25Assets/Scripts/Environment/SkyboxFeature.cs
-
962Assets/scenes/demo_Island.unity
-
30Assets/Scripts/Utility/SkyboxSystem.cs
-
11Assets/Scripts/Utility/SkyboxSystem.cs.meta
359
Assets/Objects/environment/Clouds/Clouds.shadergraph
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
962
Assets/scenes/demo_Island.unity
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
using UnityEngine; |
|||
using UnityEngine.Rendering; |
|||
|
|||
[ExecuteAlways] |
|||
public class SkyboxSystem : MonoBehaviour |
|||
{ |
|||
public int scalefactor = 64; |
|||
|
|||
private void OnEnable() |
|||
{ |
|||
RenderPipelineManager.beginCameraRendering += OnCamera; |
|||
RenderPipelineManager.endCameraRendering += OnCameraFinish; |
|||
} |
|||
|
|||
private void OnDisable() |
|||
{ |
|||
RenderPipelineManager.beginCameraRendering -= OnCamera; |
|||
RenderPipelineManager.endCameraRendering -= OnCameraFinish; |
|||
} |
|||
|
|||
private void OnCamera(ScriptableRenderContext context, Camera camera) |
|||
{ |
|||
transform.position = Vector3.Lerp(camera.transform.position, Vector3.zero, 1f / scalefactor); |
|||
} |
|||
|
|||
private void OnCameraFinish(ScriptableRenderContext context, Camera camera) |
|||
{ |
|||
transform.position = Vector3.zero; |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: c2fa06bbaa7034232800d93136e0d361 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue