Commit Graph
10 Commits
Author SHA1 Message Date
alteredq 771674d705 Refactored Loader parameters to allow optional separate paths for texture and binary files.
loader.loadAscii and loader.loadBinary now take just one parameter with following properties:

    - model (required)
    - callback (required)
    - texture_path (optional: if not specified, textures will be assumed to be in the same folder as JS model file)
    - bin_path (optional: if not specified, binary file will be assumed to be in the same folder as JS model file)

Example use:

    loader.loadBinary( { model: "model.js", bin_path: "path/bin", texture_path: "path/img",
                         callback: function( geometry ) { createScene( geometry ) } } );
2011-01-02 19:52:40 +01:00
alteredq ecad27eb11 Moved MeshPhongMaterial onto common shader builder machinery, ubershader is no more.
Code is still rough around edges (it can be made nicer), though it should already produce one-to-one results with ubershader.

Side-effect is that scene is no longer required as WebGLRenderer constructor parameter. Shader programs are now constructed upon first frame render and only then scene lights are examined.
2010-12-31 00:33:39 +01:00
alteredq 0fe464c97a Refactored uniforms cloning into separate file so that it can be reused also for MeshShaderMaterials.
Also changed MeshShaderMaterial demos to show how to use cloning. For these particular demos uniforms cloning is not really necessary as they use only one instance of shader material, but for example, if there were two normal mapped models in one scene, each model would need separate material with own uniforms.
2010-12-28 17:11:50 +01:00
Mr.doob 674613a7ab Yet some minor tweaks to the normalmap2 demo. 2010-12-27 01:26:08 +00:00
Mr.doob 3488a53798 Recompiled builds.
Re-tweaked normalmap2 demo.
2010-12-27 01:22:48 +00:00
Mr.doob ebaa3ae392 I knew it wasn't going to work. 2010-12-27 01:17:52 +00:00
Mr.doob 897a2938c5 Merged with alteredq's normal shader improvements.
Tweaked normalmap2 demo parameters.
2010-12-27 01:08:29 +00:00
Mr.doob 4a486f858a Added uNormalScale to normal shader.
Updated normalmap2 demo inverting the X/Y components.
2010-12-26 23:54:35 +00:00
alteredq 6e91de5d8a Added diffuse map to normal map shader. Changed Lee Perry-Smith demo to use normal map shader.
Diffuse map and ambient occlusion maps are now optional in normal map shader.

By default, both are disabled, so they need to be enabled explicitly like this:

    uniforms[ "enableAO" ].value = true;
    uniforms[ "enableDiffuse" ].value = true;
2010-12-26 03:03:28 +01:00
Mr.doob 3993d3d576 Added Lee Perry-Smith Normal-notyet-Map demo. 2010-12-25 20:35:07 +00:00