A bunch of typo fixes after review

This commit is contained in:
samcake 2016-03-01 10:53:08 -08:00
parent e72035ee3d
commit 89920370db
7 changed files with 10 additions and 14 deletions

View file

@ -1,5 +1,5 @@
//
// debug.js
// ddebugFramBuffer.js
// examples/utilities/tools/render
//
// Sam Gateau created on 2/18/2016.
@ -10,8 +10,8 @@
//
var DDB = Render.RenderDeferredTask.DebugDeferredBuffer;
DDB.enabled = true;
oldConfig = DDB.toJSON();
DDB.enabled = true;
// Set up the qml ui

View file

@ -150,6 +150,6 @@ void Light::setAmbientMap(gpu::TexturePointer ambientMap) {
}
}
void Light::setAmbientMapNumMips(int numMips) {
void Light::setAmbientMapNumMips(uint16_t numMips) {
editSchema()._ambientMapNumMips = (float)numMips;
}

View file

@ -111,8 +111,8 @@ public:
void setAmbientMap(gpu::TexturePointer ambientMap);
gpu::TexturePointer getAmbientMap() const { return _ambientMap; }
void setAmbientMapNumMips(int numMips);
int getAmbientMapNumMips() const { return getSchema()._ambientMapNumMips; }
void setAmbientMapNumMips(uint16_t numMips);
uint16_t getAmbientMapNumMips() const { return (uint16_t) getSchema()._ambientMapNumMips; }
// Schema to access the attribute values of the light
class Schema {
@ -126,7 +126,7 @@ public:
Vec4 _spot{0.0f, 0.0f, 0.0f, 0.0f};
Vec4 _shadow{0.0f};
float _ambientMapNumMips{ 0 };
float _ambientMapNumMips{ 0.0f };
Vec3 _control{ 0.0f, 0.0f, 0.0f };
gpu::SphericalHarmonics _ambientSphere;

View file

@ -252,7 +252,7 @@ public:
class Schema {
public:
glm::vec3 _emissive{ 0.0f }; // No Emissive
float _opacity{ 1.f }; // Opacity = 1 => Not Transparent
float _opacity{ 1.0f }; // Opacity = 1 => Not Transparent
glm::vec3 _albedo{ 0.5f }; // Grey albedo => isAlbedo
float _roughness{ 1.0f }; // Roughness = 1 => Not Glossy

View file

@ -65,7 +65,7 @@ vec3 evalAmbientSphereGlobalColor(mat4 invViewMat, float shadowAttenuation, floa
<$declareSkyboxMap()$>
vec3 fresnelSchlickAmbient(vec3 fresnelColor, vec3 lightDir, vec3 halfDir, float gloss) {
return fresnelColor + (max(vec3(gloss), fresnelColor) - fresnelColor) * pow(1.0f - clamp(dot(lightDir, halfDir), 0.0, 1.0), 5);
return fresnelColor + (max(vec3(gloss), fresnelColor) - fresnelColor) * pow(1.0 - clamp(dot(lightDir, halfDir), 0.0, 1.0), 5);
}
vec3 evalSkyboxGlobalColor(mat4 invViewMat, float shadowAttenuation, float obscurance, vec3 position, vec3 normal, vec3 albedo, float metallic, vec3 emissive, float roughness) {

View file

@ -92,7 +92,7 @@ void DeferredLightingEffect::init() {
// Add the global light to the light stage (for later shadow rendering)
_lightStage.addLight(lp);
lp->setDirection(-glm::vec3(1.0f, 1.0f, 1.0f));
lp->setDirection(glm::vec3(-1.0f));
lp->setColor(glm::vec3(1.0f));
lp->setIntensity(1.0f);
lp->setType(model::Light::SUN);
@ -502,7 +502,6 @@ void DeferredLightingEffect::setupKeyLightBatch(gpu::Batch& batch, int lightBuff
batch.setUniformBuffer(lightBufferUnit, globalLight->getSchemaBuffer());
}
// if (_skyboxTexture && (skyboxCubemapUnit >= 0)) {
if (globalLight->getAmbientMap() && (skyboxCubemapUnit >= 0)) {
batch.setResourceTexture(skyboxCubemapUnit, globalLight->getAmbientMap());
}
@ -571,12 +570,10 @@ void DeferredLightingEffect::setGlobalLight(const model::LightPointer& light, co
globalLight->setAmbientIntensity(light->getAmbientIntensity());
globalLight->setAmbientSphere(light->getAmbientSphere());
// _skyboxTexture = skyboxTexture;
_skyboxTexture = (light->getAmbientMap() ? light->getAmbientMap() : _skyboxTexture);
// Update the available mipmap levels
globalLight->setAmbientMap((light->getAmbientMap() ? light->getAmbientMap() : _skyboxTexture));
// globalLight->setAmbientMapNumMips((_skyboxTexture ? _skyboxTexture->evalNumMips() : 0));
globalLight->setAmbientMap(_skyboxTexture);
}
model::MeshPointer DeferredLightingEffect::getSpotLightMesh() {

View file

@ -414,7 +414,6 @@ ShapeKey ModelMeshPartPayload::getShapeKey() const {
bool isTranslucent = drawMaterialKey.isTransparent() || drawMaterialKey.isTransparentMap();
bool hasTangents = drawMaterialKey.isNormalMap() && !mesh.tangents.isEmpty();
//bool hasSpecular = drawMaterialKey.isGlossMap();
bool hasSpecular = drawMaterialKey.isMetallicMap();
bool hasLightmap = drawMaterialKey.isLightmapMap();