History

Introducing the Normal fitting algorithm for better normal in the deferred buffer

Sam Gateau committed 11 years ago

Commit 95682e61 parent a4f105f8 files · +46 −2Browse files

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

Unified · Split

libraries/render-utils/src/DeferredLightingEffect.cpp+3−0
@@ -86,6 +86,7 @@ void DeferredLightingEffect::init(AbstractViewStateInterface* viewState) { · 85 unmodified lines
86 _emissiveShader = gpu::ShaderPointer(gpu::Shader::createProgram(VS, PSEmissive));86 _emissiveShader = gpu::ShaderPointer(gpu::Shader::createProgram(VS, PSEmissive));
87 87
88 gpu::Shader::BindingSet slotBindings;88 gpu::Shader::BindingSet slotBindings;
89 slotBindings.insert(gpu::Shader::Binding(std::string("normalFittingMap"), DeferredLightingEffect::NORMAL_FITTING_MAP_SLOT));
89 gpu::Shader::makeProgram(*_simpleShader, slotBindings);90 gpu::Shader::makeProgram(*_simpleShader, slotBindings);
90 gpu::Shader::makeProgram(*_emissiveShader, slotBindings);91 gpu::Shader::makeProgram(*_emissiveShader, slotBindings);
91 92
@@ -151,6 +152,8 @@ void DeferredLightingEffect::bindSimpleProgram(gpu::Batch& batch, bool textured, · 59 unmodified lines
151 // If it is not textured, bind white texture and keep using textured pipeline152 // If it is not textured, bind white texture and keep using textured pipeline
152 batch.setResourceTexture(0, DependencyManager::get<TextureCache>()->getWhiteTexture());153 batch.setResourceTexture(0, DependencyManager::get<TextureCache>()->getWhiteTexture());
153 }154 }
155
156 batch.setResourceTexture(NORMAL_FITTING_MAP_SLOT, DependencyManager::get<TextureCache>()->getNormalFittingTexture());
154}157}
155 158
156void DeferredLightingEffect::renderSolidSphere(gpu::Batch& batch, float radius, int slices, int stacks, const glm::vec4& color) {159void DeferredLightingEffect::renderSolidSphere(gpu::Batch& batch, float radius, int slices, int stacks, const glm::vec4& color) {

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