Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
lmj01 committed Aug 25, 2023
1 parent b07d9b2 commit bc21187
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 0 deletions.
42 changes: 42 additions & 0 deletions cg/shader.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,48 @@ shader本身是一个泛概念

一个shader指整个文件中所有的Pass或kernel。Unity ShaderLab把一整个文件所有的Pass的所有代码和render state都打包到一起称为一个Shader。引擎工程中很多都是这样处理的。

### 框架
这是shader执行的抽象过程
```javascript
const viewportList = [];
const passSequence = {
passes: [
{
subpasses: [],
},
],
};
// 渲染主循环
function doRender() {
for (let i = 0; i < viewportList.length; i++) {
const sizeOfViewport = get(i);
const cameraOfViewport = get(i);
cameraOfViewport.update();
renderAdpater.setViewport(get(i));
renderAdpater.renderSequence(passSequence);
}
}
// 单渲染
function renderSequence(passSequence) {
const render = this.render;
for (const pass of passSequence.passes) {
for (const subpass of pass.subpasses) {
// 单frame渲染的结果存放的地方
// 当前单帧的数据是融合blend还是显屏出来
doBeforeRender();
const renderTarget = get(pass,subpass);
const camera = get(pass, subpass);
const scene = get(pass, subpass);
render.setRenderTarget(renderTarget);
render.render(scene, camera);
render.setRenderTarget(null);
doAfterRender();
}
}
}
```


## GLSL- Shader

着色器是一种可编程的渲染管线,与其他编程语言一样,先对源码编译Compile再链接Link最后生成Program。Shader是提供给GPU运行的程序,特点就是并行处理相同的逻辑不同的数据。着色器类型有
Expand Down
1 change: 1 addition & 0 deletions cpl/lua.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# [lua](http://www.lua.org/)

## 参考
- [Lua Awesome-lua官方链接上的记录](https://github.com/LewisJEllis/awesome-lua)
- [Quickly view and test GLSL fragment shaders while allowing lua scripting to modify uniforms ](https://github.com/nevilc/ShaderPreview)
- [luafxbuilder is a proof of concept test to use lua as effect file format primarily for shaders](https://github.com/pixeljetstream/luafxbuilder)
- [lua-cpp一个用C++11封装lua的库](https://gitee.com/linuxtongyong/lua-cpp-wrapper)
Expand Down
3 changes: 3 additions & 0 deletions index/computerScience.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- [C](../cpl/c.md)
- [Cplusplus](../cpl/cplusplus.md)
- [lua](../cpl/lua.md)
- [Java](../java/Java.md)
### Dev

- [CMD](../dev-note/cmd.md)
Expand Down Expand Up @@ -85,6 +86,8 @@
- [PAG Portable Animated Graphics](https://pag.art/)
- [3d model file](../cg/modelFile.md)
- [Effekseer特效编辑器](https://github.com/effekseer/Effekseer)
- [Mitsuba渲染器](http://www.mitsuba-renderer.org/)
- [github](https://github.com/mitsuba-renderer/mitsuba3)

### paper

Expand Down
4 changes: 4 additions & 0 deletions java/Java.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,7 @@ public保证接口的向后兼容,内部的实现与size可能会改变, 这
4. spring



## 其他模块

- [maven](./maven.md)
3 changes: 3 additions & 0 deletions java/maven.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Maven

## 命令
- mvn test

## itext7

itext7 的字体涉及到版权问题,基本就是与adobe有关
Expand Down

0 comments on commit bc21187

Please sign in to comment.