mirror of
https://github.com/Linloir/SceneEditor.git
synced 2026-02-04 12:23:34 +08:00
[CORE][ADD] Thumbnail shader
This commit is contained in:
parent
947cd9b445
commit
7b9d8766d0
@ -184,6 +184,8 @@
|
|||||||
<None Include="skyboxvertexshader.glsl" />
|
<None Include="skyboxvertexshader.glsl" />
|
||||||
<None Include="terrainfragmentshader.glsl" />
|
<None Include="terrainfragmentshader.glsl" />
|
||||||
<None Include="terrainvertexshader.glsl" />
|
<None Include="terrainvertexshader.glsl" />
|
||||||
|
<None Include="thumbnailfragmentshader.glsl" />
|
||||||
|
<None Include="thumbnailvertexshader.glsl" />
|
||||||
<None Include="vertexshader.glsl" />
|
<None Include="vertexshader.glsl" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
|||||||
@ -300,5 +300,11 @@
|
|||||||
<None Include="boundfragmentshader.glsl">
|
<None Include="boundfragmentshader.glsl">
|
||||||
<Filter>Resource Files</Filter>
|
<Filter>Resource Files</Filter>
|
||||||
</None>
|
</None>
|
||||||
|
<None Include="thumbnailvertexshader.glsl">
|
||||||
|
<Filter>Resource Files</Filter>
|
||||||
|
</None>
|
||||||
|
<None Include="thumbnailfragmentshader.glsl">
|
||||||
|
<Filter>Resource Files</Filter>
|
||||||
|
</None>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
19
FinalProject/thumbnailfragmentshader.glsl
Normal file
19
FinalProject/thumbnailfragmentshader.glsl
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
#version 430 core
|
||||||
|
out vec4 FragColor;
|
||||||
|
|
||||||
|
struct Material {
|
||||||
|
sampler2D texture_diffuse1;
|
||||||
|
sampler2D texture_specular1;
|
||||||
|
float shininess;
|
||||||
|
};
|
||||||
|
|
||||||
|
in vec3 FragPos;
|
||||||
|
in vec3 Normal;
|
||||||
|
in vec2 TexCoords;
|
||||||
|
|
||||||
|
uniform Material material;
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
FragColor = texture(material.texture_diffuse1, TexCoords);
|
||||||
|
}
|
||||||
21
FinalProject/thumbnailvertexshader.glsl
Normal file
21
FinalProject/thumbnailvertexshader.glsl
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
#version 430 core
|
||||||
|
layout (location = 0) in vec3 aPos;
|
||||||
|
layout (location = 1) in vec3 aNormal;
|
||||||
|
layout (location = 2) in vec2 aTexCoords;
|
||||||
|
|
||||||
|
out vec3 FragPos;
|
||||||
|
out vec3 Normal;
|
||||||
|
out vec2 TexCoords;
|
||||||
|
|
||||||
|
uniform mat4 model;
|
||||||
|
uniform mat4 view;
|
||||||
|
uniform mat4 projection;
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
FragPos = vec3(model * vec4(aPos, 1.0));
|
||||||
|
Normal = mat3(transpose(inverse(model))) * aNormal;
|
||||||
|
TexCoords = aTexCoords;
|
||||||
|
|
||||||
|
gl_Position = projection * view * vec4(FragPos, 1.0);
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user