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

Setting wireframe rendering on material instead of geometry #139

Closed
simonharrisco opened this issue Jan 23, 2019 · 2 comments
Closed

Setting wireframe rendering on material instead of geometry #139

simonharrisco opened this issue Jan 23, 2019 · 2 comments

Comments

@simonharrisco
Copy link
Collaborator

Currently you set the primitive when you define the geometry
eg:

renderer.geometry({
  GeometryComponent,
  primitive: graph.ctx.Primitive.Lines
})

Is this the best place to declare this? Would it made more sense to have it set within the material?
Is this a more logical place to put it as materials effect how things look?

Threejs does this

material = new THREE.MeshBasicMaterial({
    color: 0xff0000,
    wireframe: true
});

BabylonJs does this

var myMaterial = new BABYLON.StandardMaterial("myMaterial", scene);
myMaterial.wireframe = true;

This reasoning breaks down if the primitive type given in the geometry also supports things like TRIANGLE_STRIP,TRIANGLE FAN ETC.

What does everyone think?

@dmnsgn
Copy link
Member

dmnsgn commented Jan 25, 2019

To sum up, should the drawing primitive be tied to geometry or material. Wireframe is a bit different than just setting the primitive to LINES. Three.js has the primitive on the mesh level: https://threejs.org/docs/#api/en/constants/DrawModes

It does affect how things look and is related to a program so I tend to agree with moving it in the Material which is already handling blend, depth, culling...

@dmnsgn dmnsgn added this to the 3.0.0 milestone Jan 25, 2019
@dmnsgn dmnsgn removed this from the 3.0.0 milestone Oct 19, 2022
@dmnsgn
Copy link
Member

dmnsgn commented May 5, 2023

v4: better off using a material type while we see if gl.Lines needs to be abstracted in its own renderer #311 (comment)

@dmnsgn dmnsgn closed this as completed May 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants