当前位置: 首页 > news >正文

Unity Shader编辑器工具类ShaderUtil 常用函数和用法

Unity Shader编辑器工具类ShaderUtil 常用函数和用法

Unity Shader

Unity的Shader编辑器工具类ShaderUtil提供了一系列函数,用于编译、导入和管理着色器。本文将介绍ShaderUtil类中的常用函数和用法。

编译和导入函数

CompileShader

函数签名:public static bool CompileShader(string source, out string error);

CompileShader函数用于编译一个着色器。它接受一个字符串参数source,表示要编译的着色器代码,返回一个布尔值,表示编译是否成功。如果编译失败,可以通过out参数error获取错误信息。

以下是一个使用CompileShader函数的示例:

string shaderCode = @"Shader ""CustomShader"" {// 着色器代码}
";string error;
bool success = ShaderUtil.CompileShader(shaderCode, out error);if (success)
{Debug.Log("Shader compiled successfully!");
}
else
{Debug.LogError("Shader compilation failed: " + error);
}

OpenCompiledShader

函数签名:public static void OpenCompiledShader(string pathName, int line);

OpenCompiledShader函数用于在外部程序中打开已编译的着色器文件。它接受两个参数,pathName表示要打开的着色器文件的路径,line表示要跳转到的行数。

以下是一个使用OpenCompiledShader函数的示例:

string shaderPath = "Assets/Shaders/CustomShader.shader";
int line = 10;ShaderUtil.OpenCompiledShader(shaderPath, line);

属性和关键字函数

GetPropertyCount

函数签名:public static int GetPropertyCount(Shader shader);

这个函数用于获取指定着色器中属性的数量。它接受一个Shader对象作为参数,并返回该着色器中属性的数量。属性是在Shader编辑器中定义的变量,用于控制材质的外观和行为。

以下是一个示例代码,演示了如何使用GetPropertyCount函数获取着色器中属性的数量:

Shader shader = Shader.Find("MyShader");
int propertyCount = ShaderUtil.GetPropertyCount(shader);
Debug.Log("Property count: " + propertyCount);

GetPropertyName

函数签名:public static string GetPropertyName(Shader shader, int propertyIndex);

这个函数用于获取指定着色器中属性的名称。它接受一个Shader对象和属性的索引作为参数,并返回该属性的名称。

以下是一个示例代码,演示了如何使用GetPropertyName函数获取着色器中属性的名称:

Shader shader = Shader.Find("MyShader");
int propertyIndex = 0;
string propertyName = ShaderUtil.GetPropertyName(shader, propertyIndex);
Debug.Log("Property name: " + propertyName);

GetShaderKeywords

函数签名:public static string[] GetShaderKeywords(Shader shader);

这个函数用于获取指定着色器的关键字。关键字是在Shader编辑器中定义的标识符,用于控制着色器的不同功能和效果。

以下是一个示例代码,演示了如何使用GetShaderKeywords函数获取着色器的关键字:

Shader shader = Shader.Find("MyShader");
string[] keywords = ShaderUtil.GetShaderKeywords(shader);
Debug.Log("Shader keywords: " + string.Join(", ", keywords));

SetShaderKeywords

函数签名: public static void SetShaderKeywords(Shader shader, string[] keywords);

这个函数用于设置指定着色器的关键字。它接受一个Shader对象和一个关键字数组作为参数,并将这些关键字应用到着色器上。

以下是一个示例代码,演示了如何使用SetShaderKeywords函数设置着色器的关键字:

Shader shader = Shader.Find("MyShader");
string[] keywords = new string[] { "KEYWORD1", "KEYWORD2" };
ShaderUtil.SetShaderKeywords(shader, keywords);

渲染纹理函数

1. GetRenderTextureFormat

public static RenderTextureFormat GetRenderTextureFormat(string name);

该函数用于获取指定名称的渲染纹理格式。它接受一个字符串参数name,表示渲染纹理的名称,返回一个RenderTextureFormat枚举值,表示对应的渲染纹理格式。

2. GetRenderTargetCount

public static int GetRenderTargetCount();

该函数用于获取当前渲染目标的数量。它返回一个整数值,表示当前渲染目标的数量。

3. GetRenderTargetName

public static string GetRenderTargetName(int index);

该函数用于获取指定索引的渲染目标的名称。它接受一个整数参数index,表示渲染目标的索引,返回一个字符串值,表示对应渲染目标的名称。

4. GetRenderTargetPropertyCount

public static int GetRenderTargetPropertyCount(int index);

该函数用于获取指定渲染目标的属性数量。它接受一个整数参数index,表示渲染目标的索引,返回一个整数值,表示对应渲染目标的属性数量。

5. GetRenderTargetPropertyName

public static string GetRenderTargetPropertyName(int index, int propIndex);

该函数用于获取指定渲染目标的属性名称。它接受两个整数参数index和propIndex,分别表示渲染目标的索引和属性的索引,返回一个字符串值,表示对应属性的名称。

6. GetRenderTargetPropertyType

public static ShaderUtil.ShaderPropertyType GetRenderTargetPropertyType(int index, int propIndex);

该函数用于获取指定渲染目标的属性类型。它接受两个整数参数index和propIndex,分别表示渲染目标的索引和属性的索引,返回一个ShaderUtil.ShaderPropertyType枚举值,表示对应属性的类型。

7. GetRenderTargetPropertyValue

public static float GetRenderTargetPropertyValue(int index, int propIndex);

该函数用于获取指定渲染目标的属性值。它接受两个整数参数index和propIndex,分别表示渲染目标的索引和属性的索引,返回一个浮点数值,表示对应属性的值。

8. SetRenderTargetPropertyCount

public static void SetRenderTargetPropertyCount(int index, int count);

该函数用于设置指定渲染目标的属性数量。它接受两个整数参数index和count,分别表示渲染目标的索引和属性的数量。

9. SetRenderTargetPropertyName

public static void SetRenderTargetPropertyName(int index, int propIndex, string name);

该函数用于设置指定渲染目标的属性名称。它接受三个参数index、propIndex和name,分别表示渲染目标的索引、属性的索引和属性的名称。

10. SetRenderTargetPropertyType

public static void SetRenderTargetPropertyType(int index, int propIndex, ShaderUtil.ShaderPropertyType type);

该函数用于设置指定渲染目标的属性类型。它接受三个参数index、propIndex和type,分别表示渲染目标的索引、属性的索引和属性的类型。

11. SetRenderTargetPropertyValue

public static void SetRenderTargetPropertyValue(int index, int propIndex, float value);

该函数用于设置指定渲染目标的属性值。它接受三个参数index、propIndex和value,分别表示渲染目标的索引、属性的索引和属性的值。

示例代码

using UnityEngine;public class ShaderUtilExample : MonoBehaviour
{void Start(){// 获取渲染纹理格式RenderTextureFormat format = ShaderUtil.GetRenderTextureFormat("MyRenderTexture");Debug.Log("RenderTexture format: " + format);// 获取渲染目标数量int targetCount = ShaderUtil.GetRenderTargetCount();Debug.Log("Render target count: " + targetCount);// 获取渲染目标名称string targetName = ShaderUtil.GetRenderTargetName(0);Debug.Log("Render target name: " + targetName);// 获取渲染目标属性数量int propertyCount = ShaderUtil.GetRenderTargetPropertyCount(0);Debug.Log("Render target property count: " + propertyCount);// 获取渲染目标属性名称string propertyName = ShaderUtil.GetRenderTargetPropertyName(0, 0);Debug.Log("Render target property name: " + propertyName);// 获取渲染目标属性类型ShaderUtil.ShaderPropertyType propertyType = ShaderUtil.GetRenderTargetPropertyType(0, 0);Debug.Log("Render target property type: " + propertyType);// 获取渲染目标属性值float propertyValue = ShaderUtil.GetRenderTargetPropertyValue(0, 0);Debug.Log("Render target property value: " + propertyValue);// 设置渲染目标属性数量ShaderUtil.SetRenderTargetPropertyCount(0, 2);// 设置渲染目标属性名称ShaderUtil.SetRenderTargetPropertyName(0, 0, "Property1");ShaderUtil.SetRenderTargetPropertyName(0, 1, "Property2");// 设置渲染目标属性类型ShaderUtil.SetRenderTargetPropertyType(0, 0, ShaderUtil.ShaderPropertyType.Float);ShaderUtil.SetRenderTargetPropertyType(0, 1, ShaderUtil.ShaderPropertyType.Color);// 设置渲染目标属性值ShaderUtil.SetRenderTargetPropertyValue(0, 0, 1.0f);ShaderUtil.SetRenderTargetPropertyValue(0, 1, Color.red);}
}

其他函数

GetMaterial

public static Material GetMaterial(Renderer renderer, int materialIndex);

该函数用于获取指定渲染器(Renderer)上指定索引(materialIndex)的材质(Material)实例。在Unity中,渲染器可以包含多个材质,每个材质对应一个子网格(SubMesh)。以下是一个使用示例:

Renderer renderer = GetComponent<Renderer>();
Material material = ShaderUtil.GetMaterial(renderer, 0);

GetMaterialProperty

public static float GetMaterialProperty(Material material, int propertyIndex);
public static Vector4 GetMaterialProperty(Material material, int propertyIndex, bool isBatchable);

这个函数用于获取材质(Material)上指定索引(propertyIndex)的属性(Property)的值。属性可以是浮点数、向量等类型。以下是一个使用示例:

Material material = GetComponent<Renderer>().material;
float floatValue = ShaderUtil.GetMaterialProperty(material, 0);
Vector4 vectorValue = ShaderUtil.GetMaterialProperty(material, 1);

GetMaterialPropertyIndex

public static int GetMaterialPropertyIndex(Material material, string propertyName);

该函数用于获取材质(Material)上指定属性(propertyName)的索引(propertyIndex)。以下是一个使用示例:

Material material = GetComponent<Renderer>().material;
int propertyIndex = ShaderUtil.GetMaterialPropertyIndex(material, "_Color");

GetMaterialPropertyType

public static ShaderUtil.ShaderPropertyType GetMaterialPropertyType(Material material, int propertyIndex);

这个函数用于获取材质(Material)上指定索引(propertyIndex)的属性(Property)的类型(ShaderPropertyType)。以下是一个使用示例:

Material material = GetComponent<Renderer>().material;
ShaderUtil.ShaderPropertyType propertyType = ShaderUtil.GetMaterialPropertyType(material, 0);

GetMaterialPropertyDefaultValue

public static float GetMaterialPropertyDefaultValue(Material material, int propertyIndex);
public static Vector4 GetMaterialPropertyDefaultValue(Material material, int propertyIndex, bool isBatchable);

该函数用于获取材质(Material)上指定索引(propertyIndex)的属性(Property)的默认值。以下是一个使用示例:

Material material = GetComponent<Renderer>().material;
float defaultValue = ShaderUtil.GetMaterialPropertyDefaultValue(material, 0);
Vector4 defaultVector = ShaderUtil.GetMaterialPropertyDefaultValue(material, 1);

GetMaterialPropertyTextureDimension

public static TextureDimension GetMaterialPropertyTextureDimension(Material material, int propertyIndex);

这个函数用于获取材质(Material)上指定索引(propertyIndex)的纹理属性(Texture Property)的维度(TextureDimension)。以下是一个使用示例:

Material material = GetComponent<Renderer>().material;
TextureDimension dimension = ShaderUtil.GetMaterialPropertyTextureDimension(material, 0);

GetMaterialPropertyTextureDefaultName

public static string GetMaterialPropertyTextureDefaultName(Material material, int propertyIndex);

该函数用于获取材质(Material)上指定索引(propertyIndex)的纹理属性(Texture Property)的默认名称。以下是一个使用示例:

Material material = GetComponent<Renderer>().material;
string defaultName = ShaderUtil.GetMaterialPropertyTextureDefaultName(material, 0);

GetGlobalFloat

public static float GetGlobalFloat(string name);

这个函数用于获取全局浮点数属性(Global Float Property)的值。以下是一个使用示例:

float globalFloat = ShaderUtil.GetGlobalFloat("_MyGlobalFloat");

GetGlobalInt

public static int GetGlobalInt(string name);

该函数用于获取全局整数属性(Global Int Property)的值。以下是一个使用示例:

int globalInt = ShaderUtil.GetGlobalInt("_MyGlobalInt");

GetGlobalVector

public static Vector4 GetGlobalVector(string name);

这个函数用于获取全局向量属性(Global Vector Property)的值。以下是一个使用示例:

Vector4 globalVector = ShaderUtil.GetGlobalVector("_MyGlobalVector");

GetGlobalMatrix

public static Matrix4x4 GetGlobalMatrix(string name);

该函数用于获取全局矩阵属性(Global Matrix Property)的值。以下是一个使用示例:

Matrix4x4 globalMatrix = ShaderUtil.GetGlobalMatrix("_MyGlobalMatrix");

GetGlobalTexture

public static Texture GetGlobalTexture(string name);

这个函数用于获取全局纹理属性(Global Texture Property)的值。以下是一个使用示例:

Texture globalTexture = ShaderUtil.GetGlobalTexture("_MyGlobalTexture");

SetGlobalFloat

public static void SetGlobalFloat(string name, float value);

该函数用于设置全局浮点数属性(Global Float Property)的值。以下是一个使用示例:

ShaderUtil.SetGlobalFloat("_MyGlobalFloat", 1.5f);

这将把名为"_MyGlobalFloat"的全局浮点数属性设置为1.5。

SetGlobalInt

public static void SetGlobalInt(string name, int value);

这个函数用于设置全局整数属性(Global Int Property)的值。以下是一个使用示例:

ShaderUtil.SetGlobalInt("_MyGlobalInt", 10);

这将把名为"_MyGlobalInt"的全局整数属性设置为10。

SetGlobalVector

public static void SetGlobalVector(string name, Vector4 value);

该函数用于设置全局向量属性(Global Vector Property)的值。以下是一个使用示例:

ShaderUtil.SetGlobalVector("_MyGlobalVector", new Vector4(1, 2, 3, 4));

这将把名为"_MyGlobalVector"的全局向量属性设置为(1, 2, 3, 4)。

SetGlobalMatrix

public static void SetGlobalMatrix(string name, Matrix4x4 value);

这个函数用于设置全局矩阵属性(Global Matrix Property)的值。以下是一个使用示例:

Matrix4x4 matrix = Matrix4x4.identity;
ShaderUtil.SetGlobalMatrix("_MyGlobalMatrix", matrix);

这将把名为"_MyGlobalMatrix"的全局矩阵属性设置为单位矩阵。

SetGlobalTexture

public static void SetGlobalTexture(string name, Texture value);

该函数用于设置全局纹理属性(Global Texture Property)的值。以下是一个使用示例:

Texture texture = Resources.Load<Texture>("MyTexture");
ShaderUtil.SetGlobalTexture("_MyGlobalTexture", texture);

这将把名为"_MyGlobalTexture"的全局纹理属性设置为名为"MyTexture"的资源纹理。


我对技术文章中可能存在的错误向您表示诚挚的歉意。我努力确保提供准确可靠的信息,但由于技术领域的不断变化,错误难以避免。如果您发现了错误或有任何疑问,请与我联系。我将竭尽全力纠正错误并提供更准确的信息。

再次向您表示最诚挚的歉意,我将更加谨慎地审查和更新文章,以提供更好的阅读体验和准确的技术信息。

谢谢您的理解和支持。

相关文章:

Unity Shader编辑器工具类ShaderUtil 常用函数和用法

Unity Shader编辑器工具类ShaderUtil 常用函数和用法 Unity的Shader编辑器工具类ShaderUtil提供了一系列函数&#xff0c;用于编译、导入和管理着色器。本文将介绍ShaderUtil类中的常用函数和用法。 编译和导入函数 CompileShader 函数签名&#xff1a;public static bool C…...

详解Spring中涉及的技术

注解 介绍&#xff1a; 注解(Annotation)很重要&#xff0c;未来的开发模式都是基于注解的&#xff0c;JPA是基于注解的&#xff0c;Spring2.5以上都是基于注解的&#xff0c;Hibernate3.x以后也是基于注解的&#xff0c;现在的Struts2有一部分也是基于注解的了&#xff0c;注…...

阿里云ssl免费数字证书快过期 如何更换

1.登陆阿里云 找到ssl 查看快过期的证书 数字证书管理服务-ssl证书 2.创建免费的证书&#xff0c;对应过期证书的域名 3.下载新证书 pem key放在本地 此处记录本地的下载路径 /Users/dorsey/Downloads/10791167_lzzabc.cn_nginx/lzzabc.cn.pem /Users/dorsey/Downloads/1…...

利用OpenCV实现图像拼接

一、介绍 图像拼接. 二、分步实现 要实现图像拼接&#xff0c;简单来说有以下几步&#xff1a; 对每幅图进行特征点提取对对特征点进行匹配进行图像配准把图像拷贝到另一幅图像的特定位置对重叠边界进行特殊处理 PS&#xff1a;需要使用低版本的opencv&#xff0c;否则无法使…...

【java安全】无Commons-Collections的Shiro550反序列化利用

文章目录 【java安全】无Commons-Collections的Shiro550反序列化利用Shiro550利用的难点CommonsBeanutils1是否可以Shiro中&#xff1f;什么是serialVersionUID&#xff1f;W 无依赖的Shiro反序列化利用链POC 【java安全】无Commons-Collections的Shiro550反序列化利用 Shiro5…...

CSS 滚动条

一、滚动条样式属性 ::-webkit-scrollbar {width: 6px; /* 竖向滚动条宽度 */height: 6px; /* 横向滚动条高度 */ }::-webkit-scrollbar-thumb {border-radius: 10px; /* 滚动条样式 */-webkit-box-shadow: inset 0 0 3px red; /* 内阴影 */background-color: blue; /* 滚动条…...

Linux: security: openssh: sshd 出现defunct的一种情况

最近遇到了一个问题,就出现了一对遗留进程对,类似于下面这两个 root 77399 19100 77399 0 1 01:46 ? 00:00:00 sshd: \mzhan017 [priv] sshd 77400 77399 77400 0 1 01:46 ? 00:00:00 sshd: [defunct] 人生中的第一次遇到这种情况。一定要记录一下! 关于[priv]这个解释,…...

Self-regulating Prompts: Foundational Model Adaptation without Forgetting

本文也是大模型系列的文章&#xff0c;主要是与Prompt Learning有关。针对《Self-regulating Prompts: Foundational Model Adaptation without Forgetting》的翻译。 自我调节的提示&#xff1a;不遗忘的基础模型适应 摘要1 引言2 相关工作3 提出的方法3.1 前言3.2 提示学习的…...

平时工资不够用?推荐4种适合工作之余做的兼职副业!

你是否也曾经在为每个月的工资发愁&#xff1f;你是否想过做点副业来增加收入&#xff1f;现在很多上班族的工资&#xff0c;已经难以满足他们的生活需求了&#xff0c;很多人开始尝试通过副业来增加收入。那么上班族要如何寻找适合自己的副业呢&#xff1f;下面就给大家分享几…...

21.Netty源码之编码器

highlight: arduino-light Netty如何实现自定义通信协议 在学习完如何设计协议之后&#xff0c;我们又该如何在 Netty 中实现自定义的通信协议呢&#xff1f;其实 Netty 作为一个非常优秀的网络通信框架&#xff0c;已经为我们提供了非常丰富的编解码抽象基类&#xff0c;帮助我…...

Linux 快速创建桌面图标

在安装 tar.gz 这类型压缩文件时&#xff0c;通常启动文件是.sh文件。文章主要记录快速添加到桌面图标。 1、解压 tar -zxvf XXX.tar.gz 2、创建桌面图标文件 touch XXX.desktop 3、文件中配置 [Desktop Entry] NameXXX CommentZZZ Exec/软件可执行文件所在目录/可执行文…...

数据结构—哈夫曼树及其应用

5.6哈夫曼树及其应用 5.6.1哈夫曼树的基本概念 路径&#xff1a;从树中一个结点到另一个结点之间的分支构成这两个结点间的路径。 结点的路径长度&#xff1a;两结点间路径上的分支数。 树的路径长度&#xff1a;从树根到每一个结点的路径长度之和。记作 TL 结点数目相同的…...

NeRF-SLAM: Real-Time Dense Monocular SLAM with Neural Radiance Fields 论文阅读

论文信息 题目&#xff1a;NeRF-SLAM: Real-Time Dense Monocular SLAM with Neural Radiance Fields 作者&#xff1a;Antoni Rosinol, John J. Leonard&#xff0c; Luca Carlone 代码&#xff1a;https://github.com/ToniRV/NeRF-SLAM 来源&#xff1a;arxiv 时间&#xff…...

机器学习之弹性网络(Elastic Net)

弹性网络 代码原文 下面代码参考scikit-learn中文社区&#xff0c;链接在上面。 但是由于scikit-learn中文社区上的代码有些地方跑不通&#xff0c;故对此代码做了修改&#xff0c;输出结果与社区中显示的结果相同。 对弹性网络进行简单的介绍&#xff1a; ElasticNet是一个训…...

嵌入式入门教学——C51

一、前期准备 1、硬件设备 2、软件设备 二、预备知识 1、什么是单片机&#xff1f; 在一片集成电路芯片上集成微处理器、存储器、IO接口电路&#xff0c;从而构成了单芯片微型计算机&#xff0c;及单片机。STC89C52单片机&#xff1a; STC&#xff1a;公司89&#xff1a;所属…...

2023-08-03力扣每日一题

链接&#xff1a; 722. 删除注释 题意&#xff1a; 如题&#xff0c;特殊规则见链接 解&#xff1a; 字符串处理&#xff0c;嗯写就完事了,主要是判断指针位置和特殊规则 实际代码&#xff1a; #include<bits/stdc.h> using namespace std; vector<string> …...

【蓝桥杯备考资料】如何进入国赛?

目录 写在前面注意事项数组、字符串处理BigInteger日期问题DFS 2013年真题Java B组世纪末的星期马虎的算式振兴中华黄金连分数有理数类&#xff08;填空题&#xff09;三部排序&#xff08;填空题&#xff09;错误票据幸运数字带分数连号区间数 2014年真题蓝桥杯Java B组03猜字…...

QtWebApp开发https服务器,完成客户端与服务器基于ssl的双向认证

引言&#xff1a;所谓http协议&#xff0c;本质上也是基于TCP/IP上服务器与客户端请求和应答的标准&#xff0c;web开发中常用的http server有apache和nginx。Qt程序作为http client可以使用QNetworkAccessManager很方便的进行http相关的操作。Qt本身并没有http server相关的库…...

动态IP代理的优势展现与应用场景

在当今数字化时代&#xff0c;网络安全和隐私保护变得愈发重要。作为一家动态IP代理产品供应商&#xff0c;我们深知在保护个人隐私和提高网络安全性方面的重要性。本文将会分享动态IP代理的优势及其在不同应用场景下的实际应用案例&#xff0c;帮助更好地了解和应用动态IP代理…...

ad+硬件每日学习十个知识点(22)23.8.2(LDO datasheet手册解读)

文章目录 1.LDO的概述、features2.LDO的绝对参数&#xff08;功率升温和结温&#xff09;3.LDO的引脚功能4.LDO的电气特性5.LDO的典型电路&#xff08;电容不能真用1uF&#xff0c;虽然按比例取输出值&#xff0c;但是R2的取值要考虑释放电流&#xff09;6.LDO的开关速度和线性…...

浅谈 React Hooks

React Hooks 是 React 16.8 引入的一组 API&#xff0c;用于在函数组件中使用 state 和其他 React 特性&#xff08;例如生命周期方法、context 等&#xff09;。Hooks 通过简洁的函数接口&#xff0c;解决了状态与 UI 的高度解耦&#xff0c;通过函数式编程范式实现更灵活 Rea…...

反向工程与模型迁移:打造未来商品详情API的可持续创新体系

在电商行业蓬勃发展的当下&#xff0c;商品详情API作为连接电商平台与开发者、商家及用户的关键纽带&#xff0c;其重要性日益凸显。传统商品详情API主要聚焦于商品基本信息&#xff08;如名称、价格、库存等&#xff09;的获取与展示&#xff0c;已难以满足市场对个性化、智能…...

.Net框架,除了EF还有很多很多......

文章目录 1. 引言2. Dapper2.1 概述与设计原理2.2 核心功能与代码示例基本查询多映射查询存储过程调用 2.3 性能优化原理2.4 适用场景 3. NHibernate3.1 概述与架构设计3.2 映射配置示例Fluent映射XML映射 3.3 查询示例HQL查询Criteria APILINQ提供程序 3.4 高级特性3.5 适用场…...

线程同步:确保多线程程序的安全与高效!

全文目录&#xff1a; 开篇语前序前言第一部分&#xff1a;线程同步的概念与问题1.1 线程同步的概念1.2 线程同步的问题1.3 线程同步的解决方案 第二部分&#xff1a;synchronized关键字的使用2.1 使用 synchronized修饰方法2.2 使用 synchronized修饰代码块 第三部分&#xff…...

电脑插入多块移动硬盘后经常出现卡顿和蓝屏

当电脑在插入多块移动硬盘后频繁出现卡顿和蓝屏问题时&#xff0c;可能涉及硬件资源冲突、驱动兼容性、供电不足或系统设置等多方面原因。以下是逐步排查和解决方案&#xff1a; 1. 检查电源供电问题 问题原因&#xff1a;多块移动硬盘同时运行可能导致USB接口供电不足&#x…...

【论文笔记】若干矿井粉尘检测算法概述

总的来说&#xff0c;传统机器学习、传统机器学习与深度学习的结合、LSTM等算法所需要的数据集来源于矿井传感器测量的粉尘浓度&#xff0c;通过建立回归模型来预测未来矿井的粉尘浓度。传统机器学习算法性能易受数据中极端值的影响。YOLO等计算机视觉算法所需要的数据集来源于…...

保姆级教程:在无网络无显卡的Windows电脑的vscode本地部署deepseek

文章目录 1 前言2 部署流程2.1 准备工作2.2 Ollama2.2.1 使用有网络的电脑下载Ollama2.2.2 安装Ollama&#xff08;有网络的电脑&#xff09;2.2.3 安装Ollama&#xff08;无网络的电脑&#xff09;2.2.4 安装验证2.2.5 修改大模型安装位置2.2.6 下载Deepseek模型 2.3 将deepse…...

JVM 内存结构 详解

内存结构 运行时数据区&#xff1a; Java虚拟机在运行Java程序过程中管理的内存区域。 程序计数器&#xff1a; ​ 线程私有&#xff0c;程序控制流的指示器&#xff0c;分支、循环、跳转、异常处理、线程恢复等基础功能都依赖这个计数器完成。 ​ 每个线程都有一个程序计数…...

LangChain知识库管理后端接口:数据库操作详解—— 构建本地知识库系统的基础《二》

这段 Python 代码是一个完整的 知识库数据库操作模块&#xff0c;用于对本地知识库系统中的知识库进行增删改查&#xff08;CRUD&#xff09;操作。它基于 SQLAlchemy ORM 框架 和一个自定义的装饰器 with_session 实现数据库会话管理。 &#x1f4d8; 一、整体功能概述 该模块…...

LLMs 系列实操科普(1)

写在前面&#xff1a; 本期内容我们继续 Andrej Karpathy 的《How I use LLMs》讲座内容&#xff0c;原视频时长 ~130 分钟&#xff0c;以实操演示主流的一些 LLMs 的使用&#xff0c;由于涉及到实操&#xff0c;实际上并不适合以文字整理&#xff0c;但还是决定尽量整理一份笔…...