JCPalmer Posted August 11, 2017 Share Posted August 11, 2017 Well, have published a test scene to experiment with hair color. I have a question about what is the color shade , used by LineMesh, supposed to be doing with alpha? Its use can actually give a good effect (try it with platinum blonde), but not knowing what it does makes me nervous. This process seems to be close to working, but have come to the realization that the width of the lines is always the same # of pixels. This means very far away, it can tend to look like shag carpet, due to the head being small. When really close the scalp is very visible. For the very close case, I suppose I could try using an emitted material in areas where you should not see the the skin. Any thoughts? Pryme8, NasimiAsl, JackFalcon and 1 other 4 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 11, 2017 Share Posted August 11, 2017 Alpha will be used to enable alpha blending in the same way you have alpha in the standard material For lines at far distance, what about using ribbons? Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted August 11, 2017 Author Share Posted August 11, 2017 I guess I wondered what is it being mixed with. Just did some experiments changing the scene clear color. It had no effect. Seems the mix color is white. As far as ribbons, I did not see that ribbons had a width. Even if it did, planes would look weird from different angle. What might work is for every point received, create 3 vertices around it perpendicular to the next vertex. Each strand would like an extruded triangle. Technically, that would multiple the number of vertices by 3, matrix weights & indices, and vertex colors by 3, BUT could probably get away with the number of strands from the 30k (150k vertices). 5K strands are probably good. Since there are no normals with vertex colors, it is going to be hard to see the edges of the triangles. Even if you can, it would just look like more strands. I need another beer. (At least I only would need to change the JS side, since all python passes is the points & list of strand lengths). Time to do a repo commit of this. Quote Link to comment Share on other sites More sharing options...
gryff Posted August 11, 2017 Share Posted August 11, 2017 @JCPalmer : Nice Jeff. As for the close up view - a skull cap the same as hair colour, or maybe just a different material on the mesh where the hair is. One day I must look at this QI closely and try and understand it cheers, gryff Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted August 12, 2017 Author Share Posted August 12, 2017 @gryff: That is my back up plan. It reminds me of the spay hair product from a long time ago for sparse areas. I saw a woman with it once. It looked like paint. I fear once you breech a certain distance, it is really going to suck. In this setting, the material would be too uniform without a lot of screwing around. Going to give the triangular spaghetti a try. Going back to my original proof of concept scene. No need to complicate things. Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted August 15, 2017 Author Share Posted August 15, 2017 Well made an attempt at triangular spaghetti. While it might be obvious to someone that because I was sub-classing LinesMesh, that I would not get filled triangles, but not to me. Also, the point of one strand is connected to the next. Here is a picture of a 2 strand Hair mesh. I made the triangles really "wide", for diagnostic purposes. I tried switching to sub-classing from Mesh with a reasonable wide, no material, and vertex color. It looks promising from a zoom standpoint. Here is the live scene. Performance of the first scene is destroyed. It will not even load, so do not bother right now. Many less strands would be required, and have not done that yet. What I would like to know, it what do I need to do to the color.vertex.shader to get it to draw filled triangles not lines? Do not want to use the default shader. I could get specular with it, but way too slow. The default shader has just so much stuff, finding anything is really tough. Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted August 15, 2017 Author Share Posted August 15, 2017 actually, I figured out why the original scene hung (1/2 a billion console log messages). It looks weird from some angles due to going all white, but zoom looks great from this angle. Number of strands could greatly be reduced. Maybe could use default shader, but is all the white about? JackFalcon and GameMonetize 2 Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted September 21, 2017 Author Share Posted September 21, 2017 Update of the "update topic". I figured out what the "going all white" from a certain angle was. I forgot that now that I was not doing lines, that I had to do normals. Here is my latest committed snaphot, same url as above. I looks great in black & dark brown. You can even move that "Color Spread" slider to zero, and it almost looks photo realistic from ANY distance. That slider was for inter-strand variation. Back when things were just lines, rather than triangular spaghetti, a slight random difference of the root segment of each strand was needed. There is also a very subtle spread of each strand segment that there was no slider for. If I get rid of inter-strand variation, could switch what that slider doe to the intra-strand variation. Now the new PROBLEM. The lighter colors have all this black running through them. The triangular spaghetti produces very stark normals. Any ideas????? The 2 I am going to try are: Add a material with an emissive color. (Not my preferred method) Calculate the normals, then try to throttle them towards either towards -0.5 or 0.5. The overall values for the colors might need to be brightened (fixable), but I actually do not want the geometry to noticeable, so coming up with weird ass normals that get me photo realistic on the cheap is ok by me. Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted September 21, 2017 Author Share Posted September 21, 2017 Well goofing with normals just made a mess. But thinking about adding a material with emissive, having no material just uses the default material, so no extra harm in overriding it. I add a material with only emissive (no specular / diffuse / ambient). The color I use is 0.8 * of the base color selected. Works really good. White & Platinum Blonde were just too bright though, so I backed the values for those down a little. I also put a ceiling on a component value of the emissive to be a max of 0.5. This is starting to look production worthy. Definitely defaulting the inter-strand color spread to 0. Wondering if I even need the intra-strand spread. Am going to test that tomorrow. Quote Link to comment Share on other sites More sharing options...
gryff Posted September 21, 2017 Share Posted September 21, 2017 12 minutes ago, JCPalmer said: Wondering if I even need the intra-strand spread @JCPalmer : Well Jeff it does allow for the adding of er ... " platinum, glitter, wisdom or stress highlights"... that us old folk get cheers, gryff Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted September 22, 2017 Author Share Posted September 22, 2017 Looks like both intra * inter are both public properties, so probably not a problem just keeping them. I have set the defaults to zero, though. I have not exposed intra yet in the scene with a slider of it own, but I loaded a version of the scene before & one after intra set to zero for side by side. @gryff, these 2 shots of "Light Brown" first with intra at 0.02, and second at zero. There is green in some of the strands. The definition of what these 2 spreads is different. Going to have to look at changing how intra is implemented. Stay tuned. FYI, since the values for the channel of the emissive color are maxed at 0.5, I increased the color to be 95% of the reference color from 80% as well. I thought it would lighten, but looks like the opposite happened. Still looks richer. Quote Link to comment Share on other sites More sharing options...
gryff Posted September 23, 2017 Share Posted September 23, 2017 @JCPalmer : Well I watch with interest Jeff. I just tweaked the color spread slider - which did not seem to differentiate between intra/inter to the casual observer. Mind you, can you produce something like this: Hair Streaks As I walk around downtown I see that there are many young ladies into that type of hair coloring cheers, gryff Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.