- 博客(40)
- 资源 (1)
- 收藏
- 关注
原创 计算内容区和视口区的偏移
internal static Vector2 InternalCalculateOffset(ref Bounds viewBounds, ref Bounds contentBounds, bool horizontal, bool vertical, MovementType movementType, ref Vector2 delta){ Vector2 offset = Vector2.zero; if (movementType == Move
2021-06-29 15:36:55 129
原创 RectTransform的Bounds
白色方块为view:红色方块为content:using System.Collections;using System.Collections.Generic;using UnityEngine;public class BoundsTest : MonoBehaviour{ public RectTransform m_view; public RectTransform m_content; public void ShowBounds() { .
2021-06-28 19:45:10 373
原创 查看进程的端口号,进程id和杀进程
https://jingyan.baidu.com/article/fdffd1f89a0c8af3e98ca10e.html
2021-06-26 15:06:05 213
原创 EditorGUILayout改变Label的颜色
https://zhuanlan.zhihu.com/p/103020700using UnityEditor;using UnityEditor.Timeline;using UnityEngine.Playables;using UnityEngine.Timeline;using System.Collections.Generic;using UnityEngine;[CustomEditor(typeof(TimelineBgmSignal))]public class Time
2021-06-26 09:52:23 3446 1
原创 3D LUT Creator 软件+教程
lut图,给一个默认的,程序生成的lut图。然后在ps或者3D LUT Creator中进行调色之后,就可以输出一个调色之后的lut图。然后shader中就可以采样,添加各种滤镜了。参考网址:https://catlikecoding.com/unity/tutorials/custom-srp/color-grading/https://www.bilibili.com/video/BV1EE411k7NA?p=26...
2021-06-23 20:57:32 1489 2
原创 untiy打android包,报unityStreamingAssets错误
mainTemplate.gradle file is using the old aaptOptions noCompress property definition which does not include types defined by unityStreamingAssets constant.解决方法:由于安装的国际版,导致unity的安装目录下的:unityStreamingAssets=.unity3dSTREAMING_ASSETS...
2021-06-23 19:49:24 3580 6
原创 unity2020以后aar方式调用android
<?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.cf.perfectsdk" > <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" ..
2021-06-21 10:35:05 1758 8
原创 jdk环境变量
JAVA_HOMEC:\Program Files\Java\jdk1.8.0_191CLASSPATH.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;Path中添加两个:%JAVA_HOME%\bin%JAVA_HOME%\jre\bin
2021-06-17 10:54:22 77
原创 纹理过滤模式中的Bilinear、Trilinear以及Anistropic Filtering
https://www.iteye.com/blog/smartblack-7629485、 Bilinear(双线性过滤)双线性过滤以pixel对应的纹理坐标为中心,采该纹理坐标周围4个texel的像素,再取平均,以平均值作为采样值。双线性过滤像素之间的过渡更加平滑,但是它只作用于一个MipMap Level,它选取texel和pixel之间大小最接近的那一层MipMap进行采样。当和pixel大小匹配的texel大小在两层Mipmap level之间时,双线性过滤在有些情况效果就不太好。于是就有了
2021-06-17 10:30:14 1065
原创 catlike中颜色分级由于lut精度不足和采样器的点采样导致的带状
https://catlikecoding.com/unity/tutorials/custom-srp/color-grading/
2021-06-17 10:24:01 173
原创 catlike中颜色分级和LUT的使用
个人觉得,https://catlikecoding.com/unity/tutorials/custom-srp/color-grading/这里的LUT的使用,并没有降低任何的计算。因为LUT的生成,是在每帧都生成的。并非离线bake出来的一个texture。如何使用shader,bake出来一个颜色查找表呢?3D的LUT,使用2D图进行表示。...
2021-06-16 14:02:07 391 2
原创 catlike HDR bloom fireflies中一闪一闪问题
https://catlikecoding.com/unity/tutorials/custom-srp/hdr/上图中,旋转摄像机,会看到一闪一闪的。
2021-06-15 19:52:06 821 2
原创 catlike中后处理的膝盖函数来由
https://catlikecoding.com/unity/tutorials/custom-srp/post-processing/中的膝盖函数:
2021-06-15 11:49:47 121 1
原创 C++中constexpr和nullptr
https://www.bilibili.com/video/BV1pk4y1z7JT/?spm_id_from=333.788.recommend_more_video.-1https://blog.csdn.net/janeqi1987/article/details/103542802constexpr表达式是指值不会改变并且在编译过程就能得到计算结果的表达式。
2021-06-09 20:18:51 90
原创 C++ explicit关键字
class B{public: B() = default; B(int a) { m_a = a; }private: int m_a;};int main(){ B aaa = 1; //可以,无报错,调用的是有参构造函数B(int a) return 0;}
2021-06-09 14:51:52 61
原创 C++ =default和=delete
=default让编译生成一个默认的函数class Sample2{public: Sample2() = default; //让编译器给Sample2生成默认构造函数 Sample2(int a) { m_a = a; } void show() = delete; int m_a;};=delete 标记全局函数,或者类成员函数为删除的函数。class Sample2{public: Sample2() = delete; Sample2(int a) {
2021-06-09 14:28:02 116
原创 C++中类模板中的静态变量初始化
template<typename T>struct A { static T t;};template<typename T> T A<T>::t = T{ 3 }; //泛化初始化template<typename T>struct A { static T t;};template<> int A<int>::t = 30; //特定类型初始化template<> float A<flo
2021-06-09 11:58:03 1364
原创 C++中的#和##
https://blog.csdn.net/mitu405687908/article/details/51084441template<typename Type>struct type_name_traits{ static const char* name;};#define REGISTER_COMPONENT_DEBUG_TYPE(T) \ template<> const char* type_name_traits<T>::name = #T
2021-06-09 11:34:07 153
原创 C++中inline
https://www.cnblogs.com/wuchanming/p/4061654.htmlinline成员函数在类体中定义的成员函数的规模一般都是很小,而系统调用函数的过程所花费的时间开销是相对比较大的。调用一个函数的时间开销远远大于小规模函数体中全部语句的执行时间。为了减少时间开销,如果在类体中定义的成员函数中不包括循环等控制结构,C++系统会自动将它们作为内置(inline)函数来处理。也就是说,在程序调用这些成员函数时,并不是真正地执行函数的调用过程(如保留返回地址等处理),而是把函
2021-06-07 12:04:00 229
原创 C++变量模板(variable template)
template用在一个变量上,其目的是什么呢?https://blog.csdn.net/zwvista/article/details/54612025#include <iostream>#include <iomanip>using namespace std;// 函数模板template<class T>constexpr T pi_fn(){ return T(3.1415926535897932385);}// 变量模板templ
2021-06-07 10:47:58 1232
原创 C++ 不同模板类型,不共享静态变量
template<typename T>void add(){ static int count = 0; count++;}template<typename T>class XX{public: inline static int count = 0; void say() { count++; }};//模板类同理template<class T>class templateClassUse {private: T x
2021-06-04 18:28:31 204
原创 ECS back and forth——Part 8 - Type Id
in C++, there is not a reliable way to associate unique identifiers to our types.class generator { inline static std::size_t counter{};public: template<typename Type> inline static const std::size_t type = counter++;};int main(){ int t1
2021-06-04 18:24:46 74
原创 C++ int a= {}和int a = 0
int a22(3); //a22 = 3; int a23 = (1, 2, 4); //a23=4 括号内是逗号表达式,逗号表达式的的值取逗号最右边的数 int a24 = { 3 };//a254 = 3; int a254 = {}; // a254 = 0;
2021-06-04 12:08:00 2926
原创 C++中std::is_empty和std::is_empty_v
An empty class is a class that stores no data, either cv-qualified or not.is_empty identifies as such all classes (declared with class or struct, but no union) that fulfill all of the following:has no non-static members other than bit-fields of length 0,
2021-06-04 11:53:46 833
原创 C++11中std::is_same和std::decay
https://blog.csdn.net/czyt1988/article/details/52812797https://www.apiref.com/cpp-zh/cpp/types/decay.htmltemplate<typename T>void typeCheck(T t){ if (std::is_same<T, int>::value) { std::cout << "int type" << std::endl; } e
2021-06-03 16:37:20 363
原创 C++中emplace_back
emplace_back 如何转发参数到 President 的构造函数,并展示如何用 emplace_back 避免用 push_back 时的额外复制或移动操作。https://www.apiref.com/cpp-zh/cpp/container/deque/emplace_back.html#include <iostream>#include <cstring>#include <vector>#include <queue>#inclu
2021-06-03 15:27:54 764
原创 C++委托
template<typename>class XDelegate;template<typename Ret, typename ...Args>class XDelegate<Ret(Args...)>{ using fun = Ret(Args...);public: fun *call; void Say() { Ret a = call(1, 2); int da = std::invoke(call, 1, 12); }};
2021-06-03 15:00:30 78
原创 C++中模板的偏特化和全特化&模板模板参数
https://www.ibm.com/docs/en/zos/2.3.0?topic=only-template-template-arguments-c解释:XX的主类,接受两个模板参数A和B。XX的特化类,接受一个模板参数A,而第二个参数为stringXX<int, string> a1;a1.sss();第二个参数为string,则匹配到特化类。而XX<string, int> a2;a2.sss();匹配不了特化类,则直接调用主类进行实例化。全特化:
2021-06-03 11:31:26 270
原创 C++中可变参数...args
情况1:模板类型参数A和B函数参数A和B分别看:sayHello<int,int>此时template<typename A, typename …B>A为int,B为intsayHello<int, int>(3, 4, 5, 6, 7); 中的3, 4, 5, 6, 7此时void sayHello(A t, B … args)A为3,B为4, 5, 6, 7所以v,此时为4, 5, 6, 7举例2:sayHello<int,int&
2021-06-03 10:17:47 9137
原创 C++ std::optional和std::nullopt
https://www.apiref.com/cpp-zh/cpp/utility/optional.html
2021-06-02 10:29:34 2323
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人