3WebGL shader准备工具

2023-11-20

VSCode安装

VSCode(全称:Visual Studio Code)是一款由微软开发且跨平台的免费源代码编辑器。该软件支持语法高亮、代码自动补全(又称 IntelliSense)、代码重构、查看定义功能,并且内置了命令行工具和 Git 版本控制系统。用户可以更改主题和键盘快捷方式实现个性化设置,也可以通过内置的扩展程序商店安装扩展以拓展软件功能。
在 2019 年的 Stack Overflow 组织的开发者调查中,Visual Studio Code 被认为是最受开发者欢迎的开发环境。
下载地址:https://code.visualstudio.com/
在这里插入图片描述
注:除vsCode外,前端开发人员也可以使用webStorm、sublime等前端编辑器,介于当前较为流行的编辑器,且硬件要求较低,故本教程主要依托于VsCode进行教学。

插件安装

Shader languages support for VS Code (着色器语言的语法高亮器)

在这里插入图片描述

安装步骤

vsCode应用商店直接搜索 Shader languages support for VS Code,选择安装的插件,点击安装即可,安装完后重启vsCode即可。

GLSL Lint

GLSL Lint 等同于WebGL高级课程中讲到的gl-lint.js应用,二者又稍加有区别:
GLSL Lint不需要WebGL为载体。gl-lint需要在javascript语言环境中进行使用。本节课重点在GLSL Lint插件的使用,如对gl-lint感兴趣请移步与博主的WebGL 高级课程。

    <script src="../../lib/gl-lint.js" ></script>

在这里插入图片描述

安装步骤

(1)vsCode应用商店直接搜索 GLSL Lint,选择安装的插件,点击安装即可。
(2)打开下图地址链接,按照图上标记打开glsl验证器在线下载地址。
在这里插入图片描述
(3)在GLSL Lint插件中绑定GLSL验证器。操作图下图所示:
在这里插入图片描述
(4)在vsCode用户设置模块下 搜索vscode-glsllint,找到Glslang Validator path,选择刚才下载验证器的地址:
在这里插入图片描述
(5)文件拓展设置(目的可以理解为glsl-linter找寻着色器文件的标识设置)
在这里插入图片描述

"glsl-linter.fileExtensions": {
   
    ".fs.glsl": "frag",
    ".fs": "frag",
    ".vs.glsl": "vert",
    ".vs": "vert",
    ".tes.glsl": "tese",
    ".tes": "tese",
    ".tcs.glsl": "tesc",
    ".tcs": "tesc",
    ".gs.glsl": "geom",
    ".gs": "geom",
}

(6)glsl语言编辑器常用代码设置 => 文件->首选项->用户片段,搜索glsl.json,将下面代码复制到json文件即可。

/*
author:ice
time:2019.10.12
*/
{
   

	"for": {
   
		"prefix": "for",
		"body": [
			"for(int $2 = 0; $2 < $3; $2++){",
				"\t",
			"}"
		],
		"description": "for( ; ; ){\n\t//code\n}\n\nThe keyword for is used to describe a loop that is controlled by a counter. The parentheses enclose three expressions that initialize, check and update the variable used as counter. The body defined by curly braces encloses the statements that are executed at each pass of the loop.\n\nfor(int i = 0; i <= 99; i++){\n\taFunction();\n}\n\nThe execution of a single pass or the whole loop can be aborted by using a continue or a break statement respectively."
	},
	
	"while": {
   
		"prefix": "while",
		"body": [
			"while($2){",
				"\t",
			"}"
		],
		"description": "while(){\n\t//code\n}\n\nThe keyword while is used to describe a loop that is controlled by a condition. The parentheses enclose the expression that defines the condition. The body defined by curly braces encloses the statements that are executed at each pass of the loop.\n\nwhile(i <= 99){\n\taFunction();\n}\n\nThe execution of a single pass or the whole loop can be aborted by using a continue or a break statement respectively."
	},
	
	"dowhile": {
   
		"prefix": "dowhile",
		"body": [
			"do{",
				"\t",
			"} while($2){",
				"\t",
			"}"
		],
		"description": "do {\n\t//code\n}while();\n\nThe keyword do is used in combination with while to describe a loop that is controlled by a condition. The body defined by curly braces encloses the statements that are executed at each pass of the loop. The parentheses enclose the expression that defines the condition.\n\ndo {\n\taFunction();\n} while(i <= 99);\n\nThe execution of a single pass or the whole loop can be aborted by using a continue or a break statement respectively.\n\nIn contrast to a simple while loop the body is always executed at least one time even if the expression evaluates to false from the beginning."
	},

	"continue": {
   
		"prefix": "continue",
		"body": "continue;",
		"description": "The keyword continue is used inside the body of a loop to abort a single pass of the loop. All statements in the body after the continue statement are ignored and the next iteration of the loop is executed immediately."
	},
	
	"break": {
   
		"prefix": "break",
		"body": "break;",
		"description": "The keyword break is used inside the body of a loop to abort the whole loop. All statements in the body after the break statement are ignored and the loop is exited without executing any further iteration."
	},
	

	"if": {
   
		"prefix": "if",
		"body": [
			"if($2){",
				"\t",
			"}"
		],
		"description": "if(){\n\t//code\n}\n\nThe keyword if is used to describe the conditional execution of a statement. The parentheses enclose the expression that defines the condition. The curly braces enclose the statements that are executed if the condition evaluates as true.\n\nif(i != 0){\n\taFunction();\n}\n\nIn contrast to a loop the statements in curly braces are executed only one time or not at all."
	},
	
	"ifelse": {
   
		"prefix": "ifelse",
		"body": [
			"if($2){",
				"\t",
			"} else {",
				"\t",
			"}"
		],
		"description": "if(){\n\t//code\n} else {\n\t//code\n}\n\nThe keyword else is used in conjunction with the keyword if to describe the alternative execution of a statement. The parentheses enclose the expression that defines the condition. The curly braces after the if statement enclose the statements that are executed if the condition evaluates as true. The curly braces after the else statement enclose the statements that are executed if the condition evaluates as false.\n\nif(i != 0){\n\taFunction();\n} else {\n\tbFunction();\n}\n\nDepending on the condition either the statements in the first curly braces or the statements in the second curly braces are executed."
	},

	"ifdef": {
   
		"prefix": "ifdef",
		"body": [
			"#ifdef GL_ES",
			"precision mediump float;",
			"#endif"
		],
		"description": "A check defining if GLES is available"
	},
	

	"return": {
   
		"prefix": "return",
		"body": "return;",
		"description": "The keyword return is used to define a proper exit for a function. If the function has the return type void no value is passed back to the caller of the function.\n\nreturn aValue;\n\nIf the function has a non-void return type a parameter of the same type has to be included in the statement. The value is passed back to the caller of the function."
	},
	
	"discard": {
   
		"prefix": "discard",
		"body": "discard;",
		"description": "The keyword discard is used to define an exceptionally exit for a fragment shader. It is used exit the fragment shader immediately and to signal the OpenGL ES 2.0 pipeline that the respective fragment should not be drawn."
	},
	

	"vec2": {
   
		"prefix": "vec2",
		"body": "vec2($2, $3)",
		"description": "The data type vec2 is used for floating point vectors with two components. There are several ways to initialize a vector:\n• Components are specified by providing a scalar value for each component (first example).\n• Components are specified by providing one scalar value. This value is used for all components (the second example is equivalent to the first).\n• Components are specified by providing a vector of higher dimension. The respective values are used to initialize the components (the second and third example are equivalent).\n\nSide note: The vector constructors can be used to cast between different vector types since type conversions are done automatically for each component."
	},
	
	"vec3": {
   
		"prefix": "vec3",
		"body": "vec3($2, $3, $4)",
		"description": "The data type vec3 is used for floating point vectors with three components. There are several ways to initialize a vector:\n• Components are specified by providing a scalar value for each component (first example).\n• Components are specified by providing one scalar value. This value is used for all components (the second example is equivalent to the first).\nComponents are specified by providing a vector of higher dimension. The respective values are used to initialize the components (the second and third example are equivalent).• Components are specified by providing a combination of vectors and/or scalars. The respective values are used to initialize the vector (the fifth and sixth example are equivalent). The arguments of the constructor must have at least as many components as the vector that is initialized.\n\nSide note: The vector constructors can be used to cast between different vector types since type conversions are done automatically for each component."
	},
	
	"vec4": {
   
		"prefix": "vec4",
		"body": "vec4($2, $3, $4, $5)",
		"description": "The data type vec4 is used for floating point vectors with four components. There are several ways to initialize a vector:\n• Components are specified by providing a scalar value for each component (first example).\n• Components are specified by providing one scalar value. This value is used for all components (the second example is equivalent to the first).\n• Components are specified by providing a combination of vectors and scalars. The respective values are used to initialize the components (the third and fourth example are equivalent). The arguments of the constructor must have at least as many components as the vector that is initialized.\n\nSide note: The vector constructors can be used to cast between different vector types since type conversions are done automatically for each component."
	},
	

	"mat2": {
   
		"prefix": "mat2",
		"body": "mat2($2, $3)",
		"description": "The data type mat2 is used for floating point matrices with two times two components in column major order. There are several ways to initialize a matrix:\n• Components are specified by providing a scalar value for each component (first example). The matrix is filled column by column.\n• Components are specified by providing one scalar value. This value is used for the components on the main diagonal (the second example is equivalent to the first).\n• Components are specified by providing a combination of vectors and scalars. The respective values are used to initialize the components column by column. The arguments of the constructor must have at least as many components as the matrix that is initialized."
	},
	
	"mat3": {
   
		"prefix": "mat3",
		"body": "mat3($2, $3, $4)",
		"description": "The data type mat3 is used for floating point matrices with three times three components in column major order. There are several ways to initialize a matrix:\n• Components are specified by providing a scalar value for each component (first example). The matrix is filled column by column.\n• Components are specified by providing one scalar value. This value is used for the components on the main diagonal (the second example is equivalent to the first).\n• Components are specified by providing a combination of vectors and 
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

3WebGL shader准备工具 的相关文章

  • 在 Windows 上使用 Emacs 编译 C++ 程序

    我已经使用 Emacs 进行基本文本编辑有一段时间了 但从今天开始 我尝试使用它进行 C 编译 在过去的几个小时里 我一直在寻找如何解决这个问题 但我在他们的技术中不断遇到障碍 我认为其中一些与教程过时有关 基本上 我想做的就是能够通过 M
  • Visual Studio 2012 - “添加”上下文菜单的项模板

    我成功创建新的项模板并将其添加到 Visual Studio 2012 现在我可以使用右键单击来创建新项目 解决方案资源管理器 添加 新项目 dialog But how I can add this Item Template to ap
  • 如何将shadershop公式转换成glsl

    我最近一直在学习着色器的一些基础知识 并且想出了一个很棒的视觉工具 着色器商店 http www cdglabs org Shadershop 但我无法将我在此站点中创建的公式转换为 glsl 一个简单的例子 我在此网站中创建了一个公式 我
  • Google Apps 脚本是否支持外部 IDE?

    我正在使用 Google Apps 脚本 想知道是否可以使用 Google 提供的编辑器之外的任何类型的编辑器 我购买了 Sublime Text 并且想使用它 Google 提供的那个很恶心 文本很小 尽管我有一个巨大的屏幕和语法颜色 我
  • 如何调试肉桂小程序?

    我想写一个肉桂小程序 这些都是基于 JavaScript 的 我希望编写的代码更改服务 打开和关闭它们 类似于WebDeveloper菜单小程序 https bitbucket org infiniteshroom cinnamon web
  • 在Unity中如何使两个精灵的重叠区域透明?

    在Unity中如何使两个精灵的重叠区域透明 你能写一个关于它的着色器吗 经过一些研究 我了解到我应该使用模板缓冲区 但我不知道如何使用 这对我来说至关重要 我必须在 6 天内完成这个学校项目 请帮忙 示例图片 就这样 请记住这是我第一次使用
  • OpenGL - 固定管线着色器默认值(使用着色器模仿固定管线)

    谁能给我提供类似于固定功能管道的着色器 我最需要默认的片段着色器 因为我在网上找到了类似的顶点着色器 但如果你有一双应该没问题 我想使用固定管道 但具有着色器的灵活性 因此我需要类似的着色器 以便我能够模仿固定管道的功能 非常感谢 我是新来
  • Lighttable,设置字体大小

    我是 Light Table IDEAS 的新手 有谁知道如何设置workspace和 Windows 字体大小 我可以更改编辑器字体大小 但不知道如何设置font size对于其他元素 或者更改所有 IDE 字体的全局字体大小 打开命令窗
  • 什么是好的跨平台 C++ IDE? [关闭]

    Closed 这个问题不符合堆栈溢出指南 help closed questions 目前不接受答案 它需要有良好的代码完成支持 调试器和浏览代码的好方法 单击以转到文档 由于我被 Java IDE Eclipse 宠坏了 如果它支持重构
  • 用于 Java 项目的 NetBeans 远程编辑?

    我的项目使用了 Play 框架 所以我不需要可以编译的编辑器 我通常喜欢 NetBeans 但希望远程编辑服务器上的源文件以节省时间 我还经常在台式机 上网本之间切换进行开发 因此远程编辑可以使我免于同步开发环境 我对 Netbeans 远
  • 哪个 IDE 支持 Node.js 应用程序的 CoffeeScript 调试(源映射、断点和调用堆栈)?

    我对整个 CoffeeScript 场景还很陌生 是否有任何 IDE 支持调试在 Node js 上运行的 CoffeeScript 源代码 我希望能够在 coffee 文件中设置断点并查看调用堆栈并检查变量 WebStorm 似乎还不符合
  • 编写每个三角形/面具有纯色的 GLSL 片段着色器的方法

    我有顶点和三角形数据 其中包含每个数据的颜色triangle 面 不是每个顶点 即单个顶点由多个面共享 每个面可能具有不同的颜色 我应该如何在 GLSL 中解决这个问题以获得每个的纯色分配face正在渲染 通过平均顶点相邻多边形的颜色来计算
  • 如何防止 IntelliJ IDEA 在启动时重新分配文件类型关联?

    我正在使用 IntelliJ IDEA Ultimate 18 1 而 Jenkinsfile 支持很糟糕 值得庆幸的是 将文件视为 Groovy 是我可以接受的解决方法 这涉及到 删除 Jenkinsfile 关联 在Groovy组下添加
  • 如何在 IDE 中使用 Grails 依赖项

    So I finally https stackoverflow com questions 1867064 grails and local maven dependencies让我的依赖项与 Grails 一起工作 现在 我的 IDE
  • 对 VBO 中的特定三角形使用不同的纹理

    我有 9 个由三角形组成的四边形 如下所示 我在用着VBO存储有关它们的数据 它们的位置和纹理坐标 我的问题是 是否可以仅使用一个来使四边形 5 具有与其余四边形不同的纹理VBO and shader 绿色代表纹理 1 黄色代表纹理 2 到
  • Visual Studio Professional 2013 Update 5 中的“在线服务不可用”问题

    我一直在 vscode 2013 工作直到今天 但是 当我今天早上尝试打开 IDE 时 它收到 您的许可证已过时 必须更新 错误消息 如下所示 在我尝试更新许可证和登录操作之后 当我尝试这两个时 它得到 在线服务不可用 请稍后重试 错误消息
  • 在 Codeblocks 中启用编译器输出窗格

    This is probably a really noob question but the fact of the matter is that my Code blocks wouldn t show me errors when i
  • pytorch 的 IDE 自动完成

    我正在使用 Visual Studio 代码 最近尝试了风筝 这两者似乎都没有 pytorch 的自动完成功能 这些工具可以吗 如果没有 有人可以推荐一个可以的编辑器吗 谢谢你 使用Pycharmhttps www jetbrains co
  • android studio 和 android SDK 捆绑的 eclipse 版本有什么区别

    我没有 Android 开发经验 我想开始编写应用程序 The 官方开发者工具页面 http developer android com tools index html包含两个不同 IDE 的链接 第一个包含捆绑的 ADT 版本Eclip
  • 设置 Emacs 进行 Erlang 编程

    Emacs 是 Erlang 编程的首选 IDE 有很多好的模式 distel erlware mode 默认的 erlang 模式 但是您对设置 Emacs 进行专业 Erlang 开发有何建议 按照中所述设置 erlang mode自述

随机推荐

  • DM8查看SQL执行计划的5种方法(测试+调优用)

    使用场景如下 单独的看看执行计划 ET语句可以查看指定语句的各个操作符的执行时间占比 便于优化 单独disql中查看计划 一条sql语句没有走期望的执行计划 这时可以从内存中把它的执行计划dump出来 参考第四种方法 10053事件根据设置
  • 朋友月薪3000,靠 Python 做副业月入过万!

    被压垮的打工人 你还好吗 房贷车贷 上老下小 日常开销 但你的收入有多少 所以你不敢生病 甚至不敢回家 就为了每个月那么点死工资 还得天天加班 然而忙忙忙 却变成了 穷忙族 成为了职场废人 朋友在事业单位工作 事少离家近 收入也很稳定 但她
  • java ftp 域名解析_域名系统DNS和FTP

    域名系统概述 域名系统DNS Domain Name System 是英特网使用的命名系统 用于把便于人们使用机器名字转化为IP地址 为什么机器在处理IP数据报时要使用IP地址而不使用域名呢 IP地址长度固定 而域名长度不固定 机器处理起来
  • 2-11寻找链表中的环

    题目描述 传入一个头节点判断链表是否有环 如果有环返回第一个入环的节点 如果没有环返回null 解题方法1 可以使用哈希表来完成 每遍历一个节点就把该节点的引用存储到哈希表 如果哈希表中出现了重复的引用 那么那个重复的引用就是第一个入环的节
  • vue-lazyload基础实例(基于vue2.0和vue-router2.0)

    首先引入依赖 import Vue from vue import Router from vue router import VueLazyload from vue lazyload 配置vue lazyload Vue use Vue
  • 关于使用vue安装项目的时候出现了 command failed: pnpm install --reporter silent --shamefully-hoist 报错

    依靠 pnpm 使用脚手架创建 vue 项目时 出现了 command failed pnpm install reporter silent shamefully hoist 奇葩的报错 寻查无果 后觉察到是由于我使用的文件系统不支持硬链
  • 标题Ant Design of Vue 组件库中Modal“确认“按钮和“取消“按钮成英文状态

    标题Ant Design of Vue 组件库中Modal 确认 按钮和 取消 按钮成英文状态 因为是国际化的原因 造成确定按钮和取消按钮变成英文 需要设置 okText 与 cancelText 以自定义按钮文字 div div
  • Battery Charging Specification(BC1.2) 和 QC2.0 笔记

    BC2 说明 参数说明 标准检测流程 VBUS检测 VBUS Detect PD 移动设备 中有个检测VBUS是否有效的电路 电路有一个参考值 高于这个值就认为是VBUS有效了 这个参考值不是固定的 设计的时候保证它在0 8V 4V之间就可
  • [机器学习与scikit-learn-20]:算法-逻辑回归-线性逻辑回归linear_model.LogisticRegression与代码实现

    作者主页 文火冰糖的硅基工坊 文火冰糖 王文兵 的博客 文火冰糖的硅基工坊 CSDN博客 本文网址 机器学习与scikit learn 20 算法 逻辑回归 线性逻辑回归linear model LogisticRegression与代码实
  • Web服务器群集:LVS+Keepalived高可用群集

    目录 一 理论 1 Keepalived 2 VRRP协议 虚拟路由冗余协议 3 部署LVS Keepalived 高可用群集 二 实验 1 LVS Keepalived 高可用群集 三 问题 1 备服务器网卡启动报错 四 总结 一 理论
  • 平衡二叉排序树插入结点的学习总结

    最近写了平衡二叉排序树代码 在这里对自己的理解做一下总结 下面的文字 更多的是把我自己的遇到的理解上的问题和思路讲清楚 可能不能让你一下就看明白 这是我的问题 网上其实有很多写的很好的文章 我也是学他们的 然后通过写文章来考研自己是不是真的
  • Redis之坑:Redis与MySQL中事务的区别

    Redis之坑 spring data redis中的Redis事务 Redis之坑 理解Redis事务 Redis之坑 Redis与MySQL中事务的区别 Transaction之坑 数据库事务 Transaction之坑 Spring中
  • 【模型剪枝】——开源项目总结

    修剪是一种常用的压缩神经网络模型的技术 修剪方法探索模型权重 参数 中的冗余 并尝试删除 修剪冗余和非关键权重 冗余元素从模型中修剪 它们的值归零 我们确保它们不参与反向传播过程 pytorch pruning https github c
  • 设置定时任务为每天凌晨2点执行和每小时执行一次?

    每天凌晨2点 0 0 2 和每天隔一小时 0 1 例1 每隔5秒执行一次 5 例2 每隔5分执行一次 0 5 在26分 29分 33分执行一次 0 26 29 33 例3 每天半夜12点30分执行一次 0 30 0 注意日期域为0不是24
  • axure9怎么让页面上下滑动_Axure动态面板(上下左右滑动页面)

    手机端交互中 页面的上下左右滑动是常用的交互形态 今天给大家分享一下如何使用Axure来进行模拟 这里使用动态面板来实现 如果对动态面板不是很了解的同学 请查看专栏里的 动态面板入门教程 先看效果 开工之前我们我们先分析一下 滑动效果的用处
  • 利用Android Lost通过互联网或短信远程控制安卓设备

    利用Android Lost通过互联网或短信远程控制安卓设备 作者 Jack Wallen 杰克 瓦伦翻译 PurpleEndurer 2014 11 15第1版 使用智能手机要考虑的一个至关重要的因素是安全性 当然 安全问题不仅仅存在于平
  • java springboot -- MultipartFile -图片上传到远程服务器上

    新增文件 param file return private boolean saveFile MultipartFile file try 文件保存路径 String filePath A merchant 映射的地址 String fi
  • Springboot+vue+hadoop+java图书个性化推荐系统

    前台首页功能模块 3 1首页 图书个性化推荐系统 在前台首页可以查看首页 图书信息 好书推荐 留言反馈 个人中心 后台管理等内容 如图 3 2图书信息 在图书信息页面通过查看图书编号 图书名称 图书类别 图片 作者 出版社 版次 数量 点击
  • 背单词(持续更新)

    文章目录 星火雅思周计划 229 复习 考研 352 353 职场俚语 1 2 7分 1 2 3 4 5 6 7 8 haochi fun 1 2 GRE 1 2 托福 249 247 248 245 246 243 244 241 242
  • 3WebGL shader准备工具

    VSCode安装 VSCode 全称 Visual Studio Code 是一款由微软开发且跨平台的免费源代码编辑器 该软件支持语法高亮 代码自动补全 又称 IntelliSense 代码重构 查看定义功能 并且内置了命令行工具和 Git