加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
cloud.vs.glsl 1.11 KB
一键复制 编辑 原始数据 按行查看 历史
cgoxopx 提交于 2020-03-21 10:23 . init
varying vec3 camera;
varying vec3 pointPosition;//坐标
varying vec4 screen;
void main(){
camera = vec3(0.0,0.0,0.0);
//screen = ftransform();//设置坐标
if(gl_Color.g>0.5){//顶部
gl_Position = vec4(gl_Vertex.xy,0.0,1.0);
pointPosition = gl_Vertex.xzy; //把坐标点传给像素
}else{
if(gl_Color.r>0.5){
if(gl_Color.b<0.5){
//前
gl_Position = vec4(gl_Vertex.xy,0.0,1.0);
pointPosition = vec3(gl_Vertex.z,gl_Vertex.y,gl_Vertex.x);
}else{
//后
gl_Position = vec4(gl_Vertex.xy,0.0,1.0);
pointPosition = vec3(-gl_Vertex.z,gl_Vertex.y,-gl_Vertex.x);
}
}else{
if(gl_Color.b<0.5){
//左
gl_Position = vec4(gl_Vertex.xy,0.0,1.0);
pointPosition = vec3(gl_Vertex.x,gl_Vertex.y,-gl_Vertex.z);
}else{
//右
gl_Position = vec4(gl_Vertex.xy,0.0,1.0);
pointPosition = vec3(-gl_Vertex.x,gl_Vertex.y,gl_Vertex.z);
}
}
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化