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
8686 _emissiveShader = gpu::ShaderPointer(gpu::Shader::createProgram(VS, PSEmissive));
8787
8888 gpu::Shader::BindingSet slotBindings;
89+ slotBindings.insert(gpu::Shader::Binding(std::string("normalFittingMap"), DeferredLightingEffect::NORMAL_FITTING_MAP_SLOT));
8990 gpu::Shader::makeProgram(*_simpleShader, slotBindings);
9091 gpu::Shader::makeProgram(*_emissiveShader, slotBindings);
9192
@@ -151,6 +152,8 @@ void DeferredLightingEffect::bindSimpleProgram(gpu::Batch& batch, bool textured, · 59 unmodified lines
151152 // If it is not textured, bind white texture and keep using textured pipeline
152153 batch.setResourceTexture(0, DependencyManager::get<TextureCache>()->getWhiteTexture());
153154 }
155+
156+ batch.setResourceTexture(NORMAL_FITTING_MAP_SLOT, DependencyManager::get<TextureCache>()->getNormalFittingTexture());
154157 }
155158
156159 void 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