雷达波Shader
OSG版本:
vert
#version
varying out vec3 v;
void main()
{
gl_FrontColor = gl_Color;
gl_Position = ftransform();
v = gl_Vertex.xyz;
}
frag
#version
varying in vec3 v;
uniform float osg_FrameTime;
void main()
{
//gl_FragColor = vec4(1,0,0,1);
gl_FragColor = gl_Color;
// 条带间隔
//if (mod(floor((v.z-osg_FrameTime*100000)/ 100000),2)!=0)
// discard;
//gl_FragColor = vec4(1,0,0,0.5);
float alpha = (cos((v.z-osg_FrameTime*) / )+-0.2)/;
gl_FragColor = vec4(gl_Color.xyz,alpha);
}
Unity版本:
// Upgrade NOTE: replaced '_World2Object' with 'unity_WorldToObject'
// Upgrade NOTE: replaced '_World2Object' with 'unity_WorldToObject'
Shader "Custom/RadarWave" {
Properties {
_Color ("Color", Color) = (,,,)
_MainTex ("Albedo (RGB)", 2D) = "white" {}
_Glossiness("Smoothness", Range(,)) = 0.5
_Metallic("Metallic", Range(,)) = 0.0
_TransVal("Transparency Value", Range(,)) = 0.5
_StripWidth("Strip Width", Range(0.01,)) = 0.1
_Speed("Speed", Range(0.1,)) =
[Enum(x,,y,,z,)]_Direction("Moving Direction", Int)=
}
SubShader {
Tags { "RenderType"="Opaque" "Queue" = "Transparent" }
LOD
//Cull Off//关闭背面裁剪
//Lighting Off//此设置在surface shader中不起作用,貌似是在Unlit Shader中使用的
//ZWrite On
//ZTest On
Blend SrcAlpha OneMinusSrcAlpha
CGPROGRAM
// Physically based Standard lighting model, and enable shadows on all light types
//#pragma surface surf Standard fullforwardshadows alpha vertex:vert
#pragma surface surf NoLightModel fullforwardshadows alpha vertex:vert
// Use shader model 3.0 target, to get nicer looking lighting
#pragma target 3.0
sampler2D _MainTex;
struct Input {
float2 uv_MainTex;
float4 modelPos_;
};
half _Glossiness;
half _Metallic;
half _TransVal;
half _StripWidth;
half _Speed;
int _Direction;
fixed4 _Color;
// Add instancing support for this shader. You need to check 'Enable Instancing' on materials that use the shader.
// See https://docs.unity3d.com/Manual/GPUInstancing.html for more information about instancing.
// #pragma instancing_options assumeuniformscaling
UNITY_INSTANCING_CBUFFER_START(Props)
// put more per-instance properties here
UNITY_INSTANCING_CBUFFER_END
void surf(Input IN, inout SurfaceOutput o) {
// Albedo comes from a texture tinted by color
fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color;
o.Albedo = c.rgb;
//float4 tmp = mul(unity_WorldToObject, IN.modelPos_);
//_Time float4 t是自该场景加载开始所经过的时间,4个分量分别是 (t/20, t, t*2, t*3)
float modelPos = _Direction == ? IN.modelPos_.x : _Direction == ? IN.modelPos_.y : IN.modelPos_.z;
/*if (fmod(floor((modelPos -_Time.y*_Speed)/ _StripWidth),3)!=0)
{
//clip(-1);
discard;
}
//o.Alpha = c.a;
o.Alpha = _TransVal;*/
o.Alpha = (cos((modelPos - _Time.y*_Speed) / _StripWidth) + ) / ;
o.Alpha = clamp(o.Alpha, 0.1, 0.9);
}
void vert(inout appdata_full v, out Input o)
{
UNITY_INITIALIZE_OUTPUT(Input, o);
o.modelPos_ = v.vertex;
}
//命名规则:Lighting接#pragma suface之后起的名字
//lightDir :点到光源的单位向量 viewDir:点到摄像机的单位向量 atten:衰减系数
float4 LightingNoLightModel(SurfaceOutput s, float3 lightDir, half3 viewDir, half atten)
{
float4 c;
c.rgb = s.Albedo;
c.a = s.Alpha;
return c;
}
ENDCG
}
FallBack "Diffuse"
}
雷达波Shader的更多相关文章
- Unity Shader (四)片段程序示例
1.环境光+漫反射+高光+点光源 Shader "Custom/Example_Frag_1" { properties { _MainColor(,,,) _Specular ...
- Unity Shader (四)顶点程序示例
1.在顶点函数中实现凸起效果 Shader "Custom/Example" { properties { _R(,))= //圆的半径,也是凸起的范围 _OX(,))= //x轴 ...
- SAR图像与光学图像区别
按传感器采用的成像波段分类,光学图像通常是指可见光和部分红外波段传感器获取的影像数据.而SAR传感器基本属于微波频段,波长通常在厘米级.可见光图像通常会包含多个波段的灰度信息,以便于识别目标和分类提取 ...
- 针对UDP丢包问题,进行系统层面和程序层面调优
转自:https://blog.csdn.net/xingzheouc/article/details/49946191 1. UDP概念 用户数据报协议(英语:User Datagram Proto ...
- osgEarth设置模型旋转角度
#include<windows.h> #include <osgViewer/Viewer> #include <osgEarthDrivers/gdal/GDALOp ...
- 【遥感专题系列】微波遥感(三、SAR图像特征)
SAR是主动式侧视雷达系统,且成像几何属于斜距投影类型.因此SAR图像与光学图像在成像机理.几何特征.辐射特征等方面都有较大的区别.在进行SAR图像处理和应用前,需要了解SAR图像的基本特征. 本文主 ...
- TensorFlow系列专题(十三): CNN最全原理剖析(续)
目录: 前言 卷积层(余下部分) 卷积的基本结构 卷积层 什么是卷积 滑动步长和零填充 池化层 卷积神经网络的基本结构 总结 参考文献 一.前言 上一篇我们一直说到了CNN[1]卷积层的特性,今天 ...
- SAR总结
1.星载InSAR技术简介 星载合成孔径雷达干涉测量(InSAR)是一种用于大地测量和遥感的雷达技术.InSAR使用两个或多个SAR图像,利用返回卫星的波的相位差来计算目标地区的地形.地貌以及表面的微 ...
- Wi-Fi DFS与TPC介绍
DFS与TPC是wifi认证的其中一项测试内容,如果不需要DFS功能,可以不进行测试,但是某些属于DFS频段的wifi信道则不允许使用. 1. 什么是WIFI Auto DFS? 通俗的说就是:躲雷达 ...
随机推荐
- arduino入门套件学习过程-安装配置
arduino作为非常火的开源软硬件,有其巨大的优势和前景. 我呢,近期正好需要用arduino做一些小东西,借此机会,分享我的arduino学习历程,欢迎各位朋友一起讨论,指点! 现在进入正题: 这 ...
- 实验四 使用ASP.NET内置对象 总结
这次实验内容是ASP.NET的一些内置对象的熟悉,感觉看到了上学期JSP的影子,很多地方都很像.像Response对象,Request对象,Context对象等等.以前我老是搞混Response对象和 ...
- qualcomm compile instructions
qualcomm编译指令 Compile the Entire Android Software source build/envsetup.sh lunch msm8909-userdebug ma ...
- Aizu_Insertion Sort
原题链接:https://vjudge.net/problem/Aizu-ALDS1_1_A 题目描述 Write a program of the Insertion Sort algorithm ...
- windows sever2003安装Wamp 2.5不成功——VC 11不支持Windows Server 2003和win XP?
Windows Server 2003 安装Wamp 2.5不成功Wampserver 2.5 will not run on Windows XP 报错信息:C:\wamp\bin\apache\a ...
- java的GUI程序的基本思路是以JFrame为基础
JFrame – java的GUI程序的基本思路是以JFrame为基础,它是屏幕上window的对象,能够最大化.最小化.关闭. JPanel – Java图形用户界面(GUI)工具包swing中的面 ...
- ios中layer动画和UIView动画代码总结
kCATransitionFade淡出 kCATransitionMoveIn覆盖原图 kCATransitionPush推出 kCATransitionReveal底部显出来 pageC ...
- Oracle错误IMP-00010: 不是有效的导出文件, 头部验证失败 分类: Oracle 2015-07-09 13:56 20人阅读 评论(0) 收藏
Oracle 11g的dmp备份文件导入到Oracle 10g,出现错误信息: Import: Release 10.2.0.1.0 - Production on 星期四 7月 9 13:47:04 ...
- RHEL 7 中 systemctl 的用法(替代service 和 chkconfig)
1.systemctl是RHEL 7 的服务管理工具中主要的工具,它融合之前service和chkconfig的功能于一体.可以使用它永久性或只在当前会话中启用/禁用服务. systemctl可以列出 ...
- Ubuntu 安装IntelliJ IDEA
1. 下载IDEA 官网地中:http://www.jetbrains.com/idea/download/index.html 选择对应操作系统的版本.下载后,我的文件名称为: idea ...