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
94 " }"94 " }"
95};95};
96 96
97static 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
97static const std::string DEFAULT_LIGHTMAP_SHADER{105static const std::string DEFAULT_LIGHTMAP_SHADER{
98 "vec4 getFragmentColor() {"106 "vec4 getFragmentColor() {"
99 " DeferredFragment frag = unpackDeferredFragmentNoPosition(uv);"107 " DeferredFragment frag = unpackDeferredFragmentNoPosition(uv);"
@@ -184,6 +192,8 @@ std::string DebugDeferredBuffer::getShaderSourceCode(Mode mode, std::string cust · 84 unmodified lines
184 return DEFAULT_DEPTH_SHADER;192 return DEFAULT_DEPTH_SHADER;
185 case EmissiveMode:193 case EmissiveMode:
186 return DEFAULT_EMISSIVE_SHADER;194 return DEFAULT_EMISSIVE_SHADER;
195 case UnlitMode:
196 return DEFAULT_UNLIT_SHADER;
187 case OcclusionMode:197 case OcclusionMode:
188 return DEFAULT_OCCLUSION_SHADER;198 return DEFAULT_OCCLUSION_SHADER;
189 case LightmapMode:199 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