Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
@antv/g-shader-components
Advanced tools
基于 glslify 提供 chunks。
目前在 G 中 g-plugin-3d
g-plugin-device-renderer
会使用该包,在使用时需要配合 rollup-plugin-glslify,例如下面是 MeshBasicMaterial 使用的 FS:
// material.basic.frag
// 公共的 Uniform 定义
#pragma glslify: import('@antv/g-shader-components/scene.both.glsl')
#pragma glslify: import('@antv/g-shader-components/material.both.glsl')
#pragma glslify: import('@antv/g-shader-components/batch.declaration.frag')
#pragma glslify: import('@antv/g-shader-components/uv.declaration.frag')
#pragma glslify: import('@antv/g-shader-components/map.declaration.frag')
#pragma glslify: import('@antv/g-shader-components/wireframe.declaration.frag')
#pragma glslify: import('@antv/g-shader-components/fog.declaration.frag')
void main() {
// 通用属性,例如 fill opacity
#pragma glslify: import('@antv/g-shader-components/batch.frag')
// 贴图
#pragma glslify: import('@antv/g-shader-components/map.frag')
gbuf_color = u_Color;
gbuf_color.a = gbuf_color.a * u_Opacity;
// 绘制 wireframe
#pragma glslify: import('@antv/g-shader-components/wireframe.frag')
// 场景雾
#pragma glslify: import('@antv/g-shader-components/fog.frag')
}
.vert
只能在 Vertex Shader 中使用。.frag
只能在 Fragment Shader 中使用。带有 .declaration.
部分的在 Shader 开头全局作用域中使用,反之在 main
函数中执行。
包含场景通用的 Uniform 声明
包含材质通用的 Uniform 声明
纹理坐标
提供 wireframe 绘制,常用于调试或某种风格化效果。暂不支持边框颜色和宽度的配置。
提供简单的场景雾效果。支持 exp、exp2 和 linear 三种类型。
漫反射贴图
参考 Three.js 的实现,基于原始论文:https://www.dropbox.com/s/l1yl164jb3rhomq/mm_sfgrad_bump.pdf?dl=0
采样发生在 normal chunk 中。
漫反射贴图
提供 2D 图形的 SDF
FAQs
Shader components based on glslify
The npm package @antv/g-shader-components receives a total of 943 weekly downloads. As such, @antv/g-shader-components popularity was classified as not popular.
We found that @antv/g-shader-components demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 64 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.