-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for wireframe rendering
* Highlight the currently selected mesh by drawing its wireframe representation
- Loading branch information
Benjamin Glatzel
committed
Jun 5, 2017
1 parent
857eac9
commit 83d8ff6
Showing
33 changed files
with
231 additions
and
21 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
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 |
---|---|---|
|
@@ -38,6 +38,7 @@ enum Enum | |
kDefault, | ||
kInvertedCulling, | ||
kDoubleSided, | ||
kWireframe, | ||
|
||
kCount | ||
}; | ||
|
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,49 @@ | ||
// Copyright 2016 Benjamin Glatzel | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#version 450 | ||
|
||
#extension GL_ARB_separate_shader_objects : enable | ||
#extension GL_ARB_shading_language_420pack : enable | ||
#extension GL_GOOGLE_include_directive : enable | ||
|
||
#include "lib_math.glsl" | ||
#include "gbuffer.inc.glsl" | ||
|
||
// Ubos | ||
PER_MATERIAL_UBO; | ||
PER_INSTANCE_UBO; | ||
|
||
// Bindings | ||
BINDINGS_GBUFFER; | ||
layout (binding = 6) uniform sampler2D emissiveTex; | ||
|
||
// Output | ||
OUTPUT | ||
|
||
void main() | ||
{ | ||
GBuffer gbuffer; | ||
{ | ||
gbuffer.albedo = vec4(0.0, 0.5, 0.5, 1.0); | ||
gbuffer.normal = normalize(vec3(0.0, 1.0, 0.0)); | ||
gbuffer.metalMask = 0.0; | ||
gbuffer.specular = 0.5; | ||
gbuffer.roughness = 1.0; | ||
gbuffer.materialBufferIdx = 0; | ||
gbuffer.emissive = 0.0; | ||
gbuffer.occlusion = 1.0; | ||
} | ||
writeGBuffer(gbuffer, outAlbedo, outNormal, outParameter0); | ||
} |
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,34 @@ | ||
// Copyright 2016 Benjamin Glatzel | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#version 450 | ||
|
||
#extension GL_ARB_separate_shader_objects : enable | ||
#extension GL_ARB_shading_language_420pack : enable | ||
#extension GL_GOOGLE_include_directive : enable | ||
|
||
#include "gbuffer_vertex.inc.glsl" | ||
|
||
out gl_PerVertex | ||
{ | ||
vec4 gl_Position; | ||
}; | ||
|
||
PER_INSTANCE_UBO; | ||
INPUT(); | ||
|
||
void main() | ||
{ | ||
gl_Position = uboPerInstance.worldViewProjMatrix * vec4(inPosition.xyz, 1.0); | ||
} |
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,10 @@ | ||
{ | ||
"name": "wireframe.frag", | ||
"properties": { | ||
"name": "wireframe.frag", | ||
"gpuProgramName": "wireframe.frag.glsl", | ||
"entryPoint": "main", | ||
"preprocessorDefines": "", | ||
"gpuProgramType": 1 | ||
} | ||
} |
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,10 @@ | ||
{ | ||
"name": "wireframe.vert", | ||
"properties": { | ||
"name": "wireframe.vert", | ||
"gpuProgramName": "wireframe.vert.glsl", | ||
"entryPoint": "main", | ||
"preprocessorDefines": "", | ||
"gpuProgramType": 0 | ||
} | ||
} |
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
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
Oops, something went wrong.