Unity自定義shader打包SpriteAtlas圖集問題

Unity打包圖集還是有一些坑的,至于圖集SpriteAtlas是什么請參考我之前寫的文章:【Sprite Atlas】Unity新圖集系統SpriteAtlas超詳細使用教程_spriteatlas 使用-CSDN博客

問題:

今天碰到的問題是,shader繪制的時候,因為打包圖集后,MainTexture是圖集的圖片,所以shader渲染就錯誤了。

非圖集是這樣顯示的,正常的一個地塊。

打包完圖集后,發現這個MainTexture是整個圖集的圖片

導致顯示就錯亂了,如下圖。

正常的顯示是這樣的。

問題所在:

原因就是打包圖集后傳入給shader的uv變了,本來只有圖片的時候,uv就是0-1的本地uv值,現在素材換成一張更大的圖了,導致uv采樣就出現了問題。

解決方法:

將圖片本身的uv信息傳給shader,做一個計算轉換即可。

using System;
using System.Collections.Generic;
using System.Linq;
using UnityEditor.Sprites;
using UnityEngine;public class StaticGroundObject : GroundObject
{public GameObject notCellObjectShow;private SpriteRenderer spriteRenderer;private const string _UVRangeName = "_UVRange";protected override void OnStart(){base.OnStart();SetSortingOrder();spriteRenderer = GetComponentInChildren<SpriteRenderer>();UpdateSpriteRenderer();}protected override void OnEnable(){base.OnEnable();}//修改也要void UpdateSpriteRenderer(){if (spriteRenderer != null){Sprite sprite = spriteRenderer.sprite;Vector2 texelSize = sprite.texture.texelSize;Rect rect = sprite.textureRect;Vector4 uvRemap = new(rect.x * texelSize.x,rect.y * texelSize.y,rect.width * texelSize.x,rect.height * texelSize.y);// 將UV值傳遞給材質Material material = spriteRenderer.material;if (material != null){// 確保shader中有對應的屬性if (material.HasProperty(_UVRangeName)){material.SetVector(_UVRangeName, uvRemap);Debug.Log("UV值已成功寫入shader");}else{Debug.LogError("shader缺少必要的屬性,請確保shader中定義了_UV1和_UV2屬性");}}else{Debug.LogError("renderer的材質為空");}}}public override void SetNotCellObjectShow(GameObject notCellObjectShow){base.SetNotCellObjectShow(notCellObjectShow);this.notCellObjectShow = notCellObjectShow;}protected override void CheckRandomPrefabs(bool isShow){if (notCellObjectShow != null){//上面沒有東西,而且沒有混合到其他格子上if (ParentGround == null && isShow){notCellObjectShow.SetActive(true);}else{notCellObjectShow.SetActive(false);}}}private void SetSortingOrder(){var ground = GetComponentsInChildren<SpriteRenderer>(true)[0];var groundName = ground.name;var lastIndex = groundName.LastIndexOf('_');var secondLastIndex = groundName.LastIndexOf('_', lastIndex - 1);int.TryParse(groundName.Substring(secondLastIndex + 1, lastIndex - secondLastIndex - 1), out int result);ground.sortingOrder -= result;}protected override void SetBlendMaskValue(Texture2D newBlendMask, int newRotateMaskValue, Texture2D mainBlendTex,Texture2D blendMaskChamfer, Dictionary<int, float> _offsetList){// base.SetBlendMaskValue(newBlendMask, newRotateMaskValue, mainBlendTex, blendMaskChamfer, offsetList);//獲得要渲染的對象if (mainBlends.Count == 0){mainBlends = GetComponentsInChildren<Renderer>().ToList();}if (mainBlends.Count == 0){Debug.LogError("mainBlends.Count==0");return;}//設置遮罩貼圖this.blendMask = newBlendMask;this.rotateMaskValue = newRotateMaskValue;this.mainBlendTex = mainBlendTex;this.blendMaskChamfer = blendMaskChamfer;//設置偏移值this.blendOffsetTargetList = _offsetList;UpdateMaterial();UpdateSpriteRenderer();}protected override void SetBlendOffsetList(Dictionary<int, float> _offsetList){// base.SetBlendOffsetList(_offsetList);blendOffsetTargetList = _offsetList;UpdateMaterial();UpdateSpriteRenderer();}
}public class MaterialCacheTool
{public static Dictionary<string, Material> materialCache = new Dictionary<string, Material>();public static Material CheckMaterial(string materialKey, Renderer defaultRenderer, Action<Material> onInit){Material checkMaterial = null;if (materialCache.ContainsKey(materialKey)){checkMaterial = materialCache[materialKey];}else{var material = new Material(defaultRenderer.sharedMaterial);material.name = materialKey;onInit?.Invoke(material);materialCache.Add(materialKey, material);checkMaterial = material;}return checkMaterial;}
}
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'Shader "Shader/GroundObjectV3_Code"
{Properties{[NoScaleOffset]_MaskMap("MaskMap", 2D) = "white" {}[NoScaleOffset]_MainTex("MainTex", 2D) = "white" {}[NoScaleOffset]_Chamfer("Chamfer", 2D) = "black" {}_RotateMask("RotateMask",Range(0, 360)) = 0_OffsetUp("OffsetUp", Range(0, 1)) = 0_OffsetDown("OffsetDown", Range(0, 1)) = 0_OffsetLeft("OffsetLeft", Range(0, 1)) = 0_OffsetRight("OffsetRight", Range(0, 1)) = 0_OffsetUpLeft("OffsetUpLeft", Range(0, 1)) = 0_OffsetUpRight("OffsetUpRight", Range(0, 1)) = 0_OffsetDownLeft("OffsetDownLeft", Range(0, 1)) = 0_OffsetDownRight("OffsetDownRight", Range(0, 1)) = 0//相反_IsInversion("IsInversion", Float) = 0[NoScaleOffset]_BlendMaskMap("BlendMaskMap", 2D) = "black" {}[NoScaleOffset]_BlendMainTex("BlendMainTex", 2D) = "white" {}[NoScaleOffset]_BlendChamfer("_BlendChamfer", 2D) = "black" {}_BlendOffsetUp("BlendOffsetUp", Range(0, 1)) = 0_BlendOffsetDown("BlendOffsetDown", Range(0, 1)) = 0_BlendOffsetLeft("BlendOffsetLeft", Range(0, 1)) = 0_BlendOffsetRight("BlendOffsetRight", Range(0, 1)) = 0_BlendOffsetUpLeft("BlendOffsetUpLeft", Range(0, 1)) = 0_BlendOffsetUpRight("BlendOffsetUpRight", Range(0, 1)) = 0_BlendOffsetDownLeft("BlendOffsetDownLeft", Range(0, 1)) = 0_BlendOffsetDownRight("BlendOffsetDownRight", Range(0, 1)) = 0[HideInInspector]_QueueOffset("_QueueOffset", Float) = 0[HideInInspector]_QueueControl("_QueueControl", Float) = -1[HideInInspector][NoScaleOffset]unity_Lightmaps("unity_Lightmaps", 2DArray) = "" {}[HideInInspector][NoScaleOffset]unity_LightmapsInd("unity_LightmapsInd", 2DArray) = "" {}[HideInInspector][NoScaleOffset]unity_ShadowMasks("unity_ShadowMasks", 2DArray) = "" {}_OffsetFactor("OffsetFactor", Float) = 0_OffsetUnits("OffsetUnits", Float) = 0[ToggleUI] _ReceiveShadows("Receive Shadows", Float) = 1.0[ToggleUI] _CastShadows("Cast Shadows", Float) = 1.0//陰影模糊_ShadowBlur("ShadowBlur", Float) = 0.0_Cull("__cull", Float) = 2.0// 新增距離縮放因子屬性_DistanceScaleFactor("Distance Scale Factor", Range(0.1, 100.0)) = 60.0//補充UV_UVRange("UV Range", Vector) = (0, 0, 1, 1)}SubShader{Tags{"RenderPipeline"="UniversalPipeline""RenderType"="Opaque""UniversalMaterialType" = "Lit""Queue"="AlphaTest""DisableBatching"="LODFading""ShaderGraphShader"="true""ShaderGraphTargetId"="UniversalLitSubTarget""EnableGPUInstancing" = "true"}LOD 100Pass{// Render StateCull BackZTest LEqualZWrite OnBlend One ZeroAlphaToMask Onoffset [_OffsetFactor] , [_OffsetUnits]HLSLPROGRAM#pragma vertex vert#pragma fragment frag#pragma multi_compile_fog// #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"            // #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"#include "EgoLight.hlsl"#pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREENstruct appdata{float4 vertex : POSITION;float2 uv : TEXCOORD0;//光照計算float4 positionOS : POSITION;float4 normalOS : NORMAL;};struct v2f{float2 uv : TEXCOORD0;// UNITY_FOG_COORDS(1)float4 vertex : SV_POSITION;float3 worldPos : TEXCOORD1;//光照計算float3 viewDirWS : TEXCOORD2;float3 normalWS : TEXCOORD3;// 新增距離變量float distanceToCamera : TEXCOORD4;float prevLod : TEXCOORD5; // 新增變量存儲上一次的LODfloat2 uv2:TEXCOORD6;};sampler2D _MaskMap;float4 _MaskMap_ST;sampler2D _MainTex;float4 _MainTex_ST;sampler2D _Chamfer;float4 _Chamfer_ST;float _RotateMask;float _OffsetUp;float _OffsetDown;float _OffsetLeft;float _OffsetRight;float _OffsetUpLeft;float _OffsetUpRight;float _OffsetDownLeft;float _OffsetDownRight;float _IsInversion;//混合剔除的參數sampler2D _BlendMaskMap;float4  _BlendMaskMap_ST;sampler2D _BlendMainTex;float4 _BlendMainTex_ST;sampler2D _BlendChamfer;float4 _BlendChamfer_ST;float _BlendOffsetUp;float _BlendOffsetDown;float _BlendOffsetLeft;float _BlendOffsetRight;float _BlendOffsetUpLeft;float _BlendOffsetUpRight;float _BlendOffsetDownLeft;float _BlendOffsetDownRight;float4 _GlobalShadowColor;// 新增距離縮放因子屬性變量,放在HLSL代碼的合適位置,這里在函數外部聲明float _DistanceScaleFactor;float4 _UVRange;v2f vert (appdata v){v2f o;o.uv = TRANSFORM_TEX(v.uv, _MaskMap);float2 spriteRectPos = _UVRange.xy;float2 spriteRectSize = _UVRange.zw;float2 localUV = (v.uv - spriteRectPos) / spriteRectSize;o.uv2 = localUV;o.vertex = TransformObjectToHClip(v.vertex);//UnityObjectToClipPos   //o.vertex = mul(UNITY_MATRIX_MVP,v.vertex);                        o.worldPos = mul(unity_ObjectToWorld, v.vertex).xyz;// 計算物體到攝像機的距離o.distanceToCamera = distance(mul(unity_ObjectToWorld, v.vertex).xyz, _WorldSpaceCameraPos.xyz);o.prevLod = 0; // 初始化//光照計算VertexPositionInputs positionInputs = GetVertexPositionInputs(v.positionOS.xyz);VertexNormalInputs normalInputs = GetVertexNormalInputs(v.normalOS.xyz);o.viewDirWS = GetCameraPositionWS() - positionInputs.positionWS;o.normalWS = normalInputs.normalWS;return o;}float2 GetMaskUV(float2 uv){float2 maskUV=uv;maskUV -= 0.5;// 旋轉 45 度(π/4 弧度)float angle = radians(_RotateMask);float cosAngle = cos(angle);float sinAngle = sin(angle);float2x2 rotationMatrix = float2x2(cosAngle, -sinAngle, sinAngle, cosAngle);maskUV = mul(rotationMatrix, maskUV);// 平移回原來的坐標maskUV += 0.5;return maskUV;}//全部的Offsetfloat GetColorMask(sampler2D colorMask, sampler2D colorChamfer,float2 uv, float _OffsetUp,  float _OffsetDown,  float _OffsetLeft,  float _OffsetRight,  float _OffsetUpLeft,  float _OffsetUpRight,  float _OffsetDownLeft,  float _OffsetDownRight,float _lod){float offsetMax = 0.5;float2 offsets[8] = {float2(0, -_OffsetUp * offsetMax),float2(0, _OffsetDown * offsetMax),float2(_OffsetLeft * offsetMax, 0),float2(-_OffsetRight * offsetMax, 0),float2(_OffsetUpLeft * offsetMax, -_OffsetUpLeft * offsetMax),float2(-_OffsetUpRight * offsetMax, -_OffsetUpRight * offsetMax),float2(_OffsetDownLeft * offsetMax, _OffsetDownLeft * offsetMax),float2(-_OffsetDownRight * offsetMax, _OffsetDownRight * offsetMax)};float alpha = 0;alpha += tex2Dlod(colorMask, float4(GetMaskUV(uv),0,_lod)).r;// 循環采樣偏移紋理//for (int i = 0; i < 8; i++) {//    alpha += tex2Dlod(colorMask, float4(GetMaskUV(uv + offsets[i]),0,_lod)).r;//}alpha += tex2Dlod(colorMask, float4(GetMaskUV(uv + offsets[0]),0,_lod)).r;alpha += tex2Dlod(colorMask, float4(GetMaskUV(uv + offsets[1]),0,_lod)).r;alpha += tex2Dlod(colorMask, float4(GetMaskUV(uv + offsets[2]),0,_lod)).r;alpha += tex2Dlod(colorMask, float4(GetMaskUV(uv + offsets[3]),0,_lod)).r;alpha += tex2Dlod(colorMask, float4(GetMaskUV(uv + offsets[4]),0,_lod)).r;alpha += tex2Dlod(colorMask, float4(GetMaskUV(uv + offsets[5]),0,_lod)).r;alpha += tex2Dlod(colorMask, float4(GetMaskUV(uv + offsets[6]),0,_lod)).r;alpha += tex2Dlod(colorMask, float4(GetMaskUV(uv + offsets[7]),0,_lod)).r;// 采樣倒角紋理alpha += tex2Dlod(colorChamfer, float4(uv + float2( _OffsetLeft * offsetMax, -_OffsetUp * offsetMax),0,_lod)).r;alpha += tex2Dlod(colorChamfer, float4(uv + float2(-_OffsetRight * offsetMax, -_OffsetUp * offsetMax),0,_lod)).r;alpha += tex2Dlod(colorChamfer, float4(uv + float2( _OffsetLeft * offsetMax,  _OffsetDown * offsetMax),0,_lod)).r;alpha += tex2Dlod(colorChamfer, float4(uv + float2(-_OffsetRight * offsetMax, _OffsetDown * offsetMax),0,_lod)).r;// 透明度限制在0-1之間alpha = clamp(alpha, 0, 1);                         return alpha;}float4 frag (v2f i) : SV_Target{float2 maskUV = i.uv2;    float lod = i.distanceToCamera / _DistanceScaleFactor;lod = clamp(lod, 0, 5); float mainAlpha = GetColorMask( _MaskMap, _Chamfer, maskUV, _OffsetUp,  _OffsetDown,  _OffsetLeft,  _OffsetRight,  _OffsetUpLeft,  _OffsetUpRight,  _OffsetDownLeft,  _OffsetDownRight,lod);// 計算主紋理的UV偏移float2 mainTexUV = TRANSFORM_TEX(i.uv, _MainTex).xy;float4 mainColor = tex2Dlod(_MainTex, float4(mainTexUV, 0, lod));//tex2D(_MainTex, TRANSFORM_TEX(i.uv, _MainTex));mainAlpha *= mainColor.a;float f = lerp(1.01,0.99,_IsInversion);//1.01;//maskUV縮放變大一點點maskUV -= 0.5;maskUV *=lerp(1.01,0.99,_IsInversion);         // 1.005;maskUV += 0.5;//各個邊移動多一丟丟// _BlendOffsetUp += float2(0,f);// _BlendOffsetDown  += float2(0,-f);// _BlendOffsetLeft  +=  float2(-f,0);// _BlendOffsetRight  += float2(f,0);// _BlendOffsetUpLeft  += float2(-f,f);// _BlendOffsetUpRight += float2(f,f);// _BlendOffsetDownLeft += float2(-f,-f);// _BlendOffsetDownRight  += float2(f,-f);float blendAlpha = GetColorMask( _BlendMaskMap, _BlendChamfer, maskUV, _BlendOffsetUp,  _BlendOffsetDown,  _BlendOffsetLeft,  _BlendOffsetRight,  _BlendOffsetUpLeft,  _BlendOffsetUpRight,  _BlendOffsetDownLeft,  _BlendOffsetDownRight,lod);float4 blendColor = tex2Dlod(_BlendMainTex, float4(TRANSFORM_TEX(i.uv, _BlendMainTex),0,lod));blendAlpha*=blendColor.a;float alpha = mainAlpha - blendAlpha;alpha = lerp(alpha,1-alpha,_IsInversion);          // 根據距離調整紋理采樣的LOD// mainColor = tex2Dlod(_MainTex, float4(TRANSFORM_TEX(i.uv, _MainTex).xy, 0, lod));// blendColor = tex2Dlod(_BlendMainTex, float4(TRANSFORM_TEX(i.uv, _BlendMainTex).xy, 0, lod));float _Cutoff = 0.8;float3 color = CheckColor(i.worldPos,i.normalWS,_GlobalShadowColor,mainColor.rgb);clip(alpha - _Cutoff);return float4(color.rgb, alpha);}ENDHLSL}}
}

參考這個鏈接會解釋的更加詳細點:

Local UVs for Sprites in Sprite Sheet/Atlas | Cyanilux

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/pingmian/81708.shtml
繁體地址,請注明出處:http://hk.pswp.cn/pingmian/81708.shtml
英文地址,請注明出處:http://en.pswp.cn/pingmian/81708.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

如何用 OceanBase 的 LOAD DATA 旁路導入進行大表遷移

前言 在日常工作中&#xff0c;我們時常會遇到需要將某個大數據量的單表進行遷移的情況。在MySQL中&#xff0c;針對這樣的大表&#xff0c;我們通常會選擇先將原表導出為csv格式&#xff0c;然后利用LOAD DATA語法來導入csv文件&#xff0c;這種方法相較于mysqldump在效率上有…

VR 互動實訓的顯著優勢?

&#xff08;一&#xff09;沉浸式學習&#xff0c;提升培訓效果? 在 VR 互動實訓中&#xff0c;員工不再是被動的知識接受者&#xff0c;而是主動的參與者。以銷售培訓為例&#xff0c;員工戴上 VR 設備&#xff0c;就能置身于逼真的銷售場景中&#xff0c;與虛擬客戶進行面對…

OpenCV 第6課 圖像處理之幾何變換(重映射)

1. 概述 簡單來說,重映射就是把一副圖像內的像素點按照規則映射到到另外一幅圖像內的對應位置上去,形成一張新的圖像。 因為原圖像與目標圖像的像素坐標不是一一對應的。一般情況下,我們通過重映射來表達每個像素的位置(x,y),像這樣: g(x,y)=f(h(x,y)) 在這里g()是目標圖…

Java虛擬機 - 程序計數器和虛擬機棧

運行時數據結構 Java運行時數據區程序計數器為什么需要程序計數器執行流程虛擬機棧虛擬機棧作用虛擬機棧核心結構運行機制 Java運行時數據區 首先介紹Java運行時數據之前&#xff0c;我們要了解&#xff0c;對于計算機來說&#xff0c;內存是非常重要的資源&#xff0c;因為內…

MySQL數據庫——支持遠程IP訪問的設置方法總結

【系列專欄】&#xff1a;博主結合工作實踐輸出的&#xff0c;解決實際問題的專欄&#xff0c;朋友們看過來&#xff01; 《項目案例分享》 《極客DIY開源分享》 《嵌入式通用開發實戰》 《C語言開發基礎總結》 《從0到1學習嵌入式Linux開發》 《QT開發實戰》 《Android開發實…

CSS- 4.6 radiu、shadow、animation動畫

本系列可作為前端學習系列的筆記&#xff0c;代碼的運行環境是在HBuilder中&#xff0c;小編會將代碼復制下來&#xff0c;大家復制下來就可以練習了&#xff0c;方便大家學習。 HTML系列文章 已經收錄在前端專欄&#xff0c;有需要的寶寶們可以點擊前端專欄查看&#xff01; 點…

排序算法之基礎排序:冒泡,選擇,插入排序詳解

排序算法之基礎排序&#xff1a;冒泡、選擇、插入排序詳解 前言一、冒泡排序&#xff08;Bubble Sort&#xff09;1.1 算法原理1.2 代碼實現&#xff08;Python&#xff09;1.3 性能分析 二、選擇排序&#xff08;Selection Sort&#xff09;2.1 算法原理2.2 代碼實現&#xff…

第十節第一部分:常見的API:Math、System、Runtime

Math類介紹及常用方法&#xff08;了解知道即可&#xff09; System類介紹及常用方法&#xff08;了解知道即可&#xff09; Runtime類介紹及常用方法&#xff08;了解知道即可&#xff09; 代碼&#xff1a; 代碼一&#xff1a;Math類 package com.itheima.d14_math;public …

智能體間協作的“巴別塔困境“如何破解?解讀Agent通信4大協議:MCP/ACP/A2A/ANP

AI 智能體的興起觸發了AI應用協作的新領域。這些智能體不再局限于被動的聊天機器人或獨立的系統&#xff0c;它們現在被設計用于推理、計劃和協作ーー跨任務、跨域甚至跨組織。但隨著這一愿景成為現實&#xff0c;一個挑戰很快浮出水面&#xff1a; 智能體如何以一種安全、可伸…

項目進度延誤,如何按時交付?

項目進度延誤可以通過加強計劃管理、優化資源分配、強化團隊溝通、設置關鍵里程碑和風險管理機制等方式來實現按時交付。加強計劃管理、優化資源分配、強化團隊溝通、設置關鍵里程碑、風險管理機制。其中&#xff0c;加強計劃管理尤為關鍵&#xff0c;因為明確而詳細的計劃能提…

詳解ip地址、子網掩碼、網關、廣播地址

1. IP 地址 定義&#xff1a;IP 地址是網絡設備在網絡中的唯一標識&#xff0c;用于標識設備的網絡位置&#xff0c;類似于現實中的門牌號。它分為 IPv4&#xff08;如 192.168.1.5&#xff09;和 IPv6&#xff08;如 240e:305:3685:8100:a00:27ff:fefb:56b8&#xff09;。 示…

為 Windows 和 Ubuntu 中設定代理服務器的詳細方法

有時下載大模型總是下載不出來&#xff0c;要配置代理才行 一、Windows代理設置 ① 系統全局代理設置 打開【設置】→【網絡和Internet】→【代理】。 在【手動設置代理】下&#xff0c;打開開關&#xff0c;輸入&#xff1a; 地址&#xff1a;10.10.10.215 端口&#xff1a;…

鴻蒙OSUniApp 實現的表單驗證與提交功能#三方框架 #Uniapp

UniApp 實現的表單驗證與提交功能 前言 在移動端應用開發中&#xff0c;表單是用戶與應用交互的重要媒介。一個好的表單不僅布局合理、使用方便&#xff0c;還應該具備完善的驗證與提交功能&#xff0c;以確保用戶輸入的數據準確無誤。本文將分享如何在 UniApp 中實現表單驗證…

前端的面試筆記——HTMLJavaScript篇(二)前端頁面性能檢測

前端頁面性能檢測和判定是優化用戶體驗的核心環節&#xff0c;需要結合實驗室數據&#xff08;Lab Data&#xff09;、現場數據&#xff08;Field Data&#xff09;和行業標準綜合評估。以下是主流方法、工具及判定標準的詳細解析&#xff1a; 一、性能檢測的核心維度與指標 …

再來1章linux系列-19 防火墻 iptables 雙網卡主機的內核 firewall-cmd firewalld的高級規則

學習目標&#xff1a; 實驗實驗需求實驗配置內容和分析 &#xff08;每一個設備的每一步操作&#xff09;實驗結果驗證其他 學習內容&#xff1a; 實驗實驗需求實驗配置內容和分析 &#xff08;每一個設備的每一步操作&#xff09;實驗結果驗證其他 1.實驗 2.實驗需求 圖…

LLM-Based Agent綜述及其框架學習(五)

文章目錄 摘要Abstract1. 引言2. 文本輸出3. 工具的使用3.1 理解工具3.2 學會使用工具3.3 制作自給自足的工具3.4 工具可以擴展LLM-Based Agent的行動空間3.5 總結 4. 具身動作5. 學習智能體框架5.1 CrewAI學習進度5.2 LangGraph學習進度5.3 MCP學習進度 參考總結 摘要 本文圍繞…

游戲引擎學習第298天:改進排序鍵 - 第1部分

關于向玩家展示多個房間層所需的兩種 Z 值 我們在前一天基本完成了為渲染系統引入分層 Z 值的工作&#xff0c;但還沒有完全完成所有細節。我們開始引入圖形渲染中的分層概念&#xff0c;即在 Z 軸方向上擁有多個獨立圖層&#xff0c;每個圖層內部再使用一個單獨的 Z 值來實現…

一些C++入門基礎

關鍵字 圖引自 C 關鍵詞 - cppreference.com 命名空間 命名空間解決了C沒辦法解決的各類命名沖突問題 C的標準命名空間&#xff1a;std 命名空間中可以定義變量、函數、類型&#xff1a; namespace CS {//變量char cs408[] "DS,OS,JW,JZ";int cs 408;//函數vo…

學習筆記:黑馬程序員JavaWeb開發教程(2025.4.6)

12.4 登錄校驗-JWT令牌-介紹 JWT&#xff08;JSON Web Token&#xff09; 簡潔是指JWT是一個簡單字符串&#xff0c;自包含指的是JWT令牌&#xff0c;看似是一個隨機字符串&#xff0c;但是可以根據需要&#xff0c;自定義存儲內容 Header是JSON數據格式&#xff0c;原始JSO…

香港科技大學物理學理學(科學計算與先進材料物理與技術)碩士招生宣講會——深圳大學

香港科技大學物理學理學&#xff08;科學計算與先進材料物理與技術&#xff09;碩士招生宣講會——深圳大學專場 &#x1f559;時間&#xff1a;2025年5月23日&#xff08;星期五&#xff09;14:30 &#x1f3eb;地點&#xff1a;深圳大學滄海校區致原樓1101 &#x1f9d1…