#thankfully i just needed to plug in a remap node
Explore tagged Tumblr posts
cerbreus · 5 months ago
Text
Tumblr media
today has been. a work day.
#i swear to god i gotta ask the new coworker every 2 to 3 days about something i broke and how to fix it in the shaders#i wish i could just find the answers with google but i literally spent an hour and didn't come away with anything useful#i had to plug in random nodes to see if any of them worked#finally landed on one that halfway worked but it required me to change the input min value#which is a no-no because that value is directly input into a script function#thankfully i knew better than to just let 'er rip#this is the 4th time with this (my) shader that i've had to fix something gone awry#all this just to have alpha clipping on the textures#thankfully i just needed to plug in a remap node#but it feels rly embarrassing to run into so many really common issues#waughh <- guy who just read basic documentation#and has just been mish-mashing bits and pieces from forums and tutorials to get things to work#i really ought to take a course on shadergraph... and substance designer... and lighting...#maybe i can convince my boss to let me go on a sabbatical and just take a bunch of courses#sadly it feels like everyone (justifiably) is shifting away from unity development#and now that our lead left it seems unlikely we'll be leaving behind unity for any other engine until we're forced to#it feels like it's getting tougher to find answers for the ever narrowing field that is unity VR mixed reality development#*artist resources specifically because like. internet seems chock full of programming ones but im not one of those#personal stuff#its only tuesday...
2 notes · View notes
volno · 5 months ago
Note
Hello! I've been playing around with some bg3 (3D) fanart and I just wanted to say your texture toolbox is absolutely game-changing. Thank you so much for building it! Even just looking through how the skin shader works has been fantastic for learning more about shading systems
I also wanted to ask, if I wanted to, for experimentation sake, similarly reverse engineer a game shader, say just for skin or clothes or whatever - where would I... begin to look at how the in-game shaders are constructed? I know that's kind of a huge question, so no problem at all if you can't answer, I just wanted to give it a shot.
Thanks again!
heya! I'm always glad to hear that people have been enjoying the toolbox. Initially, everything I made was based off of guess work, then later on, Norbyte gave me some decompiled versions of the shaders which I then had to basically translated from GLSL into Blender nodes, which was its own challenge. But thankfully, with the toolkit released, we now have a much easier option: the Material Editor.
To open up an existing Material in the editor, right click on it and select the 'Open in editor' option. The editor is node based, just like Blender's editor, but goes from right to left instead of left to right. Its also currently broken! (yay) because of this you won't be able to compile any materials, you'll also notice that the material preview is broken, so that's fun. There isn't really a viable way around any of this until Larry Anne™ fixes it, but thankfully all you need the editor for is to see how the material is put together.
Now that you've got the shader graph open, you can begin the task of replicating it in Blender; word of advice, not everything has a Blender equivalent. You will inevitably have to take some artistic liberties with it. But, I've already done some of the hard work for you, under the tab you'll find the notes I made while remaking the hair shader, hope this helps!
Toolkit on the left, Blender on the right:
Lerp = mix node
Component mask = separate rgb/xyz
Negate = multiply node (A) = -1.0 (B) = var
Remap = map range
Smooth step = also map range (set to smooth step)
Colour ramp with a LUT input = god fucking help you
Camera Vector = Camera Data (?)
Transform direction = vector transform
world normal = texture coordinates object info plugged into a vector transform node set to normal, object, world
Dither Temporal AA Node = there is no god here
When a clamp(0.0, 1.0) is needed you just need to tick the 'clamp' box on the node in blender. Other wise you can use the clamp node. If its a vector, you will need to separate the xyz cords, then clamp each of them, before combining the cords again.
Blender has separate math nodes for vectors and floats, vector math nodes don't have the same amount of option as floats + don't support vec4s*. You will need to make use of the separate xyz node when required. For operations on vec4s, do all of the operations via the vec3 vector math nodes, and have an additional float value for the missing vector follow along and copy the operations done on the vec3s like some sort of node pilot fish.
*blender does use vec4s but only for colour nodes. You can't actually access or do anything with that 4th vector though. When a vector output is plugged into a colour input, blender adds an additional a hidden alpha channel to the colour. When a colour output is plugged into a vector input, this hidden alpha channel is discarded.
5 notes · View notes