Jump to content

jonklein

Members
  • Content count

    3
  • Donations

    0.00 CAD 
  • Joined

  • Last visited

Community Reputation

0 Neutral

About jonklein

  • Rank
    Peon

Personal Information

  • Name
    Jonas
  • Location
    Berlin
  1. Thank's Konstantin, those ressources are incredibly helpful! Now I got it to work. The basic problem was that I had to get the light's position into the material builder not via a constant but as a parameter. That is where your approach differed from what I was working with. However, to get it to work properly I also had to invert the z-coordinate.
  2. Hello! I'm working on a custom toon shader. As a basis I want to use the lambert lighting model as described in the tutorial embedded below. To test this I created a very simple scene with a sphere placed at the origin, a point light and a material with the material builder applied to the sphere (see image below). Now, here's the problem: The shading of the sphere is incorrect as soon as the point light has negative coordinates. It seems as if the surface_global's P and N are expressed in a different space compared to the point light's position. This happend with Mantra as well as Redshift (where I used the same setup as in the video below, apart from getting the light's position through a constant and channel references). Am I wrong to assume that P is the world position of the current point being shaded and N is it's normalised normal? Is this the wrong way to get the light position into the shader? I spent some time testing and searching on the internet but I couldn't find anything that clarified these quesitons sufficiently for me. custom_lambert.hipnc
  3. Hello houdini-community! I'm trying to create an outline filter using vex. You can find the code below, I copied it from the SideFX-Forum. I put the code in a vfl file and compiled it to a hda-file using vcc. Then, I imported the HDA into a simple project, got a Render compositing node and wired its output into my custom outline-node. As a result I just get a completely black image. I've looked into the components of the matrix3 that ninput returns and they are always just 0, although my render-output has almost no black pixels. Is there anyone who has an idea what I might be missing? Any help is highly appreciated! Edit: I fogot to mention that I tried to get the same result using a Convolve Compositing Node with the same kernel as used in the code. That works. However, this is just an experiment for me I really want to know how to implement such a filter using VEX. cop2 outlines(float effect = 1) { matrix3 kernel; matrix3 pixels; vector4 col; float result; int i, x, y; col = 0.0; // this builds a kernel with -1/8 in all elements but the center, which is // +1 (an edge detect kernel, sums to 0); for sharpen, use effect+1 // for the center pixel kernel = 0; for(x=0; x<3; x++) for(y=0; y<3; y++) setcomp(kernel, -effect/8, x,y); setcomp(kernel, effect, 1,1); // iterate over all components in the current plane (PL) for(i=0; i<4; i++) { pixels = ninput(0, PL, 0, i, IX, IY, FR); // sum the results of the kernel x pixels result = 0; for(x=0; x<3; x++) for(y=0; y<3; y++) result += getcomp(pixels,x,y) * getcomp(kernel,x,y); setcomp(col, result, i); } assign(Cr, Cg, Cb, C4, col); }
×