Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Wireframe via Shade?

As an initial challenge using Shade, I wonder if someone could create a wireframe effect? This was done using a shader here (https://codea.io/talk/discussion/6955/3d-obj-model-importer-for-potential-future-inclusion-with-codea-now-with-wireframe-mode). Could we replicate that type of effect in Shade?

p.s. Is the Codea forum the place for Shade discussion? I would think so, but just want to be sure.

Tagged:

Comments

  • SimeonSimeon Admin Mod
    Posts: 5,054

    This seems like a good question, I can't think of a way off the top of my head. Tagging @John because I'm sure if there's a way to do this currently, he'll know.

  • JohnJohn Admin Mod
    Posts: 579

    Hi @iam3o5am

    Wireframe shaders can be done in Shade. I had to add a new node though so you'll have to wait for the next update. I used the technique described in this tutorial: https://catlikecoding.com/unity/tutorials/advanced-rendering/flat-and-wireframe-shading/

    I've also added a new example that performs this effect. It should be possible to drop into Codea with one caveat. For this to work the mesh has to have unique vertices for every triangle. Some smooth shaded models share vertices to make the mesh more efficient to render. I've added a function - craft.model:split() which lets you convert a model to have unique vertices, which will make it work.

    Here is what it looks like in shade. You can combine this effect with lit and unlit shaders and use it on any input you like.

  • Excellent work @John ! Thanks for giving that a go. I’ll be digging in to what you have in Shade already, and look forward to updates and new tutorials.

  • SimeonSimeon Admin Mod
    Posts: 5,054

    @iam3o5am latest build of Shade beta lets you do this, @John even included it as an example

  • @Simeon Great, going there now...

  • @John, just want to say thanks again for including the wireframe example! To be able to go through the Shade nodes and see how you did it, and then compare that to the catlikecoding tutorial that was the inspiration, is all very instructive.

    On a separate note - is the environment used in the Shade model preview (bottom right) easily reproducible in Craft? I’m sure its just a matter of getting the (sun) lighting correct and use Cameras - but just wondered if you already had it. I’m working through different algorithms for creating spheres (for my own knowledge - of course, they are built into Craft), and want to be able to preview 3D entities in Craft, a la Shade preview. In the built-in Craft examples there are a few that are close, but the Shade preview setup is exactly what I want.

  • JohnJohn Admin Mod
    Posts: 579

    @iam3o5am I'll see if I can adapt the Shade preview so it works in Codea.

  • Posts: 81

    Hey @John , just wanted to ask again about the Shade preview in Codea. I’m sure you have other priorities, but thought I’d ask.

    (To deflect a little from my pesky resquest...)...I am very excited about Shade. Just wondering if this was a new project from the ground up, or were you able to leverage some code for the Codea baseline?

  • JohnJohn Admin Mod
    Posts: 579

    @iam3o5am Thanks for reminding me as this slipped my mind. The shade node UI and preview panel are actually running within the Codea runtime and written in Lua. The sidebar, menu and file browser are all UIKit native views and controls.

  • JohnJohn Admin Mod
    Posts: 579

    Here is the material preview boiled down into a Codea project. There is no camera interaction due to it being dependant on much larger chunks of code within Shade. It should be fairly either to hack it in using OrbitViewer or something similar. Hope this helps!

  • Posts: 81

    Thanks @John I'm hoping to get on this asap. I'll let you know how it goes!

Sign In or Register to comment.