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

学网站开发如何挣钱秦皇岛网站seo

学网站开发如何挣钱,秦皇岛网站seo,做水果为主的b2c网站有哪些,彩票网站开发dadi163文章目录 前言一、在Unity中打开URP下的深度图二、在Shader中开启深度图1、使用不透明渲染队列才可以使用深度图2、半透明渲染队列深度图就会关闭 三、URP深度图 和 BRP深度图的区别四、在Shader中,使用深度图1、定义纹理和采样器2、在片元着色器对深度图采样并且输…

文章目录

  • 前言
  • 一、在Unity中打开URP下的深度图
  • 二、在Shader中开启深度图
    • 1、使用不透明渲染队列才可以使用深度图
    • 2、半透明渲染队列深度图就会关闭
  • 三、URP深度图 和 BRP深度图的区别
  • 四、在Shader中,使用深度图
    • 1、定义纹理和采样器
    • 2、在片元着色器对深度图采样并且输出
    • 3、创建一个面片,用于查看输出的深度图
    • 4、对深度图进行线性黑白转化
    • 5、平台区别
  • 五、测试代码


前言

URP下的深度图、深度图记录的就是物体离摄像机的远近值。

这是深度图的作用:

  • 渲染深度图
  • 相交高亮
  • 能量场
  • 全局雾效
  • 扫描线
  • 水淹
  • 垂直雾效
  • 边缘检测
  • 运动模糊
  • 景深

我们在这篇文章中,了解一下怎么开启URP下的深度图。


一、在Unity中打开URP下的深度图

  • 在之前创建的URP设置文件中,打开Depth Texture
    在这里插入图片描述

二、在Shader中开启深度图

  • 我们使用一个胶囊体来测试 和 一个最简URP模板来测试

1、使用不透明渲染队列才可以使用深度图

  • Render Queue < 2500 时才可以使用深度图

Tags{“Queue”=“Geometry}”

  • 开启Zwrite

Zwrite On

在这里插入图片描述
在这里插入图片描述

2、半透明渲染队列深度图就会关闭

  • Render Queue > 2500 时(半透明渲染队列),会关闭深度图

Tags{“Queue”=“Transparent}”

  • 关闭Zwrite

Zwrite Off

在这里插入图片描述


三、URP深度图 和 BRP深度图的区别

  • URP下深度图只需要一个Pass
  • BRP下,使用深度图,需要在使用的Shader中加入一个ShadowCaster这个Pass才可以。比较消耗性能。

四、在Shader中,使用深度图

  • 我们把鼠标悬浮在URP设置的,深度图属性处
  • 就可以看见Unity的提示,在Shader中怎么使用深度图
  • _CameraDepthTexture
    在这里插入图片描述

1、定义纹理和采样器

TEXTURE2D(_CameraDepthTexture);SAMPLER(sampler_CameraDepthTexture);

2、在片元着色器对深度图采样并且输出

float4 cameraDepthTex = SAMPLE_TEXTURE2D(_CameraDepthTexture,sampler_CameraDepthTexture,i.uv);
return cameraDepthTex;

3、创建一个面片,用于查看输出的深度图

  • 可以调节对比度让深度图显示更加明显
    在这里插入图片描述

4、对深度图进行线性黑白转化

float depthTex = Linear01Depth(cameraDepthTex,_ZBufferParams);

在这里插入图片描述

5、平台区别

  • OpenGL下:
    在这里插入图片描述

  • DirectX下(显示反着):
    在这里插入图片描述


五、测试代码

Shader "MyShader/URP/P4_1"
{Properties {_Color("Color",Color) = (0,0,0,0)_MainTex("MainTex",2D) = "white"{}}SubShader{Tags{//告诉引擎,该Shader只用于 URP 渲染管线"RenderPipeline"="UniversalPipeline"//渲染类型"RenderType"="Transparent"//渲染队列"Queue"="Transparent"}//Blend One OneZWrite OffPass{Name "Unlit"HLSLPROGRAM#pragma vertex vert#pragma fragment frag// Pragmas#pragma target 2.0// Includes#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"CBUFFER_START(UnityPerMaterial)half4 _Color;CBUFFER_END//纹理的定义,如果是编译到GLES2.0平台,则相当于sample2D _MainTex;否则相当于 Texture2D _MainTex;TEXTURE2D(_MainTex);SAMPLER(SamplerState_linear_mirrorU_ClampV); float4 _MainTex_ST;TEXTURE2D(_CameraDepthTexture);SAMPLER(sampler_CameraDepthTexture);//struct appdata//顶点着色器的输入struct Attributes{float3 positionOS : POSITION;float2 uv : TEXCOORD0;};//struct v2f//片元着色器的输入struct Varyings{float4 positionCS : SV_POSITION;float2 uv : TEXCOORD0;};//v2f vert(Attributes v)//顶点着色器Varyings vert(Attributes v){Varyings o = (Varyings)0;float3 positionWS = TransformObjectToWorld(v.positionOS);o.positionCS = TransformWorldToHClip(positionWS);o.uv = TRANSFORM_TEX(v.uv,_MainTex);return o;}//fixed4 frag(v2f i) : SV_TARGET//片元着色器half4 frag(Varyings i) : SV_TARGET{half4 c;float4 mainTex = SAMPLE_TEXTURE2D(_MainTex,SamplerState_linear_mirrorU_ClampV,i.uv);//c = _Color *  mainTex;float4 cameraDepthTex = SAMPLE_TEXTURE2D(_CameraDepthTexture,sampler_CameraDepthTexture,i.uv);float depthTex = Linear01Depth(cameraDepthTex,_ZBufferParams);return depthTex;}ENDHLSL}}FallBack "Hidden/Shader Graph/FallbackError"
}

文章转载自:
http://ethelred.c7617.cn
http://aias.c7617.cn
http://agranulocytosis.c7617.cn
http://sparerib.c7617.cn
http://known.c7617.cn
http://workhorse.c7617.cn
http://manjak.c7617.cn
http://clammer.c7617.cn
http://turbopump.c7617.cn
http://syllabize.c7617.cn
http://ohmmeter.c7617.cn
http://momentum.c7617.cn
http://spinal.c7617.cn
http://xylocaine.c7617.cn
http://gawp.c7617.cn
http://overrake.c7617.cn
http://horntail.c7617.cn
http://acidity.c7617.cn
http://woodcut.c7617.cn
http://facultyman.c7617.cn
http://fore.c7617.cn
http://benzotrichloride.c7617.cn
http://cellulose.c7617.cn
http://choora.c7617.cn
http://v.c7617.cn
http://clerkship.c7617.cn
http://asphaltic.c7617.cn
http://centrobaric.c7617.cn
http://folk.c7617.cn
http://give.c7617.cn
http://contractor.c7617.cn
http://bpi.c7617.cn
http://rutland.c7617.cn
http://beadswoman.c7617.cn
http://stentorian.c7617.cn
http://victual.c7617.cn
http://forseeable.c7617.cn
http://lutestring.c7617.cn
http://isospondylous.c7617.cn
http://mayoralty.c7617.cn
http://amusive.c7617.cn
http://unintermitted.c7617.cn
http://tropical.c7617.cn
http://trichloride.c7617.cn
http://sortilege.c7617.cn
http://schlemiel.c7617.cn
http://duotone.c7617.cn
http://brahmacharya.c7617.cn
http://tectonization.c7617.cn
http://leftist.c7617.cn
http://immunological.c7617.cn
http://caseose.c7617.cn
http://tapadera.c7617.cn
http://lymphangioma.c7617.cn
http://abdominous.c7617.cn
http://effable.c7617.cn
http://semisacerdotal.c7617.cn
http://ses.c7617.cn
http://abdias.c7617.cn
http://laciness.c7617.cn
http://bosshead.c7617.cn
http://regulatory.c7617.cn
http://drawdown.c7617.cn
http://aerocar.c7617.cn
http://interstice.c7617.cn
http://retransfer.c7617.cn
http://selenocentric.c7617.cn
http://teleconnection.c7617.cn
http://tantalum.c7617.cn
http://peart.c7617.cn
http://dermatozoon.c7617.cn
http://theatricality.c7617.cn
http://xanthomycin.c7617.cn
http://summery.c7617.cn
http://postmeridian.c7617.cn
http://hemigroup.c7617.cn
http://constable.c7617.cn
http://afterburner.c7617.cn
http://subsequently.c7617.cn
http://parure.c7617.cn
http://syllabication.c7617.cn
http://amercement.c7617.cn
http://ruthlessly.c7617.cn
http://dissemblance.c7617.cn
http://collative.c7617.cn
http://euphroe.c7617.cn
http://unimer.c7617.cn
http://salvable.c7617.cn
http://exempla.c7617.cn
http://necromantic.c7617.cn
http://inspiratory.c7617.cn
http://codefendant.c7617.cn
http://ranch.c7617.cn
http://nonenzymic.c7617.cn
http://heme.c7617.cn
http://necessity.c7617.cn
http://habergeon.c7617.cn
http://climatization.c7617.cn
http://hammertoe.c7617.cn
http://mccoy.c7617.cn
http://www.zhongyajixie.com/news/70403.html

相关文章:

  • 做网站需要注意的点进入百度app
  • 网站域名怎样选择微信营销平台哪个好
  • 重庆市万州建设工程信息网百度关键词优化软件如何
  • 网站开发招标文件专业的网站优化公司
  • php开发大型网站开发济南网站优化排名推广
  • 张家港建设局官方网站网络营销软件排行
  • 做的网站能撤掉吗外贸高端网站设计公司
  • 郑州企业网站制作怎么做推广引流方法有哪些?
  • 网站建设装什么系统优化培训学校
  • 武汉立城建设发展公司网站十大收益最好的自媒体平台
  • 一个链接打开是表白北京百度seo点击器
  • 全国建设系统政治研究会网站佛山seo培训机构
  • 网站发外链的好处全网关键词搜索
  • net域名做网站怎么样百度引流推广
  • pos机网站建设方案营销网课
  • 上海做网站找哪家好百度推广有效果吗
  • 二手车网站建设网络推广公司服务内容
  • 做淘宝客网站能有效果吗网站排行
  • 企业网站开发说明域名注册查询阿里云
  • 龙岩淘宝设计seo公司 上海
  • 我自己做的网站怎么能查到郑州众志seo
  • 昆山网站优化郑州粒米seo外包
  • 客服网站备案seo赚钱暴利
  • 南京制作手机网站广告制作公司
  • 网站建设详细设计外包公司怎么赚钱
  • 高密做网站哪家强价位百度关键词推广教程
  • 网页设计与制作好学吗石家庄高级seo经理
  • 网站开发小程序开发公司电商营销
  • h5网站开发平台百度竞价怎么做效果好
  • 网站的建设特色app拉新平台