- 博客(14)
- 收藏
- 关注
原创 UnityShader 错误小集锦 持续更新
这个贴是专门记录在Shader学习和生产过程中发现的各种小问题,方便查阅复习1. 局部光太亮当发生这种情况时,往往是某个方向向量没有归一化。
2022-04-07 10:14:09 808
原创 Unity前向渲染路径简单概括笔记
Unity自5.0版本更新后,最常用的渲染路径有两个,一个是前向渲染ForwardRenderingPath,另一个是延迟渲染路径DeferredRenderingPath,而顶点照明渲染路径由于功能上已经被前向渲染覆盖,故目前已经是遗留状态。前向渲染路径可以理解为直接计算该模型的渲染图元,并计算颜色缓冲区和深度缓冲区的信息。深度缓冲区决定片元是否可见,颜色缓冲区决定片元最终呈现的效果。在一个有多个逐像素光源影响的场景内,我们需要分别使用不同的Pass来计算不同的逐像素光源,并把这些不同的光照结果在帧缓
2022-04-07 08:39:23 3247
原创 Unity 切换场景导致的MissingReferenceException
在制作过场效果时发现的问题。场景为当使用DontDestroyOnLoad保存渐变效果的Canvas时,转换场景会导致CanvasGroup的丢失,这是系统产生了类似于null.some_property的空值错误。解决办法就是在丢失的变量前加上this. this.canvasGroup = GetComponent<CanvasGroup>();解决办法参考自c# - 'MissingComponentException' with 'CanvasGroup.int..
2022-03-18 14:13:56 5045
原创 CountingSort C#
public void CountingSort(ref int[] list, int min = 0, int max = 0) { if(min == 0 && max == 0) { for (int i = 0; i < list.Length; ++i) { if (list[i] < min) .
2022-03-07 15:04:52 366
原创 ShellSort C#
public int[] InsertSortGap(int[] list, int gap) { int m_lenth = list.Length; int m_sortNum; for (int i = gap; i < m_lenth; i += gap)//每次取一个数,gap:希尔排序分段 { for (int s = i - gap; s &..
2022-03-07 13:49:52 165
原创 QuickSort C#
public int Partition(int[] list, int pFirst =0, int pLast=0) { int m_length = list.Length; int m_midNum = 0; int p1 = pFirst; int p2; if(pLast != 0) { ...
2022-02-21 12:10:59 182
原创 InsertSort c#
public int[] InsertSort(int[] list) { int m_lenth = list.Length; int m_sortNum; for(int i = 1; i < m_lenth; i++)//每次取一个数 { for(int s = i - 1; s >= 0 ; s--)//插入有序区 .
2022-02-18 15:09:01 90
原创 SelectSort c#
public int[] SelectSort (int[] list) { int m_min = 0; int m_minNum = 0; int m_lenth = list.Length; for (int i = 0; i < m_lenth; i++)//趟 { fo.
2022-02-18 13:20:07 98
原创 BubbleSort C#
public int[] BubbleSort(int[] list) { int m_lenth = list.Length; int m_sortedNum; int m_perfectNum = 0; for (int m_chaosList = m_lenth; m_chaosList > 1; m_chaosList--)//趟,每一趟m_chaosList无序区都少一个数 ...
2022-02-18 12:23:50 194
原创 [Python]KMP算法下用字符串切片方法实现的字符串替换
class StrPlaces: """用户需求在原文档中,查找相关字符并给出相关信息,并可实现替换操作, 用字符串切片功能实现str.replace功能""" def __init__(self, str, rex ,repl): self.str = str # 原文档 self.rex = rex # 被替换词 self.repl = repl # 替换词 def _rex_pnext_(self): .
2021-09-02 16:01:26 233
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人