Skip to content
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

example using MeshBasicMaterial #16

Open
max-mapper opened this issue Apr 27, 2013 · 3 comments
Open

example using MeshBasicMaterial #16

max-mapper opened this issue Apr 27, 2013 · 3 comments

Comments

@max-mapper
Copy link

heya, i'd like to use something like this for wireframed flat color voxels (should render super fast):

  var material = [
    new CubeMaterial( { vertexColors: THREE.VertexColors, opacity: 0.5 } ),
    new THREE.MeshBasicMaterial( { color: 0x000000, wireframe: true } )
  ]
  THREE.SceneUtils.createMultiMaterialObject( cube, material )
@shama
Copy link
Owner

shama commented Apr 27, 2013

Take a look at mrdoob/three.js#751 Since multimaterials are not available anymore that util will create multiple meshes sitting on each other to fake it. So I bet just doing a flat texture with a 1px outline would be a lot faster.

@max-mapper
Copy link
Author

cool! using flat textures for now and it works pretty well:
blue
red

except it looks like the mipmaps are still messed up:

Screen Shot 2013-04-26 at 8 27 47 PM

@shama
Copy link
Owner

shama commented Apr 27, 2013

I tried a bunch of stuff to get a wireframe mesh overlaid on a surface mesh to no avail. Kept getting WebLGL errors. It would be a neat feature to have later though.

Re: the mipmaps, with a red texture next to a blue texture, eventually when the atlas is scaled down for a certain mipmap level the red and blue will have to merge. Giving you the above reddish blue in the distance. Since most of your displayed textures are blue, at that level the mipmap should really just be blue. You can manually set the mipmaps to achieve this, take a look at this example: https://github.com/mrdoob/three.js/blob/master/examples/webgl_materials_texture_manualmipmap.html#L125

FWIW, I'm planning on writing a mipmap module that will handle this in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants