Tuning the proedural shader support to work with the current default: gamma corrected emissive

This commit is contained in:
samcake 2015-12-21 12:00:30 -08:00
parent 492572df45
commit ae124ebede
4 changed files with 4 additions and 4 deletions

View file

@ -35,6 +35,8 @@ void main(void) {
#ifdef PROCEDURAL #ifdef PROCEDURAL
vec3 color = getSkyboxColor(); vec3 color = getSkyboxColor();
// Procedural Shaders are expected to be Gamma corrected so let's bring back the RGB in linear space for the rest of the pipeline
color = pow(color, vec3(2.2));
_fragColor = vec4(color, 0.0); _fragColor = vec4(color, 0.0);
#else #else
@ -42,7 +44,6 @@ void main(void) {
vec3 coord = normalize(_normal); vec3 coord = normalize(_normal);
vec3 texel = texture(cubeMap, coord).rgb; vec3 texel = texture(cubeMap, coord).rgb;
vec3 color = texel * _skybox._color.rgb; vec3 color = texel * _skybox._color.rgb;
// vec3 pixel = pow(color, vec3(1.0/2.2)); // manual Gamma correction
_fragColor = vec4(color, 0.0); _fragColor = vec4(color, 0.0);
#endif #endif

View file

@ -54,7 +54,6 @@ RenderDeferredTask::RenderDeferredTask() : Task() {
_jobs.push_back(Job(new FetchItems::JobModel("FetchOpaque", _jobs.push_back(Job(new FetchItems::JobModel("FetchOpaque",
FetchItems([](const RenderContextPointer& context, int count) { FetchItems([](const RenderContextPointer& context, int count) {
context->getItemsConfig().opaque.numFeed = count; context->getItemsConfig().opaque.numFeed = count;
auto& opaque = context->getItemsConfig().opaque;
}) })
))); )));
_jobs.push_back(Job(new CullItemsOpaque::JobModel("CullOpaque", _jobs.back().getOutput()))); _jobs.push_back(Job(new CullItemsOpaque::JobModel("CullOpaque", _jobs.back().getOutput())));

View file

@ -141,7 +141,5 @@ void ToneMappingEffect::render(RenderArgs* args) {
batch.setUniformBuffer(3, _parametersBuffer); batch.setUniformBuffer(3, _parametersBuffer);
batch.setResourceTexture(0, lightingBuffer); batch.setResourceTexture(0, lightingBuffer);
batch.draw(gpu::TRIANGLE_STRIP, 4); batch.draw(gpu::TRIANGLE_STRIP, 4);
args->_context->render(batch);
}); });
} }

View file

@ -40,6 +40,8 @@ void main(void) {
#ifdef PROCEDURAL_V1 #ifdef PROCEDURAL_V1
specular = getProceduralColor().rgb; specular = getProceduralColor().rgb;
// Procedural Shaders are expected to be Gamma corrected so let's bring back the RGB in linear space for the rest of the pipeline
specular = pow(specular, vec3(2.2));
emissiveAmount = 1.0; emissiveAmount = 1.0;
#else #else
emissiveAmount = getProceduralColors(diffuse, specular, shininess); emissiveAmount = getProceduralColors(diffuse, specular, shininess);