Commit Graph
8 Commits
Author SHA1 Message Date
alteredq ad51a48fcd Added "depth_test" parameter to materials.
This is to be able to control depth buffer writing / testing on per geometry chunk level (before it was possible just to hack it on per scene level via exposed GL context).

Disabling depth test is useful for example for additively blended particles, handling of transparency or for having background textured quad.

Another option would be to have it on per object level, but then this could prevent different handling of objects with both transparent and opaque parts.

Also in this commit:

- more progress towards mesh vertex colors
- less matrix multiplications in render call
- fixed ugly bug in doubleSided / flipSided handling
- cleanup of materials
    - added a lot of missing stuff in debug strings and parameters handlers
    - normal and depth materials now have opacity parameter
    - wrote comments for non-obvious things
2011-02-11 19:58:58 +01:00
alteredq bc88bdb67b Refactored KERNEL_SIZE define out of convolution shader lib.
This is ugly, but allows to use different kernel sizes, making it useful not just for Gaussian blur (which is slow with large kernel).
2011-02-02 18:53:50 +01:00
alteredq aa8bdaea3d Moved film shader into ShaderUtils. 2011-02-02 18:31:04 +01:00
alteredq 84d1b582ae Moved textured quad screen shader into ShaderUtils. 2011-02-02 16:17:39 +01:00
alteredq 418a6da757 Moved convolution shader from example into ShaderUtils. 2011-02-02 14:15:28 +01:00
alteredq 6668440006 Cleaned bit postprocessing example code. 2011-01-16 14:35:17 +01:00
alteredq d50863908c Small improvements in postprocessing example.
Alternating convolution pass textures aspect ratio and using linear magnification filtering leads to less artefacts.
2011-01-16 11:51:56 +01:00
alteredq a03f714244 Added postprocessing example.
For this had to extend WebGLRenderer a bit:

- MeshShaderMaterial now can take non-specific float array uniforms as "fv1"
  (there is already "fv" type for array of 3-item-vectors, which probably should be renamed to "fv3" to be consistent)

- render method has yet another parameter "clear" for clearing newly set framebuffer (defaults to true).
  This is a bit hackish but it seems necessary to control this somehow. I didn't manage to replicate
  desired behavior just with autoClear.

- another dirty thing is accessing GL context from the application side:
    renderer.context.disable( renderer.context.DEPTH_TEST );

    This should be refactored somehow, wrapped in some API call.
2011-01-15 02:20:47 +01:00