Hi all,
Came upon a very basic question that I can’t quite figure out. I want to manipulate source SOP (mesh) in a way that outputs a SOP. Kind of like how the Noise SOP does it, but I want it to be a custom formula.
For example, make a ripple effect by setting z value of mesh based on sin(distance from origin) That sort of thing.
I think I could figure out how to do it with a GLSL top by inputting a circular ramp to act as a depth map, however I can’t figure out how to do it and end up with a SOP?
Is this even something that is worse pursuing, or would this be CPU side math?
Other option would be to use transform feedback and store positions of the mesh in a TOP, but not sure which approach would be better…
Thanks for ideas!
Hi mate,
You can create formula either by chops or in chop or sop script.
I uploaded example using chops specially for you
Its point proximity decayed sine wave noise across the geometry
Side note, we need more people to share their GLSL solutions
and create super simple examples or even tutorials using GLSL in touch.
hope my file will help you.
Barak.
water_melon_control_sop_noise.1.toe (7.61 KB)
OK awesome, thanks! That’s really great. Would you consider this an efficient approach?
I don’t quite get how the SOP pipeline works. Are they essentially VBOs? Do they require a seperate render pass for each vertex operation?
Most of my experience thus far in graphics programming tells me that affecting vertices probably isn’t super quick unless you are doing it on the GPU.
RE: GLSL samples. What kinds of things would you like to see? Admittedly I’m also a bit green in that regard, but modern OpenGL and GLSL has been an active point of study personally and otherwise really love the TD workflow. Might be a good place to try stuff out.
Hey that was really helpful!
Managed to make what I was seeing in my head pretty easily off of your example. I’ll attach what I came up with.
Here’s a clip: [url]Nate Turley on Instagram: "Messing with some space times."
Want to make the texture mapping work with the circular ramp better but I can figure that out later.
Definitely chugged slowly @~10,000 vertices. Def not efficient at that point as expected. Better to store positions in 3D Texture and use GLSL for affecting many vertices.
Thanks again!
deformMesh.toe (7.62 KB)
This is a perfect opportunity for GLSL.
I like to start with a Phong MAT. Then in the RGB pane I export it to a GLSL Shader with a Vertex Shader Text DAT and a Pixel Shader Text DAT. Then I make modifications to both of those DATs and apply the GLSL shader to geometry.
In the Vertex Shader, you’ll want to pass a uniform for time and maybe some other parameters. I’ve chosen to also pass an integer describing the number of ring cycles in the grid. In the vertex shader, do some math operations on vertices. It’s helpful to always normalize your calculations so that they end up -1 to 1 or 0 to 1. When you have numbers in this range, it’s easy to pass them to other GLSL built-ins like sin(), smoothstep(). You can also use them to manually assign a vertex color, as I have done.
Then in the pixel shader, you can grab the color from the vertex, ignore everything going on with lights, and assign that color to the pixel.
For GLSL I recommend shaderific.com/glsl-functions/
GLSL_Wave.1.toe (7.95 KB)
Thank you DavidBraun !
We need more posts like yours.
Please be active at the Facebook group too.