原创 unity shader中一個很奇葩的lerp運算
_MinColor("_MinColor", float) = 0 _Rate("_Rate", float) = 0 fixed4 col = lerp(_MinColor, fixed4(1,1,0,1), _Rate);
原创 火實現思想
1、粒子實現 2、粒子上有uv動畫 3、採樣貼圖,然後混合,在透明隊列,然後以Blend srcAlpha One的模式進行混合。 實現效果:
原创 半透明和cut off的物件烘焙注意點
1、我們的物件組成如下: 這是沒烘焙之前。 草使用的是我們自己的shader,plane使用的是內置的standard着色器。 自己shader如下: Shader "Unlit/GrassCutoff" { Prope
原创 Selected texture format ARGB 16 bit for platform DefaultTexturePlatform
unity bug 燈光選擇mixed模式,烘焙shadowmask,會報錯。 版本爲: 參考網址:https://forum.unity.com/threads/selected-texture-format-argb-16
原创 Cinemachine插件集成
https://blog.csdn.net/tanyu159/article/details/88608559
原创 UnityStandardMeta.cginc
float4 TexCoords(VertexInput v) { float4 texcoord; texcoord.xy = TRANSFORM_TEX(v.uv0, _MainTex); // Always
原创 srp中render方法執行分析
結論是顯而易見的:同一幀,對每個相機都會渲染一次。 實驗準備: 腳本: public class MyPipeline : RenderPipeline { CullResults cull; Material e
原创 srp第一講代碼註釋
using UnityEngine; using UnityEngine.Rendering; using UnityEngine.Experimental.Rendering; using Conditional = Syste
原创 水實現思想
unity中實現水的方法有多種,參考https://www.zhihu.com/oauth/redirect/social_info/wechat_mp?from=https%3A%2F%2Fzhuanlan.zhihu.com%
原创 srp的render方法和C#腳本的LateUpdate方法執行順序——號外號外
1、測試類 using UnityEngine; using UnityEngine.Rendering; [CreateAssetMenu(menuName = "Rendering/Custom Render Pipelin
原创 大地形中草繪製的思想
其實本篇是大地形繪製中一個特殊的案例,之所以說其是特殊的,是因爲我們的草,使用的是GPUInstance方式進行繪製。 也就是說同一種類型的草,使用DrawMesh的時候,會傳遞繪製的個數。 具體使用的函數如下: GrassIn
原创 fbx sdk的加載fbx模型文件——1
https://blog.csdn.net/bugrunner/article/details/7210511 https://www.cnblogs.com/white-L/p/11164584.html 配置 https://
原创 使用assimp解析mesh——骨骼動畫
bool SkinnedMesh::LoadMesh(const string& Filename) { // Release the previously loaded mesh (if it exists) C
原创 Unity UI拖拽功能實現——帶有彈簧效果
效果展示: 實現代碼+註釋: using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Ev