Houdini point wrangle

Thanks flowb, that’s kinda what I figured would be the bottleneck.

Regarding the GLSL mat, that’s the first pathway I went down. But as far as I can tell, if you assign a GLSL mat to a geometry node, it updates the geometry, but you can’t get the data back out of it as a SOP again.

Do you know of a way to convert a Geometry node with a vertex shader back into a regular SOP?

Right.

Now that you mention I don’t think I thought that through enough.

Even with the new Alembic and C++ SOPs in the experimental branch, you can’t freely mix CPU and GPU based operators. So if the intent is to be able to use CPU based SOPs freely in the chain then what you’re doing there makes a lot more sense.

I added a camera, lighting and render setup to your project, and the OP conversion actually seems like a negligible hit. at least at these low vertex counts.

I built a setup to slice SOPtoCHOP and chopTOtop rows into larger textures a while ago when i needed to do more than 16384 vertices on another project. I want to dig it up and try to work it into your setup to see how it behaves at higher vertex counts.

ok, good to know I’m on the right track.

I’d be interested to see your slicing method. That seems like it would be very helpful for larger point counts.

It’s just some math and replicators that trims through the chop data. sadly no special sauce.

in order for it work here, I was trying to make a complementary comp do reassemble the geometry after the glsl stuff. I seem to be having some issues getting the points back together right, but this at least adds support for more vertices.

I’m getting about 30fps at 130000 vertices. Looks like the Chop to Sops are causing most of the performance problems.
wrangle.12.toe (31.7 KB)

Cool, thanks. I’ll take a look and see if I get any luck with reassembling the geometry.

When you first made this, did the reassembly work? Is it just the GLSL stuff that’s messing that up?

the previous project used the slicing to get more input vertices. This was feeding a GLSL particle system, so there was no need to re-assemble the sliced up texture data into SOPs.

ok, that makes sense. I have an idea of how to reassemble then, I’ll give it a go

Good news!

I’ve gotten the splitting to work by embedding some of your nodes into the wrangle tox.

Basically, I use your row/column logic to drive a delete node inside a replicator. That deletes sections of the points of the incoming geo, which then have the GLSL applied to them individually. Then the resulting CHOPs are joined back together and used in the CHOP to SOP node.

This doesn’t really improve performance at all, but at least the polys are all coming out correctly now.

awesome.

if you post it i’d love to see the results. :slight_smile:

Yep, I updated the link on the first post of this thread

Another update with files on the first post:

I’ve now added variables that you can use and pass in to the GLSL code inside the wrangle.
The wrangle now accepts a CHOP input which can be filled with variable names / values. These names will get passed to your GLSL and you can use them straight in your wrangle code.

The tox will also now output your final code as well as any errors that may be reported.

Really important update. I’ve got this working now for any vector 3 attribute, not just position like before.

Take a look at the updated files on the first post of this thread to see how it all goes together.

I think every update I make to this is going to feel important.

Anyway, the tox has now been updated with 2 very important changes.

First, it works with any attribute that is a float, vec2, vec3, or vec4
Second, it fixes a major bug where attributes couldn’t depend on each other (like @Cd = @P)

Thank you so much for making this happen! I am also a transitional touch user from years of houdini heavy vex user.
However, anytime I try to changed WRANGLE_CODE in the text DAT, my touch crashed. I am wondering if you experienced the same issue before.

Much appreciated.

Hmm, that shouldn’t happen. But actually I haven’t tested this with the newest release, so maybe something has broken. I’m away from my computer for the next few weeks, but when I get back I’ll open this up and try to fix it.

What version of Touch are you using?

Can you send the crash .dmp files to support and we’ll find out why its crashing, it should not crash even if the project needs to be updated to work correctly.

Also, which specific build are you using, I will try to reproduce your crash.

Hello Ben,

Thank you for your response. I use 2019.15840 Educational license.
I kind of figured out a way to prevent from crashing: deactivated the “PROCESS ATTRIBUTES” dat execute DAT, unlink the “CODE FOR ATTR”, create a new one with “vex” code, link it back to the executeDAT and activate it again. But I have simplified the process into just sop - chop - top - pixel shader - chop - sop. I have attached a toe file. sopToChop.13.toe (10.0 KB)

Thank you for your reply. I am using 2019.15840. Please see the reply and .toe file above. I was translating a “pseudo 4D_transformation” pointwrangle into touch. The next step would be figuring out a “primitive wrangle” pipeline into touch.

@majinshaoyuindustry Any reason you aren’t using the latest build 2019.20140? (or some that is newer than 2019.15840).

Regardless if you found a workaround we are interested in fixing any crashes in the latest builds. If you can get it to crash in the latest build please send us the dump file.
Thanks!

Hi Ben,

Thanks for trying to diagnose the crash that the file is causing. I’m still away from my computer, but just wanted to give you a quick overview of my original file in case it helps.

Roughly, it takes in sop data, splits that into chunks small enough that a GLSL top can handle the number of vertices, and then processes attributes on all the vertices. Then it reapplies the attributes back to sops, and joins all the sops back together for final output