forked from turesnake/tprPix
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
40 changed files
with
341 additions
and
186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#version 330 core | ||
|
||
//-- 片段着色器的 主输出:颜色 | ||
out vec4 FragColor; | ||
|
||
//-- 从 顶点着色器 传来的 数据(名称和类型 都要相同) | ||
in vec2 TexCoord; //-- 每个pix 在 tecture 上的坐标 [0.0, 1.0] [left_bottom] | ||
|
||
//-- sampler 系列 是 采样器数据类型。 | ||
//-- 现在,我们创建了 1个 纹理采样器 | ||
uniform sampler2D texture1; | ||
|
||
|
||
void main() | ||
{ | ||
//-- 取得 texture 颜色 -- | ||
vec4 texColor = texture(texture1, TexCoord); | ||
|
||
//-- 半透明度小于 0.05 的像素直接不渲染 -- | ||
//-- 通过这个方法来处理大部分 “要么实心要么全透明” 的图元 | ||
if( texColor.a < 0.05 ){ | ||
discard; | ||
} | ||
|
||
vec3 addColor = vec3( 0.87, 0.42, 0.42 ); | ||
|
||
texColor.rgb = texColor.rgb * addColor; | ||
|
||
|
||
//FragColor = vec4( 0.2, 0.6, 0.9, 1.0 ); | ||
//FragColor = vec4( texColor.rgb, 0.2 ); //- 半透明 | ||
//FragColor = vec4( texColor.rgb * 0.5, 1.0); | ||
FragColor = vec4( 0.87, 0.42, 0.42, 0.8); //- 实心颜色 | ||
//FragColor = vec4( texColor.rgb, 0.9 ); | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#version 330 core | ||
|
||
// 由用户程序中 glVertexAttribPointer() 配置 (VAOVBO 模块中) -- | ||
layout (location = 0) in vec3 aPos; //-- 每个pix 在 图元上的坐标 [-1.0,1.0] | ||
layout (location = 1) in vec2 aTexCoord; //-- 每个pix 在 tecture 上的坐标 [0.0,1.0] | ||
|
||
|
||
//-- 输出给 fs 的颜色数据 | ||
out vec2 TexCoord; //-- 每个pix 在 tecture 上的坐标 [-1.0,1.0] | ||
|
||
//uniform mat4 transform; //-- 矩阵 变换 变量。 | ||
|
||
uniform mat4 model; | ||
uniform mat4 view; | ||
uniform mat4 projection; | ||
|
||
|
||
//-- 顶点着色器,只需要 每个顶点 运行一次 -- | ||
// 在我们的 pix 游戏中,所有 图元都是 4个顶点的 矩形。 | ||
// 所以,顶点着色器的 工作负担,要比 片段着色器 轻很多 | ||
void main() | ||
{ | ||
gl_Position = projection * view * model * vec4( aPos, 1.0 ); | ||
TexCoord = aTexCoord; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ enum class RenderLayerType{ | |
MajorGoes, | ||
//.... | ||
|
||
|
||
PlayerGoIndication, //- not be used yet | ||
UIs | ||
}; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* ================= playerGoIndication.cpp ========================== | ||
* -- tpr -- | ||
* CREATE -- 2019.08.19 | ||
* MODIFY -- | ||
* ---------------------------------------------------------- | ||
*/ | ||
#include "GameObj.h" | ||
|
||
|
||
|
||
/* =========================================================== | ||
* init | ||
* ----------------------------------------------------------- | ||
*/ | ||
void GameObj::render_all_goMesh_for_playerGoIndication(){ | ||
|
||
//-------------------------------// | ||
// | ||
//-------------------------------// | ||
|
||
|
||
|
||
} | ||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.