Houdini Algorithmic Live #095 - Pixel Art Generator

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello hello so uh it's 11 p.m in japan time i'd like to start the live stream for this week i couldn't do the last week so those this will be um the 95th episode for houdini algorithmic life and the topic for today is to create a system in houdini to generate a 2d pixel art from 3d geometry as an input hey and i am not going to use any kind of shaders for this tutorial but i'm just going to use hops and a little bit of cups to generate 2d pixels in or on a plane so if you can see this this is actually a plane geometry with a dot being colored so each of the dots represents the face of the grid and those faces are colored as a pixel to draw this such uh image and originally it comes from a 3d geometry which looks like this so first thing i do is to create a 3d geometry then pixelize it somehow using some kind of a pretty straightforward system now in order to do that i am not going to use any lighting system in houdini meaning being used for mantra or any kind of rendering engines since they are for a shade they are florida rendering systems or shading systems and since i am not going to use any shaders for this one which probably i should do and if you really want to use this for production in real time i think the best way is to use shaders after all but my purpose here is to just practicing my vex or algorithmic design method in a surface context so i'm going to use effects mostly to reproduce what you can do what you probably can do in shaders in surface level so in order to do that first first of all i need to visualize this kind of material in 3d geometry without using any shaders so instead i'm going to use kind of a so-called vertex vertex based shadings you using just coloring each of the vertex with a specific colors picked up from the material okay then it'll be much easier for 2d plane to pick up the image when projected on the 2d plane then draw this kind of pixel image somehow so that's pretty much what i'm gonna do for today so it's pretty straightforward and i'm not sure what's the benefit of using uh creating this and sops after all but um at least you could learn the basic principle in order to convert a 3d 3d image to a 2d image into pixelized image which you can easily be transferred you can easily transfer it to a shader shader languages any kind of shade languages like opengl or anything so as a basic principle using softs might make sense because you could easily see what's happening while you are editing the geometries or the images okay so that's what i'm going to do today and i am also going to import external color palette which i have created uh by myself i mean export it from some of the photo editing softwares which are something looks like this which looks pretty small but actually what this is is a pixel based color palette if you scale it up looks like these so these colors are going to be used in order to colorize these object which can be changed through some sliders like these like that there's even a color palette for a game boy which only had a green [Music] images or four types of greens which could be really interesting and you can also change the the lightness the brightness or the darkness of the scene by creating like kind of a pseudo lighting system for yourself in order to light up the geometry which i am i'm only going to create a directional light like lighting here which is enough for testing if you are interested in this kind of system then you can create more types of lightings afterwards there's also a fresnel for more brightness on the edges you could also change some border border thickness like if you make it zero there's no border on the the geometries if you create some borders you see some kind of edges on the outline which you probably might see a lot in 2d related games okay and the smoothness of the water you can create kind of a gradient motors using the sliders the margin is to crop the plane overall plane and so on and you can of course you can also change the resolutions of the pixels if you make it really small you can have a really high image high res image if you make it really large you can make it really low res but still can see some kind of image so that's what i'm gonna do today creating this kind of a system to test out how you can convert a 3d geometry from to 2d image like this okay well i hope you find it interesting and if you have any like comments or feedback or anything please do all right so let's do this from scratch okay first of all let me save this to today's folder so this is 90 fifths all right so first thing first i am going to create a basic lighting system without using any of the lighting the existing lighting system in hoodie okay so i'm gonna make it really simple i'm just gonna use like create a simple directional light system to shade the geometry the given geometry right using small vector mathematics right so test let's test out with the simple geometries like sphere okay let me delete this and recreate the geometry node hello everybody thanks for coming at this late noticed okay first thing first since i'm going to use a vertex based shading each of the worked vertex has to have this material the material colors so more vertex you have more high-res um texture you can show up on top of the geometry so let's given a decent number of vertex to a given geometry which is not might not really be necessary if it's um just a single color but would make sense if you are using like texture mapping to this one later so i'm gonna give a 50 to the frequency of the sphere if it's not sphere you could always use something like subdivide to create a high res okay and that might be a better way to control the resolution so let's give a 10 to this sphere and give sub divide and make this depths as a parameter shall we and i think i would like to triangulate instead of having quad so let's make this open subdiv loop then i'm going to create a controller node uh the neural node named as controller to gather all the parameters that i want to control throughout this project okay so first of all i'm gonna name the i'm gonna create the integer parameter called shape in order to change the type of shapes currently i have only one shape which is sphere but later i'm gonna try and would like to try out many other geometries all right so and the subdiv number or subdiv iteration so it's or let's call this res from 0 to 10 is fine i think maybe 10 is too much let's keep it to 5. okay so for the shape i'm going to create a switch node then color this blue and copy this shape parameter to this one okay so that you can switch between different geometries then i'm going to copy this resolutions parameter to subdiv depths so that you can now control the resolution of the geometry well that that was too much maybe three looks fine maybe too much keep it to two for now okay now let's create some seido lighting system well right now i am using a default light setup from houdini which you which is given by quick clicking this normal lightings but instead i'm going to turn off that default lighting by clicking this one disable lighting so that you can see how it really looks when you have projected to the 2d plane so currently it is all matte but the things that you really want to do now is to light up this sphere somehow to make some to be able to see some depths so i am going to create some new node here which i'm going to called as light and i'm also going to create a let's call this uh wait a minute in order to control the uh in order to create the light uh and i'm like to create a directional light so i'm going to use the control node to give a icon for the null node so let's see which one seems to work circle no well no mate might be okay plane nolan circle custom okay i will go within this new here and let's go inside okay actually i just need like a single line to define the direction of the light so let's make this custom and how can i convert a line to this customer i think i haven't oh wait let's use axis okay this should be okay so i'm going to use this axis to display this control and i'm going to call this directional light all right and what i'm going to use is the direction of this axis going into forward direction which in this case probably in x direction right now or i can just create it um attribute create and let's call directional or maybe just set it as normal and set as vector to a x direction right so the red axis or red direction is going to be the direction for the directional light okay and now you can move this anywhere you want what's that by using i don't know transform or something also you can manually rotate it the position doesn't really matter for the directional light because this is the infinite light just to avoid being hidden by the original geometry which is this one okay all right so somewhere like this and maybe this is too small so let's give us bigger things okay something like that so the red direction is currently the directional light and let's try to use this to light up or shade this ball first of all okay so all right now before doing that i would like to also color this ball with the initial like mapping which could be from the textures or which could be just a single color anything you want but let's try to use some textures so that we can it could be really flexible okay so let's look for some kind of textures which it could be anything to test let's see i'm going to search for it and google image which could be anything so let's make this simple like wood or something something like this which could be good enough okay let's save this and let's save this to a download or let's save this to this place which is is this png i'm not sure webb okay so originally this is what p so i gotta convert this to something houdini can read all right let me convert this back to png all right then now as i said i have to map the image as a vertex color so instead of using like normal material i'm going to use a map attribute map attribute from map to import the texture and let's give let's load up this wood now i think i need to load i think i need to create the uv as well so let's do that by using any kind of uv mapping system anything is fine something like uv flatten okay which looks how does it look like uv quick shade okay don't really see it something to do with this one so instead of this one i'm gonna use uv project to use a polar okay that looks good okay now using these uvs you'll be able to import the vertex color like this and i don't really want to show up the uv so let's turn this off now it still is not that high res yet as you can see so if you want to make it more high-res it doesn't really matter because you're going to convert it into 2d pixel later so a lot of the details that's gone is going to be thrown away but this looks nice with the resolution of four which might be tons of vertices but let's go with this okay looks good looks new nice now and let's turn uh let's connect this to a directional light shadings to give a little bit of uh directional light shadings so first of all i would like to get the direction from the second input which is this one okay so which is a normal direction from the point so directional light direction is something like this okay now that i now that you have the direction it's time to [Music] wait a minute after i have rotated the object that's normal going to be uh rotated as well yep it did yeah okay that's good so but the length is not equal to one so let's first normalize it then what i'm going to do is to calculate the dot product between each of each of the points normal direction then use that to define how it's going to be shaded so you do need a normal direction for each of the point on the sphere let's create that all right so dot val is dot product between the current normal direction and the directional light now if it is negative meaning so this is the directional light and this is the normal so the the point the normal direction between this one and this one gives you a negative value for a dot product which in this case should be the brightest position okay for the back side like this one where the directional light direction and the normal direction is facing the same way this should be the darkest so but in the top the result of the dot product is equal to one so keep that in mind let's create some remapping value shading value is equal to fit one one which is for the dot product and let's give it so if it's negative one that will be brightest so let's make it one to one point zero if it's positive one then that'll be the darkest so let's make it zero and let's try to use this value to create the shadings or create some gradations to this color map the easiest way is to just multiply it to the current color which in result you should be able to see some gradient value from bright to dark and if you look at the direction looks correct okay now that is the easiest way to do and what i would like to do now is to control the amount of brightness in the darkness and probably also what would like to control how it affects the how the how the dot product will affect the brightness overall so if you can change this to three the the maximum brightness will be higher which makes the face facing to the directional light brighter and if you make the darker value something like negative 3 you see tons of places become really black or just black because it's going to be if you multiply a value under 0 to the color it'll always be black so that's the things you would like to control so let's give some parameters for these dark but instead of doing this at this point i'm gonna do it after i have mapped into zero two one which is which you can call it as normalized let's remap this out side or next and the next line using fit zero one for the shading to between dark to bright okay so for the darkness or for the brightness let's skip get the range from -3 to i know three or five minus two to five i'm not sure what's the best range let's keep that i'm gonna stay with zero to one for now and in between this uh fit one one and fit zero one i'm also going to create some curve mapping for this brightness using ch ramp to control the control how much you brightness you have or how much darkness you have if it's just if it's not linear for the dot product so if you do this you have more darker areas if you do this you have pinpoint bright areas which in reality might make more sense okay like that then you can tweak more brightness like this and that well you can try out in a lot of stuff with these and just this is just one example in order to control or in order to create the sado lighting systems without using using any default shading system all right so let's go with this one now and next thing that i would like to do here after the lighting system is to try out uh first of all mapping into a 2d pixels at this moment then we could add those other rich features like borders or fresnel or something like that but first thing first let's try to map this into 2d to see the result at this moment so that we know where we are right now okay so let's give some grouping all right let's save this and let's see so the way that i'm going to make this to the pixel i'm going to show how in sketch first third thing first okay so consider this is a camera and this is an object and you are looking at the object like this and the only things you want to visualize as 2d is the one that you are really seeing from the camera which is this part right and what you want to do is to convert this part into a 2d from a 2d camera all right so what you need to do is to map this image into 2d or you could say project this image into 2d using a projection matrix so called and there are some easy way to do this in houdini using a bunch of effects functions so that's what i'm going to show you how you can project 3d image from specific camera even with aperture or focal length to a flattened 2d image now that might be the main like things that i could talk teach you for this setup i guess all the other thing is pretty easy for anybody else to implement all right so in order to map this into 2d i'm going to look at each of the point and calculate its position based on the current camera now i don't really have a camera right now so let's create the camera first at this position right and let's lock away i think i made two and let's set this to camera one lock the camera so that the camera position and direction wait it's going to be follow where i'm looking at on the viewport okay so let's say that i would like to flatten this view okay and things that you need from the camera is this position rotation as well as the resolution the aspect ratio in this case and also a focal length aperture near clipping fog clipping and so on the all those informations are necessary in order to project this image onto 2d plane to exactly project this image that you're seeing from the camera okay so remember that and let's try to create that function i'm gonna call this camera projection and let's write this down first thing first i need to access the camera information so let's give a parameter in order to define the camera path okay now i think we should be chs string string string or it could be operator path so let's give operator path and name this cam path and accept now let's select the camera that you want to use it for flattening or projection and let's try to get all those information that you really need to project so first thing first uh position and direction so first of all i'm going to get the the camera matrix using the function called op transform so matrix cam matte is equal to all p transform op transform will be able to get the transformation matrix from the path okay and from the matrix you could retrieve the position and the direction using a crack transform so vector first of all let's get the position by using crack transform and the matrix to crack the transform matrix now there are a bunch of parameters so what was the c okay so c returns to translate one returns to rotate four so in order to get the positions you use zero for the c so zero zero zero the pivot pivot could be a zero zero zero and uh pivot rotate i think i can just skip it so like probably i could use the second parameter set so matrix x form is this one can mat so zero zero zero set zero zero zero and that which should give you the camera positions let's check if we look at it can pause so here it is so this should be the position for the camera minus one point eight one and one point minus one point six let's check yeah it's correct so that is good now let's also get the direction for the camera now the actual direction is toward the center from the camera center to the the center of the target now the target currently is not really defined but maybe there are some informations in camera node not sure so we don't really know where the target is but you could get the um the actual camera direction by using the same crack transform but changing the third option to 104 but actually that's not the direction that i want but actual directional vector that i want is from the camera center point to each of the vertex okay that's the actual direction that i want in this case in order to [Music] well maybe in this case i don't really need that but just in case as a template it might be better to give it it so i'm gonna call this cam direction is equal to a normalized at p minus cam plus now if you only looking for the one center direction to the target then instead of writing like this you could say or let me check rotate so zero zero zero zero zero one set zero zero zero which in this case just gives you a rotational vector which might be in euler so first of all let's check what the value looks like and if it's just the euler angles for x y and z axis then we have to convert it into actual directional vector value okay so looks like a euler angle 23 degrees 131 degrees and zero is it yeah it is so what we need to do is to convert this into a actual directions right so how do we do that how do we do that um the easiest way is to reuse this as a rotation value to rotate a x-axis with this angle so i'm gonna call this cam angle and use this euler angle to rotate the vector and i forgot what the function is let's look at it let's look at the vex functions it has to be something related to quaternion q rotate probably and so there are a function in order to convert the euler angle into quaternion so yeah this one euler to quaternion all right so let's use this the order in this case should be equal to zero i think so first of all convert this cam angle to quaternion which is vector 4 euler to quaternion then [Music] rotate the x-axis so q rotate using quaternion that i have just created and rotate x-axis and the result should be become direction pocket hopefully and let's look oops spoiler to quartonian i think i'm missing something which is the angle order and now the result looks like this i'm not sure if this is correct let's check um going to create the new point from the current point the current camera point position plus cam dear target with some kind of lengths and add a new point also let's add a camera position as well then create the line to check the direction all right and let's turn off this lock to actually see how the direction looks like now it's doesn't really look correct so probably uh this wasn't the angle that i should rotate probably d no why is it no actually not okay so something must be wrong here if it this x-axis something looks way off this the order no not really [Music] okay um sorry for that so wait let me let me look at the camera and if i set this to zero zero zero so it is facing wait a minute negative or it's facing negative z okay so i i guess what i should have done is making this zero zero minus one okay then let's go back to the camera look at the sphere then let's check the direction of the camera oh it's not really correct is it not really sure why that is let me check this again so which is not really important but i want to make it clear so the angle is the euler angle for sure yeah and euler to quartonium is this correct convert creates a 4d creates a vector for representing quadranium from vector representing euler rotation x y z ah okay here it is the angle are in radians but the one that i'm using is in degrees so i've got to convert this into radians that's why okay now it looks correct all right well this is just the information that you can get from the camera so it's not really important but as a template might be useful for later usage all right now what else um now in order to uh project it onto a plane you do need additional information from the camera such as near far for golden aperture and the resolution of the camera in order to calculate the aspect ratio okay so these are the information you need and you can get that by accessing to the parameter channel from the camera node which you can do that by using chf and look at the camera path plus the name of the parameter for the near it's near for the far it's far and so on you can check that by going into the camera open up the edit parameter interface and these are the information you need phone call aperture focal lengths near far and so on and this is the name that you want to refer to right so let's do that for all of these and change the name far for focal aperture and resolution now for this one this has to be vector parameters of c h u all right which should give you all those information that you need and after you have got this uh next thing you want to do is to create the perspective matrix since you are using this camera which has the perspective um distortion so you can create perspective matrix using this function from vex using all those informations from the camera right so let's do that it's just filling out filling up all those informations now the zoom matrix purse perspective the first value zoom can be calculated by dividing focal lengths by aperture so for divide by aperture which i have seen it somewhere at where it it was explaining about the shaders it wasn't from the houdini's official documentation but somewhere related to the shaders which has this information so use this on equations and what's the second what was the second parameter the image aspect image aspect is the width divided by height so as x divided by this y and pixel aspect could be the same so you can just copy paste this one and near and far which is this this value so near and far all right so now that you have a perspective matrix now next thing you want to do is to change create the convert this and convert the the the current point position into a n d c space can do that by using a 2nd dc function which will enable you to convert the point position into a device coordinate for the camera which is in between i think it's been between zero to one for width and height so the the original aspect ratios is not going to be preserved but used but at least you can create image in on 2d but i think it's not on a xy plane it's in a virtually plane at some space let's check this out so the function is simple you just need to input the point position to use this so [Music] and you see pause is equal to two ndc current point position now you also need the camera in order to specify what kind of camera you're using so we can path for the first input and let's try to visualize this ndc pass to see how it looks like and as you can see it it's not there it's not fully flattened it does still keep some kind of three-dimensionality so we still need to fix this as well as keeping the camera perspectiveness to the projected point position okay so in order to do that you do need to use this perspective and the way i found being able to convert this in dc positions into a flattened image you need to first of all inverse the perspective matrix then multiply this matrix to the n dc position and as a result should be able to project the image on 2d which i am not sure if this is correct doesn't really look correct is it let me go back to the camera to look at the original three dimensions so this is the image that i'm expecting and this is the image that i've got which is kind of distorted so it doesn't really look correct okay i think i what i did wrong is this pixel ratio pixel ratio is actually height divided by width so has to be res y divided by x and now i should be able to see an image which i am not sure still not sure if this is correct looks like a bit too long on the y direction isn't it let's check going back to the camera so it is a sphere it is a sphere so maybe some kind of function is still wrong let's check um okay well i realized that after i have um placed this on to fix this to fix this ndc part with the perspective i also need to convert the ndc position to a actual um world space ndc position so from the device positions i also need to transform this to the 2a world coordinate which you can choose from these options so this is the one that you want to use so from ndc um actual point position is from ndc using space world converting the current device position and let's check okay and finally what you need to do is to convert this in collect aspect ratio because currently the aspect ratio for this one is one to one so using the resolution x and resolution y we need to calculate the aspect ratio which is divided by width by height so actually you could calculate that by somewhere around here aspect ratio is s dot x divided by res dot y which can be used here and this here as well by dividing one by aspect ratio and you could also multiply the final aspect ratio to the point position and finally wait i'm still seeing something not correct um i realize i just need to multiply to the x coordinate all right finally finally i am seeing something that i wanted to see but it it still has some depth somehow so i guess i still need to fix that in order to do that um the the easiest way oh wait a minute why did i i just wanted to multiply x yeah like that okay and actually i don't really need a z [Music] axis informations for this one so keep c 2 0 we'll project it onto a plane which doesn't really could look correct huh okay i think i'm still missing something let's see what well i'll wait a minute actually i needed to multiply this one the one that i have created and then replace position with this position yeah that's what i needed and without zero it still have some kind of depths or maybe not but by just setting the z value to zero you can place this on x y plane and finally you should be able to see a flattened 2d image on a plane well which took a lot of time but it is so you can keep this as a template to project any image onto ax y plane which i did a little bit of time to figure out how i could do this by tweaking out all those matrices so i don't think i can write it down from scratch okay wait uh pixel ratio should be equal to one is it uh this one doesn't really look correct maybe with this one i don't really need to multiply aspect ratio yeah okay so if this is equal to one then i don't really need this one thanks for that all right so and next thing i'd like to do as you can see if you look at that the front side and the back side there's two image which is which is because i'm just flattening the 3d image as it is so i only need the front side of the image in order to get the information now there are many ways to get the front side one thing is to trim out by removing the front uh back side by calculating the product again but that make a little bit of time if you want to make it as soon as if you want to get the effectiveness in terms of the code i don't really want to delete any of the geometry informations even for the back side so instead of doing that i'm going to try to [Music] fix or tweak the z value to have the original x or original z information or depth information to be given for the z value okay now the original depth value could be calculated by calculating the distance from the camera point position to each of the vertices so this is the camera point position and the distance can be calculated by from this camera position to the original point position so um distance is distance in between camera falling position to current point position now this distance itself could be used as a depth for each vertices and i would like to set that depth to as a z value in this case so just type this and as a result what you get it is the kind of a really long sphere which are facing like this i'm not sure if that this is the right direction to look at let me check going back to the camera with the original geometry so the darker side was at the left bottom side now this looks wrong so instead of using distance we want to make a negative distance and that looks correct if you look from here okay so in this way you have a three-dimensional uh informations but the one that that is close to this plane x y plane is the one you want to get so you could either use something like intersection to retrieve the information by projecting the straight lay or the raid which goes to negative z direction from this plane to this sphere and when it touches when the ray touches or when the ray hits the object then you'll be able to retrieve the color information from the sphere then that's the one you want to visualize as a 2d pixel okay so that's and since the intersection function can uh will get the the most closest um hit point so the backside will be ignored this way all right so that's the plan but um the problem is that intersection function is a bit intersect function is a bit too slow to calculate especially if you have tons of pixels to calculate it's not a nice idea it's not a good idea to actually get the information so instead of using intersect i would like to use a bit more cheap functions such as like near points or xyz distance with the function that can retrieve the nearest point information now in order in able to do that it is still a good idea to make the z value to zero in this case it's much easier to use the new point or x y z distance um because the point to sample just has to be on on top of this x y plane right but in those cases you do still have a problem with this backside problem so the my plan is to give this distance information instead give this distance information to somewhere that is not that is not point position but in something like this and use that to filter out which point position you want to use when you use functions like new points so let's say this is a 2d image and this is the pixel that you want to sample and if you use the new points functions from this point position if you have a front side image and a backside image you get two image i mean two informations one from the front and one from the back and you want you only want to use the front side now in order to filter out which one you could you would able be able to use you can check the distance and the larger distance in this case because this is the negative value the larger distance which is close to zero should be the one you want to use in between these two points right i'm not sure that if that makes sense but that's my plan all right so that's my plan and let's look at the information you have the point color distance normal it's not really necessary in this case now that i have this reference image in 2d it's actually time to sample the color to actually build up the 2d pixel image or pixel art so first thing first you do need to have a grid which covers this image and also the size of this sphere is a bit too small compared to the original sphere so what i would like to do is to give at least a similar size to this image compared to the original one it's not really necessary but as um practice because it's much it will be much easier to control i think so to do that you do need to scale up these informations so let's get all those original size informations as well as the center information shall we so vector size is get b box size vector center is get b box center right i think those are the necessary stuff and what i would like to do is to retrieve the probably the maximum of x y over the component from this size then use the center to replace this current point position to the center of the object which probably is somewhere around here for the sphere so first thing first let's move the point to the center by in order to do that you do need to know the center of this sphere so i guess i should do this on other angle it should be easier to do i'm going to call this resize getting the original information original model information as well and get the original size or the current size as well as the target center and target size from the second input okay and first of all let's move the point position to the center by calculating the direction d center minus c center okay moving to the original coordinate but you still want to keep the z value to zero all right and you also want to scale this up by using them [Music] x y z and the maximum of x y z component for the t size probably divided by c sides as well right yeah so to do that right first i'm going to wait maximum t c t size x the size y this doesn't really look clean at all divided by maximum of current size screen size y current size z and gives me error because i don't have a semicolon all right and now the size of the projected plane is similar to the original one and also that the center point okay so that's good now it's time to actually project um to project it on the 2d grid okay sorry for getting too tired it's a rather slow stream i know all right so give a grid which covers the sphere and you could probably specify the grid size based on the original size of this sphere so let's do that shall we with some kind of a margin or you could also fix the size of the grid any anyway um i'll get the size of this the geometry that i have here let's call this flattened and then get those informations using vbox and there is the expression to get the x size so look at the flat end and get the x size okay which should cover the image let's do the same for a y size all right now at this point you don't really have any margin so let's give some let's also create some margin to this or padding to this uh image so that you have at least some kind of um space in order to do that i'm going to create some parameters for that in here controller so i'm gonna give the name as margin from 0 to 10 copy this parameter and paste it to this here adding to the size for x and y okay now next thing i would like to control is the number of pixels obviously since currently the number of pixels is not really enough to visualize the image so you could either choose the number of rows and columns or you could also or instead you could use the size of each cells as a parameter i'm going to choose the cell size as a parameter but you could always you could also change the parameter to set rows and columns instead okay so let's give a parameter called pixel size so smaller the pixel sizes you have more resolutions that's the plan and let's give a value in between zero to one copy it and you do need to do some [Music] calculations and mathematical calculations to this the number of pixels could be related calculated i mean changed here and columns are the x related values so it should be related to the size as well so you first copy the sx size paste it to the column then divided by the divided by the pixel size okay do the same for y instead of using size y size x use size y all right now if you change this value you should be able to control the number of pixels like this and rest is easy you just need to pick the color information for each pixels for each grid from this flattened image all right and just get the front side colors all right uh i'm just going to color each primitive so it looks like a pixel art let's get change this to a smooth wire shaded and refer to the flattened image now here's another domain coding for tonight now as i said i am going to use a new points to get the nearest points informations on 2d plane and just get the font side value out of all those information that you get and of course from the second input now almost the parameter near points current point position maximum distance all right okay so um the problem with the new points is that uh yeah it still has some problem with this one [Music] i think the searching distance has to be related to the value of pixels so let me copy this value here because if you have those pixels and you are always searching from the center of the faces and what you want to search for if this is the underlying image for for this point you want to search the value in between here but it's a bit hard to search with the square search radius so instead of square i have to use circle and i need to define the radius of the searching circle and this is the pixel radius or a pixel size that i've got so i could just use it as a searching radius i guess which should cover those points but maybe that might be too big so you could probably say multiply by 0.5 or something let's check that out but yeah if i make it 0.5 then those points are going to be ignored by all of the point searches so that's not really good yeah that's not really good so i guess i i i'm gonna go with p i mean pixel size for the searching radius and see if i can fix that later okay let's copy this pixel size and go back to the pixelize try to refer to the pixel size like that and gonna use this as a searching radius for the new points right now from the list of points information i got from this new points what i would like to get is the one that has the maximum distance value meaning because all of the distance values in negative actually i don't really need it to make it negative in this case i can just make it positive and i just need to look for the least distance value out of all the arrays that i got from these new points so for each or maybe not search for the get the distance attributes from each of the points and what i want to get is the minimum distance value so load mean distance starting from really high value if the min distance is larger than the current distance then update minimum distance with the current distance and what i need is a as an information is the the final uh point number so min npt starting from negative and min and p t is equal to npt yeah now if and if min and pt is more than zero more or equal than zero then means you have found some kind of points then in those cases you want to get the actual color value from that point then use it to visualize or the update the color of the face of the pixel of the grid now it did create some black color which is not really intended i wanted to have some kind of a colored value but nope it did not give because i needed to get from the second input yep here we go so seems like it's working you are just directly getting the color information from the second input and let's make the pixel size smaller maybe the maximum size of the pixel could be well 0.1 there we go and the speed is fast enough i guess all right so looking good it is being pixelized and projected to a grid with a decent speed all right now so far it looks good and let's also figure out what to do with the the outer the one that didn't hit with this near points so else if it's min if the minimum npt is equal to negative one then um probably i could set the color to white or black like this i guess it depends on the usage could be black could be white i'm gonna go with white right or if you want to make it custom it could be something like yellow or purple or anything anyway okay so now that i have this um pixelized uh color the next thing i would like to since i am just directly mapping the color from the three-dimensional geometry the the column information is a bit too [Music] this has a too much informations in terms of the color um meaning there's too many variations for the color so i want to limit this in order to make him looks more like a pixel art you see in where which artist makes in order to do that the easiest way is to limit the number of colors you can use and because of that i am going to use the color palette originally made it for all the console devices like um nintendo nest system or game boy or something like that and those are the color palette that i have exported from the photo editing application which only has a pixel informations this okay straightforward and i'm going to import those information to houdini to use it as a color palette to map this color to the closest color information from the color palette all right so shall we do this in order to import the image i'm going to use the cop cop 2 and i don't really want to get the information for each frame i don't really need to do that so i'm going to delete this channel and fix this to one and i'm gonna give use the file and import the color pattern informations anything you want let's choose something like six and see you can't really see because it's it has just one row and the image that you get from the cop will be displayed as points so you only see points rows of points from this cop which i don't really see anywhere but if you look at the attributes there is actually a point information available all right so those are the information and this is the actual color information that i want to use for each point we applied on each point retrieve from the color palette so what i'm going to do is to search for for each point on this grid i mean for each face on this grid where you look at the primitive attributes you have this color information search for the closest color value from the color palette from this call to net and replace this color to this color that's that's what i'm gonna do okay i have some comments i have a question how can we describe a plane invex clip function for instant consists of clip vector but i can't find how to write vector for playing down i think i've never used a function called clip it's there one clip the segment between p0 and p1 click the line sugar and again probably 3d plane or specifically didn't know about this clip the line segment to the boundary box if the line is entirely clipped um how can we describe a plane in effects plane it says vector four and plane equations against arbitrary plane specify the plane equations plane xx plane x y y plane cz huh not sure what that means although if you say vector 4 it is similar to a quaternion so might be set as a rotational information right so probably you could have a euler angle and covered in it converted into quaternion then use it as a plane might make sense um shall we try that clip the blind plane i well i'll try this later but i think you can just convert the angle of the plane into a quaternion then use it as a plane on vex i think that's the way to go probably i i just need to test it out later all right so in order to color the map the color i can either do it right here inside the specialize or in the other way or in the other vex maybe let's use it and let's try this in other effects to simplify it okay and this should be primitive wrangle all right so let's do that now in order to find out the closest uh color value the easiest way i could think of is to first of all convert the color information into a positional value like point then use a function like neopoint to look for the closest point of information then that closest point might be the closest color i mean that might not be true unlike that might not be uh like um exactly true or exactly correct because the color space is not really in linear space so i like red space blue space and green space each one has different brightness values but um anyway the easiest way to figure out the closest color is just just to try to convert the color information into the point position then you it will be straightforward to find out the closest one so let's try in that way and try in this direction so in order to do that first of all going back to the cop network look at the output you have these informations you do also have a primitive but you don't really need a primitive information so let's first delete the primitive from the cop key just keep the points okay now you have a bunch of points with colors and what you want to do is to change uh change those point position depending on the colors so use point wrangle and just change the point position with the colors just remapping and there you go the point has been placed based on the color right in a three like a 3d map and going back to the color information these all those colors also can be transferred into a point position and from that you could search for the closest one to this color map now that's my plan let's do that so uh first of all let's call the color the current color cd getting from cd attribute then use the new point function from the second input with this cd as a point position as a result you should be able to get the closest um color value which has been positioned as the point position and by using your way it disappeared damn it damn it what was the near point all right and i'm just using color as a position to use new point this is a bit hacky way to use it but it's pretty fast so nice way to uh wait it's a kind of a trick to search for the closest colors okay so as a result you should be able to get the closest color point now finally you can retrieve the color information actual color information from that point then replace the current color with that and here you go you have successfully mapped the current color to using this color palette now i have in total 13 or 14 color palette 13 so let's try to switch between the color palette to see the differences i'm going to create the sliders to change the color palette between 1 to 13 copy this paste it inside the copnet right here oops just deleted everything okay let me let me paste that references here and copy this to this all right so i should be now able to change the color oops palette so this is a game boy such that okay looks i think it looks more like a pixel art rather than using the original colors because the number of colors limited looks more like a heart from the games right okay i think i like it overall looking good now let's organize this a little bit pixelize color mapping right now what's left is all those visualized um what's left that i want to do now is to give a little bit of quality to this big pixel image right now the border i don't really see the border but if you look at the actual pixel image from the artist you see a lot of artist does give a border or silhouette outline to the image so that i want to do the same thing to this one and that's what i want to do next now in order to do that one way you could do is to do right here where you are projecting the image to a plane so the the rule here is that you want to make the border where you have where it is in between the border of the image and the empty space and give the distance or thickness of the border and that way you could create a something like black line to these image but the problem is if you have multiple geometries like covering up in 3d such that let me give a situations to that so let me go back to the 3d image i'll give a name here okay so let's say if you have two spheres in a different position and i want to move this a bit off like that okay the mapping looks a bit weird maybe i shouldn't do this here but i'm gonna try to do that after i have created the uv maybe the uv can be created right here and [Music] use the transform node to move and merge it with the original one i'm gonna move this a little bit more okay something like that and from the camera view i what i would like to create is the situations where both of the geometries are covering up to each other so something like this okay and if you look at the 2d image okay i don't see anything why is that camera projection front end wait the position of the grid is wrong how come okay let's look this resize seems to do [Music] something that is not correct okay 3d [Music] so this looks wrong let me check if i multiply by zero okay did it change something all right well first of all if i say minus c center it should goes to the zero zero zero yeah that is correct okay now and if i add the t center it should go to d this center point position but it is not why is that okay um let me check edit it okay or i'm just gonna place this on the center maybe that's fine but i don't get why this didn't work let me check wait a minute this here looks correct it turns up the point position oh well then hmm after moving this point to the center point what if i didn't multiply it okay i guess this multiplication did something wrong here yeah looks correct then after i have multiplied it went really far yeah i get it i get it so if you want to move it i should have moved it right here yeah okay make sense and i should reset the z value to zero right here okay and this still doesn't being covered by the grid i also need to change the grid center point by using the center point of this flattened value so b box flattened flattened the the center is there any center nope centroid can i use this android send to roid wait centroid dx d x all right and centroid d y z is okay with zero okay that looks good and [Music] yep looks good and if i change the pixel size something bigger yup now what i if i want to create the border if i am i if i want to do that right here and in the pixel pixelize functions what i can only do is to create a border right here on the empty space which might be okay but you cannot really create a border right here which sometimes you want to do right in between the different two objects being covering up to each other so in those cases you kind of have to create that in three dimension yeah so for that i am going to create a outline based three-dimensional geometry first in 3d then project it into 2d just like just as you do in these 3d geometries then i use that use the same color mapping to map that outline geometry and the outline geometry has to have has to be always uh behind the object to be [Music] to be look like an outline of the object okay just like you do in shading or shaders so let's try to do that what i'm gonna do is right after i calculated the directional light i'm gonna try to create the outline geometry okay first of all you do need to define the thickness of the outline so in order to do that first of all i'm going to offset the whole geometry to the normal direction by some kind of um offset value the method i'm doing here is based from the idea from the shaders so actual shaders in order to create the outline in the rendering scene so the basic idea can be transferred back to the shaders as well so in order to offset the point you just need to move the point to the normal direction by some kind of opposite value just like that this will be used as an outline and let's give that parameter to be controlled border thickness now the color of the water could be any value but i'm gonna fix it to black for now so let's change the color of this ball offset geometry to black this could also be parameterized baby if you need a different color for the outline now now that i have this black wall but the problem is that it's covering the whole geometry like this so you cannot really see the original geometry if you merge it together right so what i want to do now is to move move this uh offsetted geometry back to the camera direction for a amount of border thickness so that the original geometry would would show up front side of the this offset geometry so i am going to give a uh what i'm going to do is to wait point wrangle use the point wrangle to move the point position toward the camera direction so that means you do need a camera informations again so let's copy some of the information from this camera projection uh at least what i need is this camera path and camera matrix camera positions these informations everything else is not really necessary so let's copy these and paste it right here all right then refer to the camera changing this to operation pass right now now you have camera positions and camera direction now let me check what i have written before so in order to offset it what i would do it's pretty easy i think you just need to move the current point position toward the camera direction by the amount of offset which could be related to the border value if i do it manually okay it's not see that the ball is moving and if you combine these two together and where is the camera camera is around here and if you are moving the offset okay i i guess i should move it to the opposite direction i guess say you want to move it to the negative direction you see if you look at the camera positions hmm this doesn't really look correct is it am i getting am i really getting the camera positions nope yeah okay after all this is positive yeah as you can see if you move it to the camera direction by moving this offset later and glitter you start to see this outline from the camera view change the background color to the brighter one and the amount of offset should be related to the thickness or the border thickness which is this one so let's skip that value multiply by some linear values so get this thickness and multiply by by two or three before let's see how much is necessary if i say five start to see some trimming so maybe around two to three three and if you look at three dimension it actually looks like this looks funny but in 2d image looks like this so you still have a border if you make it too it's covering the front side a little bit so might not be a good idea so let's multiply by three for now okay and if the border thickness is equal to zero which is this one looks like this the whole black is covering so that's not really ideal in those cases you do need to have a little bit of offset like that okay that looks good and we are set with borders i think looks funny now let's go back to the 2d image and let's see the result and there you go now it's not really pixel perfect but at least it gives you some idea about the border now right now the edge is a bit too hard for a pixel art maybe sometimes it's okay sometimes might not be ideal so i would like to add another like functions to smoothen these um boundary edge or border edge to be able to merge with the background there is a comment there there are artists who make portraits with this dice could something similar be done in bellini what is dice i don't really know what dice is let me search for it let me know what uh what dice is is it some kind of software or something not really sure oh hopefully you'll get back and so in order to smoothen out the border i am going to do that somewhere somewhere right here somewhere around here okay so and in order to do that i need to look for some rules here i might not want to smooth out the border on the inner side but i just want to smoothen out the border on the outside outer side of the geometry making these edges a bit more merged with the background maybe also with these edges which is where you have the other geometry on the back side so to do that you do need to have those information if you have to first of all you need you do need to get those pixels informations where you have where it is um whether it is next to a empty pixels or next to the other geometry all right so first of all if it's con if it's on the empty if the pixels a neighbor is empty or not you could use the information like this one if the minimum pt is not or less than zero meaning negative then that means those pixels are empty so let's give those pixels the empty information set friend group empty like that right and it might also be useful to have a information whether the pixels is at the border or at the geometry so in order to do that we need to go back to where we have the original geometry and the border geometry so give two different groups to these geometry first first of all the front one i'm gonna name this front and the outline to be back all right then [Music] go into the camera projection where we are flattening the geometry we need to look at the point informations and we need to wait a minute actually this is just the primitive here okay so so far at this point we we do have those information back in front and we also need to know that if this is belongs to the different geometry or not so in order to do that i would use a connectivity node to look if the face is connected to a certain class or not and i want to do this for a primitive right now if you look at the class you have zero and one so you have two geometries two isolated geometries okay and what i want to do is to transform transfer these class and back and front group information to this grid using this pixelized information pixelize functions so let's do that shall we so if you have found out the hit what you can get is two uh three different information one is class from actually the class information could be a point information yeah and the group could also be point i guess since we are referring to the point yeah so instead of you creating the primitive group i'm gonna create the point group all right that makes sense now i can get the class front information and point group zero back and let's give those attributes shall we so class um set point set frame group front set group like that okay let's check so i have back empty front and if i only want to retrieve the border i should be able to filter it by using a back group nope didn't work didn't really work let's see why okay i don't seem to have any back or front so i think i'm doing something wrong here and that is because i didn't refer to the second input okay there you go so i now i be able to pick up the back side or the front side for the empty and putty right so those are the necessary informations and you could also pick the geometry information by saying class is equal to zero class is equal to one so on maybe if it's in if if it is empty i might want to make the class to be minus one all right so i think everything is set to do some pause processing to those pixels again just like you do in shaders right so after maybe before mapping the color i could do some post processing for the border primitive wrangle how do i name this border and i'm only going to look at the back group and now the rule here is to pick the pixels which is touching to the empty pixels or to the other geometry so first of all i'm going to get the poly neighbors the neighbor primitives using poly neighbors and look for all the neighbors all right and then i want to check if it is in empty or the other object so mpt more in the class okay so here comes the conditions if empty is equal to one or class is not equal to the current class meaning you are seeing at the different object then that's when you want to [Music] smoothen out those pixels by picking up the neighbor color right so let's give a final color like call starting from i don't know zero and or the current color starting from the current original color all right now once you've found it what you want to do is to use something like blurb to smooth it out from the current color to the the neighbor color so the neighbor color can be retrieved by accessing 2d all right and here comes some parameter like what percentage you want to move the value to so if it's equal to one then you are 100 changing the color to the backside color if it's 50 then you're gradually changing the color from the black to this background color and you are repeating this for all the neighbors you have found out okay and finally you are replacing the original color the border color to the updated color and let's see if i erase this up well nothing did happen okay let's see why first of all i'm gonna try to check if i can really change the okay it is changing so probably this condition is wrong somehow let me check again if the all the value i need is in the primitive so yeah i do have empty sure sure yeah okay so it looks correct and do so um paulie never's criminal wait a minute is this correct poly neighbors yeah it is correct so that should be oh wait a minute but uh there might be a chance that this is wrong let's count up how many neighbors that i have for each faces okay zero so that's obviously wrong so in order to probably i did i needed to use fuse for this grid in order to fuse those faces together to be able to use the polyneivers now how's this still not still not how's this here nope how is this oh wait a minute there are some faces but just these why is that and those are for the back side this is funny um let me see let me see let me see what i did previously what i am missing here hmm hughes is it is it changing the number of points or vertices not really not really so it has to be correct but somehow holy neighbors doesn't give me the value that i want so let's see why let's see why um i'm gonna comment these out for now and see so only the one that have group equal to back has this polyneighbor values that's weird that is pretty weird okay what if i do this to original grid ah wait that is because yeah i was using back as a filter so turns out it is correct yeah it wasn't it wasn't a problem so that is correct so the only problem i have is this should be this um filtering i guess now so how okay let me try to look back so this doesn't really give any changes if i just say one here nothing happens if i remove this condition nothing happened did it nope hmm [Music] what if i set the conditions only for the emptiness really wait a minute why did i use one okay that was the reason that was the reason i feel so stupid all right so this should be okay finally as you can see the borders are being smoothed out based on this ratio for both the one that's facing or neighboring to the empty spaces or the one that's close to the that's that's the other geometry on the back side it's being smoothed out okay and then use those final color with the color map should be able to pick up the one that's from the color palette for the border all right okay looks nice so bit more smoothing out in terms of the pixels all right okay cool okay i like effect okay so let's have that border smoothness as a parameter as well zero to one okay right so the other types of functions that i would want in order to make the image a bit more prettier is something like uh introducing some backlight a fake backlight to the object and i would like to do that by introducing a fresno effect to the object just like you do in shaders so just adding a little bit of light on the edge of the geometry by using retinol and you can calculate it calculate those fresno pretty easily by using again a dot product between the camera direction and uh object normals so where should we do that we could do this where after we have calculated directional light i guess so let's give a space like this like that and [Music] give a point wrangle [Music] to add some fresno based lighting i just i just want to add some little light or leak leaked light looks like litten lit from the back side of this geometry it is still a fake but makes the image a bit prettier all right let's go to the original camera positions and let's do this now again i do need the camera position so let's bring up the template somewhere around here then specify the camera path changing disk to the operator path then choose the camera all right oop forgot to bring up the camera direction where was it camera direction okay so or i could just use the straight directions for this one i'm not sure which one's the better which one's better well i'm going to try with this one first okay then what i want to do is to calculate the dot product between the normal of the points in the camera direction as a result you should be able to get the volume between minus one to one and if if we want to get those edge part the value should be close to zero where it is perpendicular to the normal and the camera direction so if it's close to zero you want to have the brighter value if it's close to one or everything minus one then you want to make it unaffected by this fresno so to do that to do that what's the best way first of all i'm going to make this as an absolute value absolute value so that it will be in between zero to one then if it's equal to zero i wanna make a brighter value if it's equal to one we wanna make that affected so so um let's see let's see what's the best way to make this as a to brighten up the space fit zero one this to [Music] first of all it might be a good idea to again use some curve to control the mapping for this dot value so let's use the ramp parameter so that you can control the affection map then remap it to actual fresno information and that could be a fit now it could be a multiplication or it could be the addition either way could work so i don't know which one's better but maybe i'm gonna try with the addition if it didn't work then i'm gonna try with the multiplication later so dot dot val if it's equal to zero then maybe i i want to flip the value here so um max brightness dad maybe you could also set a minimum brightness or i'll just set zero all right all right so this should be pretty much it and now what i'm gonna do is to add this fresno value to the color for x y and z and see if this going to do something okay i'm not seeing any effect am i getting any value here let me check probably not points first of all i do have some value here although the color is not changing why is it why is that i'm expecting the color to be changed but no it's not really changing not sure why not sure why am i what if i change this to zero zero zero does it change wait it doesn't really change huh how is that possible not sure not really sure is this some kind of a cache again let me create a new view as if i'm getting the updated view okay now it's empty all right so seems like this has some cash problem cash issue which i don't know how to fix it so i'm gonna go with this new view okay going back to the original function so am i getting the yeah i am getting some fresno colors if i make this to 10 yeah i do see something here now it's too much so but i do want to make this to 10 to see the changes okay and i also want to change this to small shaded now i don't really want to write 10 up on the center so let's go back let's go back here to control how bright i would like to set for the inner side and the other side this seems to work fine maybe a bit too bright on the outer side so two and look at the final three dimensional geometry from the camera view maybe maybe that's good and look at the 2d image and here you go you do have some kind of a edge light up which might not be necessary at some point but might be neat to have at some ratio to make it look more i don't know of like shape all right that looks good let's have this as a parameter as well also this one yup i think i like it okay going back [Music] it's the float value could be from 0 to 10 and the ramp parameter which i could just drag and drop i think i'm getting tired and i am not sure if anybody is here still here okay i guess it's around time to wrap up i think you got the idea what was i'm what i meant to do what i was doing so hopefully you have found it somehow interesting okay let's bring the this value as well dog value the brightness of the lighting and the ramp for the right light okay i think i have enough parameter change to diffuse to white okay have a nice image and [Music] what else is there anything i could do let me look at the one that i previously created probably that's pretty much it i mean if you want you could also implement like us like a fake reflection from the environmental map or something like that but it's all it's all similar to how you do in shaders so you can write your own code using bex just like i did here maybe i could add a shadow and then finish this whole thing and rest keep the rest of up to you guys if you want to try it and if you're not try using this by yourself having shadow might be a good um i don't know a reference to use it for a different kind of setup and it might also look neat in pixel art as well okay so let me try that so in order to create the shadow i do need to have a face to cast a shadow too i do need to specify in which geometry i would want to cast a shadow in these cases just like you do in game engines to define which object yes shadow which object is just receiving the shadow and so on right so for that purpose i could still use this directional light to create the shadow right and let's also create something some floor shape for geometry to cast a shadow just could be just a grid and for this one i'm going to try to color it with a single color some random color let's just set this to random primitive wanna do i don't need um i do need to make it as a point color but i want to fill the whole primitive as same color so after all i'm gonna make it primitive and promote it to point all right so this is the floor and i am going to merge it with the [Music] original geometry probably i should merge it before using this connectivity or normal or attribute map wait this attribution map attribute from map subdivisions maybe this um it's a bit hard this well i'm just gonna um it's hard i don't really want to use this for all the geometry which has been switched from so i'm going to connect it here so in those cases probably i should connect this subdivide here as well yep all right and then merge the floor with the geometry and connect it to the normal and so on okay and maybe i should bring the geometry up a little bit like that like that okay okay so this fresno light is creating a little bit too bright space for the ground maybe i don't really want to do this for the ground plane for this fresno light so probably i could i should limit in which points i should use the fresno which i should not i'm going to create a group for the point floor and for this one name in as and geo okay and only for geo i would like to use the directional light shading also for the fresno light but for the shadowing i could do it for both this one and ground if you don't want to cast the shadow onto the geometry then you can also skip it but that's pretty much a pu up to you okay let's try shadowing where should i do that maybe after directional lighting um doesn't make sense and i'm not sure because this is going to override the shadow maybe let's try now i have realized that in order to create a shadow on the plane i do need to have resolutions decent resolutions to this grid which i don't really have it so let's do the subdivide try to create high res grid maybe i shouldn't use sub divide after all it's a bit too slow okay how come it's still so slow after all i can go back here um create the really high res face since this is all vertex based shading i do need to have tons of vertices if you want to highlight if you want to have a high res shadows so that's the downside obviously but the number of pixels are limited limit so you could i guess you could also reduce the resolution of the original geometry which doesn't really matter now let's try with these now the color is again not all random to all places so instead of doing this just gonna use the single color for the point after roll i'm gonna go as a grayish ground for now okay and referring to the directional light again get those information now how do we create the shadow um from the pixels look at the camera point position then if there are any obstacles in between those directions then that means there the plane or the point position we're looking at is being blocked by that object should be should have shadows yeah that's the plan so intersection you do need an intersection for this one i think which could be pretty slow so i might want to after i might want to avoid using that let's just use it for the floor okay and so no i'm not not i don't really need to look for the camera positions but just need this normal direction the direction of lighting for the intersection ray right so intersect intersect zero from the original point position and to the direction negative direction with the kind of infinite distance then as a result you get two information one is the intersected point position and uv now i don't really need uv i don't really need different intersected positions i just need the inter information if it's negative you it didn't touch anything so the value should not be changed if it's positive or equal to zero then that means there's an obstacle you want to make this a shadow color in this case probably i could just make multiply it by zero to make it black didn't work that is because i shouldn't start from current point position which will be at the same position the current position so i should offset it a little bit to a minus direction by a small amount no it didn't work how's this nope okay something must be wrong okay i didn't really created the conditions here if enter is equal to zero equal or larger than zero then that's when you want to create the shadow there you go it doesn't really look realistic but at least it gives some value and if you look this at 2d pixel how does it look like like that wait a minute which from which way i was looking at so this is the view that i'm looking at and so it's this way seems like the grid is in the other direction let's flip that reverse all right better okay so now it gives you the result with the shadows um i am not going to smoothen out the shadow you can just do it just like you did for the borders if you know if you follow how i did it you should be able to do it by yourself right so i guess that's pretty much it funny thing is that i don't really get the border for this floor at this edge i guess that is because this floor geometry is the flat surface i might need to make it as three-dimensional box to have a border for this pawn okay i'll just do that you just need to extrude it a little bit i think and have the back side okay now it looks a bit funny how is that and i do need a little bit of divisions here on the side okay how does how is it look like okay so far this is okay okay so creating the border maybe the water thickness is a bit too thick okay well i guess there are several stuff you i might need to fix you know in terms of the borders but so far not bad result i would like to say okay so that's pretty much it uh let me know if you have any comments or feedbacks to the setup i'll be appreciated if not i would like to end the tutorial here and go to sleep all right i didn't really check this 2d pixels in all the geometry so i'm gonna do that and then just leave it up to you shall we shall we let me know if you have any comments which i would really like to have okay i'm gonna place the sphere to the center of some intersection between the floor and the geometry let's see what happens okay not bad and the good thing about this process is that it is using the camera info as it is so if you change the focal lengths that information is also being transferred to the 2d pixels so that what i mean is that if you change the focal lengths to really high value makes looks more like an orthogonal view like 200 so it does look like an orthogonal view like isometric and this isometric view is being preserved on 2d mesh as well just like that which is nice i mean looks more like a one that you see in gaming changing the color palette there you go game boy hmm i like this color okay and let's try with other geometries like peghead now before using it you do need to transfer the color informations now currently the value the one you see the image you see here is from the material from the shadings which cannot be used for this system you do need to remap it to a vertices okay so and i don't really know where the texture is stored for this pig head so i'm just going to use the single color for this big head but i still need to make kit to have tons of vertices as much as possible like these and let's delete the or set the color informations i know like blue [Music] and only this color will be used for the 2d all those material information is going to be lost that's one thing you need to remember okay i want to lift up lift this up a little bit there might be a way to transfer the material informations to the color information but i don't couldn't really find out how so maybe if you know it please tell me because that will be great but i think from what i have researched i in order to do that i do need to write the shader code in houdini for mantra or something so yeah i didn't do that i didn't want to do that so so how does this look like and there you go to the big head let's try changing those parameters like pixel size the water thickness or smoothness fresno writing brightness color palette interesting interesting i think i'm really enjoying this for myself i hope you do as well at some points darkness of the lighting brightness oops not this one um so these are the result that i get that you get from this setup and [Music] let's see if i animate this how fast it could generate the result so what if i rotate the geometry with the frame let's see how this goes so it's not that fast but i guess it's good enough for for you for this kind of number of pixels everything is following even with the shadows yeah yeah i think i like it okay so that's it that's it thank you very much let me look at the comment um do you use houdini just for vex or you actually do sims and all that uh for a productions i sometimes use sims like well especially vellum i do use a lot of vellums for the project but all the other dops i not not i don't really use that much sometimes a pyro maybe but i don't use any flips or water related sims because it's hard to control that's the only reason the reason why i'm using houdini is just it's because it's it it's customizability and flexibility if you have an idea then you could just implement it and that's the things that i like about it so sims are great but if it's less flexible if it's too many parameters that i don't really understand then i don't really want to use it and it's too slow and since i am not in the vfx field i'm more in the architectural field so i don't really need those after all that's kind of a reason uh thanks for all the comments okay thanks for all the comments and thanks for being on live with me at this far um hopefully hopefully you've have a nice day and i am going to sleep right after i finish this life and as always i am going to [Music] upload the file that i have created on live to a github and paste the link to the video desktop video description page of this youtube live as well as at the patreon so and it will be also great if you could be a supporter on the patreon page as well to continue creating continue doing this kind of tutorial live or recorded live okay so that's it thank you and good night you
Info
Channel: Junichiro Horikawa
Views: 137,489
Rating: undefined out of 5
Keywords: houdini, sidefx, live, tutorial, procedural, procedural modeling, parametric modeling, parametric design, parametric, fabrication, digital design, computational design, 3d, design, isosurface, lattice, structure, 3d modeling, modeling, computational, generative, line drawing, drawing, illustration, fractal, reaction diffusion, celullar automata, simulation, trail, particle, vfx, mitosis, magnetic field, field, volume, rendering, computer graphics, visualization, algorithm, motion graphics, graphics, remesh, quad
Id: GEIrSAPB0xI
Channel Id: undefined
Length: 194min 28sec (11668 seconds)
Published: Fri May 27 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.