History

INtroducing the unlit mode for fragments

samcake committed 10 years ago

Commit e306a241 parent f1b236f14 files · +106 −23Browse files

Showing the changes to libraries/render-utils/src/DebugDeferredBuffer.cpp (1 of 14 files). Show all

Unified · Split

libraries/render-utils/src/DebugDeferredBuffer.cpp+10−0
@@ -94,6 +94,14 @@ static const std::string DEFAULT_EMISSIVE_SHADER{ · 93 unmodified lines
9494 " }"
9595 };
9696
97+static const std::string DEFAULT_UNLIT_SHADER{
98+ "vec4 getFragmentColor() {"
99+ " DeferredFragment frag = unpackDeferredFragmentNoPosition(uv);"
100+ " return vec4(pow(vec3(frag.diffuseVal.w), vec3(1.0 / 2.2)), 1.0);"
101+// " return (frag.mode == FRAG_MODE_UNLIT ? vec4(pow(frag.diffuse, vec3(1.0 / 2.2)), 1.0) : vec4(vec3(0.0), 1.0));"
102+ " }"
103+};
104+
97105 static const std::string DEFAULT_LIGHTMAP_SHADER{
98106 "vec4 getFragmentColor() {"
99107 " DeferredFragment frag = unpackDeferredFragmentNoPosition(uv);"
@@ -184,6 +192,8 @@ std::string DebugDeferredBuffer::getShaderSourceCode(Mode mode, std::string cust · 84 unmodified lines
184192 return DEFAULT_DEPTH_SHADER;
185193 case EmissiveMode:
186194 return DEFAULT_EMISSIVE_SHADER;
195+ case UnlitMode:
196+ return DEFAULT_UNLIT_SHADER;
187197 case OcclusionMode:
188198 return DEFAULT_OCCLUSION_SHADER;
189199 case LightmapMode:

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t