Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/03/2018 in all areas

  1. Hello, I would like to experiment with GLSL shaders in Houdini viewport a bit, but I had very little success yet As a simple thing I would like to create a "matcap" shader, I have this shader in mantra and it works well, but it is quite simple logic in it and I would like to try it out in GLSL as well. I tried two approaches for creating glsl shaders: New Operator Type - SHOP Type - GLSL Shader This approach does not give me any results, the default shader has quite complex code and in the viewport I can see only white color. I tried to modify couple of variables in the code to at least change color from white to red, but unsuccessfully Reference ogl_glsl_shader parameter on a shader pointing to shader.prog file which references to shader.frag and shader.vert This gives me results in the viewport and works quite well, however I do not know how to reference node's parameter value to the GLSL variables. I created those files based on examples in $HFS/houdini/glsl //fragment shader in vec2 matUv; out vec4 color; uniform sampler2D tex; void main() { vec3 base = texture2D( tex, matUv ).rgb; color = vec4( base, 1. ); } First question: how can I reference parameter on the node to the tex variable in opengl? When googling I found some examples which implied that only creating string parameter tex should work, but when running their example files I never got any result in the viewport. Second question: is this the correct workflow? How could I achieve the same thing with New Operator Type workflow? Do you have some simple examples of those nodes with basic shading? E.g. sampling a texture, using constant color... Thanks for any clarification, Juraj
    1 point
  2. Thx for posting this AND answering at the same time :)))
    1 point
  3. You could use the pop proximity that will give you an attribute @nearestdist where then you could use popstream and do something like ingroup = @nearestdist >.1; then in that pop stream you can do anything that you want for example you can add a pop attract to get the particles attach to your geo. There is a few Master Classes around
    1 point
  4. Hi people! Wanted to share a small pipeline tool that helps much sharing node setups through chats and forums Here it is: https://github.com/pedohorse/hpaste the core is HPaste, when you press the shelf tool or shortcut ( Ctrl+Shift+Alt+C in NodeEditor by default) - it basically saves selected nodes as text, compresses it and uploads to one/several of online anonymous text clipboards, leaving you with a fancy small link, like this W4a2yx8TSvsQUdcO@WePaste in the clipboard, that you can paste in any messenger. Oh, and by default it also transfers nonstandard HDAs within the snippet. The one who received the link has just to copy it to his clipboard and wither press "HPasteWeb" on the shelf, or, much more convenient, press the shortcut ( Ctrl+Shift+Alt+V in NodeEditor by default) The links are expiring according to the web clipboard server's rules, that makes it useless to store these links for more than a week or two though. Here's a bit more text about it http://cgallin.blogspot.ca/2017/09/hpaste.html http://cgallin.blogspot.ca/2018/02/hpaste-update.html The HCollections is an extention of HPaste, it allows you to save your favorite node snippets into your github account (you just need to create an empty account if you don't have one) and have access to them through an analogue of the Tab menu. Also it allows you to create public items that anyone who add your collection(account name) to their list, will be able to access. You can change the access type any time as well. very handy to keep all your presets (and hdas as well, since they are stored within the snippet) in a "cloud". Here's an "article" about it with pictures http://cgallin.blogspot.ca/2018/01/hcollections.html I have a little plan where to develop this stuff: adding categories/subfolders for items, adding an easy way to temporary enable/disable some public collections , stuff like that. So I'm interested to know what do you think, shall i continue with it, or it needs much changes or what? I know some people found it very useful, but i'm still not sure it's fulfilling the public needs.
    1 point
  5. This should help you with the GLSL setup/boilerplate (point the material parm to the .prog file, vertex shader is basically a passtrough shader copied from somewhere in Houdini files). I've no answer for creating & rendering 100mil points on the GPU though, I haven't tried to create points in the vertex shader. Would be cool if Houdini had some intuitive ways of working with & displaying GPU data (something like a more wrangle-like OpenCL SOP with a direct hook/endpoint in the viewport so that the data doesn't have to come back to the CPU before being displayed). I included a test file using instancing as well, that approach seems to start to break down around 1-10mil points here. hou-glsl-instancing-example.zip
    1 point
  6. You just replace all non-vex stuff to vex standard syntax, it's usually easy: Vec3 → vector a.cross(b) → cross(a, b ) (iGlobalTime * 1.0) → @Time (uv.xy += r) → (uv.x += r; uv.y += r) or, in that case, (uv += r) And so on. You need know VEX to a certain extent or just ask on odforce. I have no clue about GLSL, so, I guess it not required. But it will be a plus, of course. Most tricky part is to understand how and where this code is executed. This one turned to be almost direct analog of any normal VEX code: iterate over all shading points and set some vector attribute. simple_plasma_shadertoy.hipnc
    1 point
×
×
  • Create New...