- 博客(33)
- 资源 (1)
- 收藏
- 关注
原创 unity_ShadowFadeCenterAndType
https://docs.unity3d.com/550/Documentation/Manual/class-QualitySettings.html这个值是怎么计算得到的。
2020-03-31 14:45:49 436
原创 unity_OcclusionMaskSelector
参考:https://blog.csdn.net/wodownload2/article/details/105178552https://blog.csdn.net/wodownload2/article/details/105216203
2020-03-31 12:16:50 470
原创 mixed模式下烘焙shadowmask记录的数据
构建烘焙场景:项目中只有一个平行光,烘焙之后:可以看到在只有一个平行光照射场景的情况下,这个黑色区域是阴影的区域。删除上一步的烘焙数据之后,调整一下光源方向,然后重新烘焙:可见我们的猜测是正确的。然后加入另外一个灯光:调整两个灯光的强度,使得有两个可见的阴影,然后进行烘焙:左边是第一个灯打开的烘焙结果,中间是第二个灯烘焙的结果,右边是第三个灯烘焙的结果:假如红色的灯光...
2020-03-31 10:37:33 621
原创 UNITY_NO_SCREENSPACE_SHADOWS打开时机
Graphics.activeTier = GraphicsTier.Tier1;GraphicsTier tiler = Graphics.activeTier;Debug.LogError(tiler);测试shader:#if defined (UNITY_NO_SCREENSPACE_SHADOWS) return half3(1, 0, 0);#else retur...
2020-03-30 18:13:22 801
原创 unity屏幕空间阴影
参考:https://zhuanlan.zhihu.com/p/45679584实验的原理很简单:1、从摄像机角度拍摄一张深度图,为cameraDepth2、从灯光角度拍摄一张深度图,为lightDepth3、将两个图blit,重建世界坐标点,转换到灯光空间,采样灯光空间的深度,比较,然后判断是否在阴影里,最后生成一个新的图,记作screenspaceShadowTex4、在绘制物体的时...
2020-03-30 16:58:28 2780 7
原创 unity中UnityGlobalIllumination.cginc的分析
inline UnityGI UnityGI_Base(UnityGIInput data, half occlusion, half3 normalWorld){ UnityGI o_gi; ResetUnityGI(o_gi); // Base pass with Lightmap support is responsible for handling ShadowM...
2020-03-29 14:41:52 1194
原创 SHADOWS_SCREEN宏打开的时机
必须满足以下的两个条件:1、平行光投射阴影2、有物体构成阴影条件3、设置好阴影距离第一个条件,限定在平行光,对于点光、其他的光源是不行的。测试,在场景中建立平行光,开启阴影:第二个条件,必须有物体参与了shadowmap的绘制,也即是默认使用的是屏幕空间阴影。如上图只有一个cube,是不会开启这个关键字的,需要有另外一个物体给自己投影。如上图,我们有开启一个sphere,那么...
2020-03-29 14:36:49 662
原创 pc和android平台下lightmap的质量选取导致的宏变化
准备烘焙环境:用standard的shader,进行烘焙。使用高质量的lightmap编码,其实也即是对应HDR模式。RGBA16 sFloat然后我们将一个物体的shader,换成下面的:Shader "Unlit/SampleLightmap"{ SubShader { Tags { "RenderType"="Opaque" } ...
2020-03-29 10:59:10 994
原创 RenderDoc截取unity帧,分析shader
此篇参考:https://blog.csdn.net/yangxuan0261/article/details/92732725
2020-03-27 18:09:19 3326
原创 再谈gamma校正——重要知识点
什么是gamma校正,经过一番学习之后,我想用最简单的百余字说明这个问题。这里首先给出几个参考网址:https://blog.csdn.net/candycat1992/article/details/46228771/https://www.bilibili.com/video/BV15t411Y7cf?from=search&seid=4640175940751520217就给...
2020-03-26 18:21:15 2151 1
原创 光照贴图的中的编码格式
https://docs.unity3d.com/Manual/Lightmaps-TechnicalInformation.htmlhttps://docs.unity3d.com/Manual/Lightmaps-TechnicalInformation.htmlhttps://blog.uwa4d.com/archives/1882.htmlhttp://ranaitian.com/2...
2020-03-26 14:36:37 1188
原创 分析GlobalIllumination函数的实现
代码在:E:\OGL\scriptable-render-pipeline-08-global-illumination\Assets\My Pipeline\ShaderLibraryfloat3 GlobalIllumination (VertexOutput input, LitSurface surface) { #if defined(LIGHTMAP_ON) float3...
2020-03-26 12:07:50 854
原创 Constant Buffers
https://catlikecoding.com/unity/tutorials/scriptable-render-pipeline/custom-shaders/摘自上面的网址。常量bufferunity does not provide us with a model-view-projection matrix, because that way a matrix multipli...
2020-03-26 11:07:02 1453
原创 如何查看srp中的shader文件
srp中包含的文件,大多形如:#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Shadow/ShadowSamplingTent.hlsl"很长,这个文件在哪里呢?不是在unity项目里面,而是在unity的安装目录下:比如,以Unity2018.3.0f2为例子:D:\Program Files\Unit...
2020-03-26 10:37:40 737
原创 SerializedProperty的属性名获取
/// <summary>/// https://forum.unity.com/threads/access-lighting-window-properties-in-script.328342//// </summary>/// <returns></returns>public static SerializedObject GetL...
2020-03-25 11:10:56 2777
原创 unity烘焙参数的程序化配置
参考网址:https://forum.unity.com/threads/access-lighting-window-properties-in-script.328342/https://github.com/Unity-Technologies/UnityCsReference/blob/master/Editor/Mono/SettingsWindow/LightingEditor.cs...
2020-03-24 18:17:49 247
原创 再谈DrawMeshInstancedIndirect的参数问题
https://blog.csdn.net/wodownload2https://docs.unity3d.com/ScriptReference/Graphics.DrawMeshInstancedIndirect.html
2020-03-19 18:10:28 6713
原创 四元数转矩阵
https://blog.csdn.net/silangquan/article/details/39008903#commentsedit
2020-03-19 17:40:02 477
原创 unity中草实现举例
https://blog.csdn.net/qq_38275140/article/details/89070146https://roystan.net/articles/grass-shader.htmlhttps://blog.csdn.net/yangxuan0261/article/details/90382630
2020-03-18 16:58:34 290
原创 Tex2DArray的使用举例
这里主要讲解的是,如何申请一个RT的时候,指定是一个2DArray的类型,然后怎样采样这个2DArray。本文实现的目标有两个:1、申请2DArray的rt,两个我的深度图,渲染到0号和1号的rt上2、完成阴影的计算如上图,绿色球的深度,画到rt的0号索引上;红色球的深度,画到rt的1号索引上。...
2020-03-18 10:33:10 1004
原创 RenderTexture.DiscardContents
https://docs.unity3d.com/ScriptReference/RenderTexture.DiscardContents.htmlhint the GPU driver that the contents of the RenderTexture will not be used.on some platforms, it can be good for performan...
2020-03-18 10:22:20 849
原创 SRP——聚光灯的阴影
https://catlikecoding.com/unity/tutorials/scriptable-render-pipeline/spotlight-shadows/https://zhuanlan.zhihu.com/p/83499311?from_voters_page=true什么是texture sampler?在老的GLSL代码中,我们使用sampler2D来定义textu...
2020-03-16 15:09:19 432
原创 unity深度图
https://gameinstitute.qq.com/community/detail/124214https://catlikecoding.com/unity/tutorials/scriptable-render-pipeline/spotlight-shadows/https://docs.unity3d.com/ScriptReference/RenderTextureForma...
2020-03-16 11:07:02 1354
原创 UNITY_REVERSED_Z
HLSLSupport.cginc#if defined(SHADER_API_D3D11) || defined(SHADER_API_PSSL) || defined(SHADER_API_XBOXONE) || defined(SHADER_API_METAL) || defined(SHADER_API_VULKAN) || defined(SHADER_API_SWITCH)// D...
2020-03-15 10:17:18 3163
原创 unity片元着色器的输入
// Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld'Shader "Unlit/VerifyGL"{ Properties { _MainTex ("Texture", 2D) = "white" {} } SubShader { Tag...
2020-03-14 18:48:50 380
原创 unity shader的调试
https://docs.unity3d.com/Manual/SL-DebuggingD3D11ShadersWithVS.html
2020-03-14 15:31:26 1517 1
原创 Learning to Love your Z-buffer
https://www.sjbaker.org/steve/omniv/love_your_z_buffer.html深度缓冲有16位、24位、还有32位。if u are luck enough to have a 32 bit z buffer, then z-precision may not seem to be an issue for u. however, if u expect ...
2020-03-13 14:48:36 228
原创 GetGPUProjectionMatrix
http://richbabe.top/2018/06/27/%E7%94%A8Unity%E5%AE%9E%E7%8E%B0Shadow-Map/https://blog.csdn.net/liuwumiyuhuiping/article/details/52524317实验1:proj = GL.GetGPUProjectionMatrix(proj2, true);分别作了,不用gl...
2020-03-11 11:46:19 1921
原创 关于view矩阵的说明
矩阵在线计算器:http://www.nicetool.net/app/matrix_multiplication.htmlhttp://www.yunsuan.info/cgi-bin/matrix_inverse.py上图是验算的草稿纸。并且是2D空间的一个变换推导。适用于3D空间。...
2020-03-10 11:36:53 266
原创 Universal Render Pipeline
https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@8.0/manual/InstallingAndConfiguringURP.html
2020-03-06 17:27:04 3247
原创 unity GI enlighten
Efficient Glossy Global Illumination With Interactive Viewinghttp://brahms.di.uminho.pt/discip/MCGAV/ifr0304/Artigos/Hanrahan91-HierarchicalRadiosity.pdfhttps://docs.unity3d.com/Manual/GI-Enlighten....
2020-03-06 14:18:38 286
原创 AABB是否和视锥体相交
https://www.iquilezles.org/www/articles/frustumcorrect/frustumcorrect.htm
2020-03-04 15:04:21 1343
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人