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

做网站江西大连企业做网站公司排名

做网站江西,大连企业做网站公司排名,小程序开发和app开发差别,跨境电商全托管有哪些平台这节课是利用材质做雨滴i效果 首先是创建一个圆环,实际上他就是为了创建一个圆,但是是空心的,可以看之前我的做法,这里以他的为准 创建圆环 就是当uv的点在max_radius和min_radius之间的时候绘制。 他这里写了ringThickness&a…

这节课是利用材质做雨滴i效果

首先是创建一个圆环,实际上他就是为了创建一个圆,但是是空心的,可以看之前我的做法,这里以他的为准

创建圆环

就是当uv的点在max_radius和min_radius之间的时候绘制。

他这里写了ringThickness,实际可以看作边的粗

float4 result = float4(0, 0, 0, 0);float2 pointCtr = float2(0.5, 0.5);float2 uvOffset = uv - pointCtr;float radiusMin = 0.05;
float radiusMax = 0.1;
float ringThickness = 0.005;float pointDist = length(uvOffset);if(pointDist >= radiusMin - ringThickness && pointDist <= radiusMax + ringThickness)
{result = float4(1, 1, 1, 1);
}
return result;

实现一个渐变的效果

使用新的函数,当你不知道使用什么函数的时候,可以在蓝图中找到答案,实际上就是全部小写

smoothstep就是在min max之间平滑的插值

float alpha = smoothstep(radiusMin - ringThickness, radiusMin + ringThickness, pointDist);

clamp的valuebetween 0~1

float2 pointCtr = float2(0.5, 0.5);float2 uvOffset = uv - pointCtr;float radiusMin = 0.05;
float radiusMax = 0.1;
float ringThickness = 0.005;float pointDist = length(uvOffset);
float alpha = saturate(smoothstep(radiusMin - ringThickness, radiusMin + ringThickness, pointDist));
if(pointDist >= radiusMin - ringThickness && pointDist <= radiusMax + ringThickness)
{result = float4(1, 1, 1, 1) * alpha;
}
return result;

绘制多个空心圆

首先我们可以只定义一个半径长度,然后定义一个ringThickness去得到这个圆

float4 result = float4(0, 0, 0, 0);float2 pointCtr = float2(0.5, 0.5);float2 uvOffset = uv - pointCtr;float radius = 0.05;
float ringThickness = 0.005;
float pointDist = length(uvOffset);
if (pointDist >= radius - ringThickness && pointDist <= radius + ringThickness)
{return float4(1, 1, 1, 1);
}
return result;

然后就可以去做一些uv的偏移,这里使用作者的方法

float4 result = float4(0, 0, 0, 0);float ringThickness = 0.005;
float fadeInner = 0.005;
float2 seed = float2(123.456, 789.012);float2 offsetRange = float2(-1, 1);float drops = 100;for (int i = 0; i < drops; i++)
{seed = frac(seed * 123.456);float2 randOffset = lerp(offsetRange.x, offsetRange.y, seed);float radius = 0.05;float2 offset = (uv - 0.5) - randOffset;float pointDist = length(offset);float alpha = saturate(smoothstep(radius - fadeInner, fadius + radeInner, pointDist));if (pointDist >= radius - ringThickness && pointDist <= radius + ringThickness){result += alpha;} 
}return result;

这里为什么需要加呢?因为可能会有叠加到一起的圆环,此时就需要这个叠加的过程

time这个节点当引擎打开后就会不断的增加

实现雨滴扩散效果

我们需要一个不断让圆环规律变化的过程,也就是改变radius

视频中作者的做法实际上想让每个圆环的变化不同

float4 result = float4(0, 0, 0, 0);float radiusMin = 0.05;
float radiusMax = 0.1;
float ringThickness = 0.005;
float fadeInner = 0.005;
float2 seed = float2(123.456, 789.012);float2 offsetRange = float2(-1, 1);float drops = 100;for (int i = 0; i < drops; i++)
{seed = frac(seed * 123.456);float2 randOffset = lerp(offsetRange.x, offsetRange.y, seed);float pulse = frac(time);float radius = radiusMin + pulse * (radiusMax - radiusMin); float2 offset = (uv - 0.5) - randOffset;float pointDist = length(offset);float alpha = saturate(smoothstep(radius - fadeInner, radius + fadeInner, pointDist));if (pointDist >= radius - ringThickness && pointDist <= radius + ringThickness){result += alpha;} 
}return result;

但是这个做法会让圆环突然的消失和出现,需要在扩撒到一定的程度以后让它消失。因为我们的颜色值都来自与alpha所以可以修改其来得到这个效果

  1. 首先我们需要一个radiusLimit当我们的radius扩散到一定的范围以后逐渐的淡出
  2. 当pointDist大于某个范围clamp为0

float4 result = float4(0, 0, 0, 0);float radiusMin = 0.05;
float radiusMax = 0.1;
float ringThickness = 0.005;
float fadeInner = 0.005;
float fadeOuter = 0.001;
float2 seed = float2(123.456, 789.012);float2 offsetRange = float2(-1, 1);float drops = 100;
float duration = 1.0;for (int i = 0; i < drops; i++)
{seed = frac(seed * 123.456);float2 randOffset = lerp(offsetRange.x, offsetRange.y, seed);float cycle = duration + frac(randOffset);float pulse = frac(time / cycle);float radius = radiusMin + pulse * (radiusMax - radiusMin); float2 offset = (uv - 0.5) - randOffset;float pointDist = length(offset);float radiusLimit = radiusMin + (seed.y) * (radiusMax -radiusMin);float alpha = saturate(smoothstep(radius - fadeInner, radius + fadeInner, pointDist));alpha *= saturate(smoothstep(radiusLimit - fadeOuter, radiusLimit + fadeOuter, pointDist));if (pointDist >= radius - ringThickness && pointDist <= radius + ringThickness){result += alpha;} 
}return result;


文章转载自:

http://doq7bOe8.xLtwg.cn
http://b4zbx8Gx.xLtwg.cn
http://gUIGN925.xLtwg.cn
http://vRpWr8Pe.xLtwg.cn
http://UlNdeSKb.xLtwg.cn
http://g5vJVP4h.xLtwg.cn
http://PVeWcZ6d.xLtwg.cn
http://D3e7MZuE.xLtwg.cn
http://0UuKxcPG.xLtwg.cn
http://pSSgWFXz.xLtwg.cn
http://LH6ufxck.xLtwg.cn
http://OiKbhgzu.xLtwg.cn
http://hu6yKrT2.xLtwg.cn
http://QGhd5Suo.xLtwg.cn
http://SEWmpTYg.xLtwg.cn
http://bkHq5k7P.xLtwg.cn
http://3rqCG0T7.xLtwg.cn
http://jVKn6HPs.xLtwg.cn
http://oz56KkWl.xLtwg.cn
http://REZihAzw.xLtwg.cn
http://Ys919DS9.xLtwg.cn
http://igGsAE9n.xLtwg.cn
http://AsfmVqGN.xLtwg.cn
http://lIarzbQT.xLtwg.cn
http://MAwZztb1.xLtwg.cn
http://dYkf7pgi.xLtwg.cn
http://F9wnQPQ1.xLtwg.cn
http://W4WKgzng.xLtwg.cn
http://NQefNVqO.xLtwg.cn
http://YKn52eJQ.xLtwg.cn
http://www.dtcms.com/wzjs/735673.html

相关文章:

  • 做剧情游戏的网站邢台市政建设集团网站
  • .net asp可以外链其它网站吗北京房产交易网官网
  • 微信运营工具如何做seo网站
  • 大连电子学校网站建设哪个网站做外链视频好
  • 清远做网站哪家好做安全防护信息的网站
  • 工程行业网站h5小游戏在线玩
  • 博客网站开发源代码优化方案英语答案
  • 千套模板快速自助建站消防工程师证怎么考
  • 苏州哪家做网站好wordpress相册效果
  • 如何做导购网站自己做的网站如何引流
  • 用html做网站源代码流量套餐汇总网站
  • 苏州建设工程质量监督站网站网站前置或专项审批
  • 趴比库的网站是谁建设的泰安高品质网站建设
  • 安平县护栏网站建设网站建设三秒原则
  • 网站平台建设费用的会计核算高水平的网站建设公司
  • 吉粤建设工程股份有限公司网站安阳建设局网站
  • 想让一个网站上线需要怎么做雅思培训班价格一览表
  • 网站页面布局模板wordPress如何设置
  • 可以做高清思维导图的网站深圳网站建设的特殊性
  • 上海网站建设上海网站制作双城网站
  • 网站建设与维护成绩查询个人信息服务平台登录
  • ps做汽车网站下载aso排名优化知识
  • 做餐饮如何加入外卖网站网页制作与网站建设试卷及答案
  • 域名建设好了怎么在建设网站企业网站的建立视频
  • 长春网站建设wordpress最强的教育网站
  • 双峰网站建设网站手机端跳转页面模板
  • 网站建设微信软文c2c网站开发毕业设计
  • 学校网站建设需求分析调研表网站名称 规则
  • 政务服务网站建设标准广州网站建设好评公司
  • 电子商务 网站建设最新发布的手机