Skip to content

Add shading to SphereVisual - #1578

Merged
djhoese merged 2 commits into
vispy:masterfrom
GuillaumeFavelier:sphere_visual_shading
Apr 29, 2019
Merged

djhoese merged 2 commits into
vispy:masterfrom
GuillaumeFavelier:sphere_visual_shading

Conversation

@GuillaumeFavelier

Copy link
Copy Markdown
Contributor

What does this implement/fix?

The goal of this PR is to enable the shading capabilities of the vispy.visuals.SphereVisual.

Additional information

Some tweaking might be needed, tell me what do you think?

@kmuehlbauer

Copy link
Copy Markdown
Contributor

@GuillaumeFavelier LGTM so far. I'm a bit unsure with respect to the gl_state.

In MeshVisual it is set to self.set_gl_state('translucent', depth_test=True, cull_face=False) and in SphereVisual it is set to self.mesh.set_gl_state(polygon_offset_fill=True, polygon_offset=(1, 1), depth_test=True). @rougier Does the second call override the first settings? Or does this make sense?

I checked with a slightly altered example/basics/scene/sphere.py and it works quite well (flat and smooth shading).

@rougier

rougier commented Feb 15, 2019

Copy link
Copy Markdown
Contributor

@kmuehlbauer I'm not sure why the polygon_offset_fill and polygon_offset are set. Those are used when you want to draw something over something else. Typically, this is used to draw the border of a cube (first you draw the filled cube, then the outline)

@kmuehlbauer

Copy link
Copy Markdown
Contributor

@rougier The SphereVisual draws a meshed sphere. I think it is to see the mesh structure. So if you do not see any problems using that way of setting gl_state, we can move forward.

@kmuehlbauer

Copy link
Copy Markdown
Contributor

As @rougier seems fine with it, we could move forward. @djhoese Did we have this windows error before? Seems related to sdf_text.

@djhoese

djhoese commented Feb 20, 2019

Copy link
Copy Markdown
Member

I'm starting the appveyor tests over again for sanity sake. No I have not seen this error before.

@djhoese

djhoese commented Feb 20, 2019

Copy link
Copy Markdown
Member

@kmuehlbauer is this branch up to date with your recent changes to master and the CI environments?

@kmuehlbauer

Copy link
Copy Markdown
Contributor

It's everything in besides the Klein bottle example.

I did not change appveyor setup.

@djhoese

djhoese commented Mar 1, 2019

Copy link
Copy Markdown
Member

@GuillaumeFavelier do you think you could merge current master in to your branch? I think I've fixed the Windows failures.

@GuillaumeFavelier

Copy link
Copy Markdown
Contributor Author

yeah, sure. I'll do it right now.

@djhoese djhoese left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@djhoese
djhoese merged commit 6525f15 into vispy:master Apr 29, 2019
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

Successfully merging this pull request may close these issues.

4 participants