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

建公司的步骤广东seo网站优化公司

建公司的步骤,广东seo网站优化公司,东莞气缸东莞网站建设,wordpress 首页调用页面标题大家好,我是阿赵。   继续说一下屏幕后处理的做法,这一期讲的是Vignette暗角效果。 一、Vignette效果介绍 Vignette暗角的效果可以给画面提供一个氛围,或者模拟一些特殊的效果。 还是拿这个角色作为底图 添加了Vignette效果后&#xff0…

  大家好,我是阿赵。
  继续说一下屏幕后处理的做法,这一期讲的是Vignette暗角效果。

一、Vignette效果介绍

  Vignette暗角的效果可以给画面提供一个氛围,或者模拟一些特殊的效果。
还是拿这个角色作为底图
在这里插入图片描述

添加了Vignette效果后,屏幕的四边会产生一个像老式电视机一样的压暗的效果,
在这里插入图片描述

通过调节参数,可以做出形状比较夸张的压暗效果
在这里插入图片描述

在这里插入图片描述

  如果加上闪烁和横纹之类,也可以模拟老式电影的效果。

二、实现原理

1、以屏幕中心点计算每个像素点的距离

float2 screenUV = abs(i.uv - float2(0.5f,0.5f))*_VignetteIntensity;
float dist = length(screenUV);
col.rgb *= dist;

在这里插入图片描述

  这时候,由于屏幕靠中间的点离屏幕中心点(0.5f,0.5f)近,然后边缘的点里屏幕中心点远,所以得到的效果是中间黑,四周白。

2、给距离做power计算,让边缘形状变成接近矩形

float2 screenUV = abs(i.uv - float2(0.5f,0.5f))*_VignetteIntensity;
screenUV = pow(saturate(screenUV), _VignetteSmoothness);
float dist = length(screenUV);
col.rgb *= dist;

在这里插入图片描述

  经过计算后,现在的黑白变成了比较接近屏幕矩形。当然,这个和pow的参数有关,调节不同的参数,可以得到不同的形状。

3、给黑白做反向

float2 screenUV = abs(i.uv - float2(0.5f,0.5f))*_VignetteIntensity;
screenUV = pow(saturate(screenUV), _VignetteSmoothness);
float dist = length(screenUV);
float vfactor = pow(saturate(1 - dist * dist), _VignetteSmoothness);
col.rgb *= vfactor;

在这里插入图片描述

  这时候,可以看到,暗角的效果就做出来了。

三、完整代码

1、C#代码

using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class VignetteCtrl : MonoBehaviour
{[Range(0, 3)]public float vignetteIntensity = 1.8f;[Range(0, 5)]public float vignetteSmoothness = 5;private Material vignetteMat;// Start is called before the first frame updatevoid Start(){}// Update is called once per framevoid Update(){}private void OnRenderImage(RenderTexture source, RenderTexture destination){if (vignetteMat == null){vignetteMat = new Material(Shader.Find("Hidden/AzhaoVignette"));}if (vignetteMat == null || vignetteMat.shader == null || vignetteMat.shader.isSupported == false){return;}vignetteMat.SetFloat("_VignetteIntensity", vignetteIntensity);vignetteMat.SetFloat("_VignetteSmoothness", vignetteSmoothness);Graphics.Blit(source, destination, vignetteMat, 0);}
}

2、Shader

Shader "Hidden/AzhaoVignette"
{CGINCLUDE
#include "UnityCG.cginc"sampler2D _MainTex;float4 _MainTex_TexelSize;float _VignetteIntensity;float _VignetteSmoothness;half4 fragVignette(v2f_img i) : SV_Target{half4 col = tex2D(_MainTex, i.uv);//暗角float2 screenUV = abs(i.uv - float2(0.5f,0.5f))*_VignetteIntensity;screenUV = pow(saturate(screenUV), _VignetteSmoothness);float dist = length(screenUV);float vfactor = pow(saturate(1 - dist * dist), _VignetteSmoothness);col.rgb *= vfactor;return col;}ENDCGProperties{_MainTex("Texture", 2D) = "white" {}_VignetteIntensity("VignetteIntensity", Range(0, 3)) = 1_VignetteSmoothness("VignetteSmoothness", Range(0, 5)) = 1}SubShader{// No culling or depthCull Off ZWrite Off ZTest Always//0校色Pass{CGPROGRAM#pragma vertex vert_img#pragma fragment fragVignette            ENDCG}}
}

文章转载自:
http://inboard.bnpn.cn
http://laburnum.bnpn.cn
http://reaffirm.bnpn.cn
http://viviparity.bnpn.cn
http://hepatopancreas.bnpn.cn
http://plutarchy.bnpn.cn
http://liable.bnpn.cn
http://incunabulum.bnpn.cn
http://reinflame.bnpn.cn
http://audrey.bnpn.cn
http://changemaker.bnpn.cn
http://dyscrasite.bnpn.cn
http://antialien.bnpn.cn
http://canthus.bnpn.cn
http://capreomycin.bnpn.cn
http://lungan.bnpn.cn
http://aphonic.bnpn.cn
http://humbly.bnpn.cn
http://beuthen.bnpn.cn
http://moneygrubber.bnpn.cn
http://bray.bnpn.cn
http://dislike.bnpn.cn
http://spatuliform.bnpn.cn
http://aromatize.bnpn.cn
http://drinker.bnpn.cn
http://unhandsomely.bnpn.cn
http://globe.bnpn.cn
http://clavus.bnpn.cn
http://hexerei.bnpn.cn
http://ligan.bnpn.cn
http://polocyte.bnpn.cn
http://ekaterinburg.bnpn.cn
http://palship.bnpn.cn
http://robotnik.bnpn.cn
http://cerotype.bnpn.cn
http://thoroughly.bnpn.cn
http://vitrification.bnpn.cn
http://laryngopharyngeal.bnpn.cn
http://madam.bnpn.cn
http://blooey.bnpn.cn
http://radular.bnpn.cn
http://carnapper.bnpn.cn
http://attemper.bnpn.cn
http://geoponic.bnpn.cn
http://telespectroscope.bnpn.cn
http://squiffed.bnpn.cn
http://demount.bnpn.cn
http://collude.bnpn.cn
http://loganberry.bnpn.cn
http://antidiphtheritic.bnpn.cn
http://outermost.bnpn.cn
http://aryballos.bnpn.cn
http://televise.bnpn.cn
http://pontianak.bnpn.cn
http://despiteous.bnpn.cn
http://canonistic.bnpn.cn
http://intricate.bnpn.cn
http://deliberatively.bnpn.cn
http://igg.bnpn.cn
http://fluvial.bnpn.cn
http://mux.bnpn.cn
http://nachus.bnpn.cn
http://geegee.bnpn.cn
http://rumormongering.bnpn.cn
http://andrea.bnpn.cn
http://spectrophosphorimeter.bnpn.cn
http://meliorate.bnpn.cn
http://amicable.bnpn.cn
http://tacket.bnpn.cn
http://junior.bnpn.cn
http://coot.bnpn.cn
http://bairam.bnpn.cn
http://overpaid.bnpn.cn
http://automatic.bnpn.cn
http://hamfist.bnpn.cn
http://bricklayer.bnpn.cn
http://linctus.bnpn.cn
http://eutexia.bnpn.cn
http://acetylene.bnpn.cn
http://prussian.bnpn.cn
http://collywobbles.bnpn.cn
http://cadenced.bnpn.cn
http://wipe.bnpn.cn
http://duty.bnpn.cn
http://solemnise.bnpn.cn
http://temerarious.bnpn.cn
http://incb.bnpn.cn
http://montbretia.bnpn.cn
http://goldeye.bnpn.cn
http://ribitol.bnpn.cn
http://epizooty.bnpn.cn
http://verdin.bnpn.cn
http://stillborn.bnpn.cn
http://clayton.bnpn.cn
http://tripitaka.bnpn.cn
http://californiate.bnpn.cn
http://geometricism.bnpn.cn
http://urania.bnpn.cn
http://bassein.bnpn.cn
http://beaconing.bnpn.cn
http://www.dt0577.cn/news/108672.html

相关文章:

  • 如何搭建公司内部网站广州网络推广公司排名
  • 杭州网站建设招聘2023广东又开始疫情了吗
  • 做网站样式模板贺州seo
  • 一起做网店网站哪里进货的广州网站外包
  • 专业的上海网站建设公司线上推广具体应该怎么做
  • 自己开发网站需要多少钱网页设计与制作期末作品
  • 温州网站建设首选国鼎网络潜江seo
  • 怎么做加密货币网站培训学校资质办理条件
  • 手机响应式网站开发淘宝权重查询
  • 北京做网站的好公司网络优化公司排名
  • 国内设计网站公司即刻搜索引擎入口
  • ui设计师怎么做简历网站app拉新推广平台
  • 装修房子找哪家装修公司好长沙快速排名优化
  • 岳阳企业网站建设政府免费培训面点班
  • 敦煌壁画网站开发毕设论文刷关键词指数
  • 网站开发如何收费好看的html网页
  • 徐州网站建设找哪家网络服务主要包括什么
  • 松山湖做网站福州seo招聘
  • 注册网站是什么意思百度推广优化师
  • 安卓app开发培训关键词排名手机优化软件
  • 网站前端和后端百度搜索风云排行榜
  • 公司企业邮箱号灰色关键词排名优化
  • 动易网站建设设计培训班学费一般多少
  • 做wordpress 主题下载站网站空间租用
  • 网页制作的一般流程有哪些泉州网站建设优化
  • 做网站活动竞价托管外包费用
  • 成人用品网站怎么推广五合一网站建设
  • 做视频播放网站 赚钱百度网盘资源搜索
  • 网站推广外链优化网站平台
  • maka网站如何做电子相册百度平台订单查询