-
Notifications
You must be signed in to change notification settings - Fork 250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Naive AO is ready for a first look! #96
Closed
Closed
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
0522743
naiveAO ready for first review
likangning93 6000cf5
added new files
likangning93 eae1712
added command line changes for AO
likangning93 375f969
eliminated texelPoints cache by raytracing the data in each texelPoin…
likangning93 ebe5471
changed some steps that were running over every primitive in the gltf…
likangning93 9efcfbd
addressed some pull request comments. cleaned up some comments and he…
likangning93 9db1fae
addressed some PR issues: style, test typos, normals should be transf…
likangning93 51ccfd1
addressed some PR issues: cleaned up AO specs and gltfPipeline integr…
likangning93 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev
Previous commit
addressed some PR issues: cleaned up AO specs and gltfPipeline integr…
…ation
- Loading branch information
commit 51ccfd1537263b2f14154b6b966ab0d97eabd814
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,18 +2,11 @@ | |
var Cesium = require('cesium'); | ||
var CesiumMath = Cesium.Math; | ||
var Cartesian3 = Cesium.Cartesian3; | ||
|
||
var fs = require('fs'); | ||
var path = require('path'); | ||
var clone = require('clone'); | ||
var loadGltfUris = require('../../lib/loadGltfUris'); | ||
var addPipelineExtras = require('../../lib/addPipelineExtras'); | ||
var bakeAmbientOcclusion = require('../../lib/bakeAmbientOcclusion'); | ||
var readAccessor = require('../../lib/readAccessor'); | ||
var Jimp = require('jimp'); | ||
var clone = require('clone'); | ||
var NodeHelpers = require('../../lib/NodeHelpers'); | ||
var readGltf = require('../../lib/readGltf'); | ||
|
||
var boxGltfPath = './specs/data/boxTexturedUnoptimized/CesiumTexturedBoxTest.gltf'; | ||
var boxOverGroundGltfPath = './specs/data/ambientOcclusion/cube_over_ground.gltf'; | ||
|
||
function cloneGltfWithJimps(gltf) { | ||
|
@@ -30,19 +23,12 @@ function cloneGltfWithJimps(gltf) { | |
image.extras._pipeline.jimpImage = originalJimp.clone(); | ||
} | ||
} | ||
|
||
return gltfClone; | ||
} | ||
|
||
describe('bakeAmbientOcclusion', function() { | ||
var boxGltf; | ||
var boxOverGroundGltf; | ||
|
||
var loadGltfUriOptions = { | ||
basePath: path.dirname(boxGltfPath), | ||
imageProcess: true | ||
}; | ||
|
||
var indices = [0,1,2,0,2,3]; | ||
var indicesBuffer = new Buffer(indices.length * 2); | ||
for (var i = 0; i < indices.length; i++) { | ||
|
@@ -196,38 +182,12 @@ describe('bakeAmbientOcclusion', function() { | |
}; | ||
|
||
beforeAll(function(done) { | ||
var loadModel2 = function () { | ||
fs.readFile(boxOverGroundGltfPath, function (err, data) { | ||
if (err) { | ||
throw err; | ||
} | ||
else { | ||
boxOverGroundGltf = JSON.parse(data); | ||
addPipelineExtras(boxOverGroundGltf); | ||
loadGltfUris(boxOverGroundGltf, loadGltfUriOptions, function (err, gltf) { | ||
if (err) { | ||
throw err; | ||
} | ||
done(); | ||
}); | ||
} | ||
}); | ||
var options = { | ||
imageProcess: true | ||
}; | ||
|
||
fs.readFile(boxGltfPath, function(err, data) { | ||
if (err) { | ||
throw err; | ||
} | ||
else { | ||
boxGltf = JSON.parse(data); | ||
addPipelineExtras(boxGltf); | ||
loadGltfUris(boxGltf, loadGltfUriOptions, function(err, gltf) { | ||
if (err) { | ||
throw err; | ||
} | ||
loadModel2(); | ||
}); | ||
} | ||
readGltf(boxOverGroundGltfPath, options, function(gltf) { | ||
boxOverGroundGltf = gltf; | ||
done(); | ||
}); | ||
}); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should only call |
||
|
||
|
@@ -331,7 +291,7 @@ describe('bakeAmbientOcclusion', function() { | |
count: new Array(4).fill(0.0) | ||
}; | ||
|
||
var bottomCenter = new Cartesian3(0.0, -0.99, 0.0); | ||
var bottomCenter = new Cartesian3(0.0, -1.0, 0.0); | ||
|
||
var texelPoints = [ | ||
{ | ||
|
@@ -364,7 +324,7 @@ describe('bakeAmbientOcclusion', function() { | |
var samples = aoBuffer.samples; | ||
|
||
expect(samples[0]).toEqual(16); | ||
expect(samples[1] < 4).toEqual(true); // randomized, but stratification should ensure this. | ||
expect(samples[1]).toEqual(0); // randomized, but stratification should ensure this. | ||
expect(samples[2] > 6 && samples[2] < 10).toEqual(true); // randomized, but stratification should ensure this. | ||
}); | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm just noticed, this area could be simplified by using
readGltf
if that works.