Open Shading Language for Blender

  Рет қаралды 28,789

CGMatter

CGMatter

Күн бұрын

Пікірлер: 125
@jeffdavies2824
@jeffdavies2824 Жыл бұрын
As a coder for 35+ years this really opens some doors for me. Once I realized that using blender shading nodes was just a metaphor for code, they made alot morse sense. With OSL, the gloves are off!
@nibblrrr7124
@nibblrrr7124 Жыл бұрын
Yeah, you can think of nodes like functional programming or shell pipelines.
@GreenMagic0
@GreenMagic0 Жыл бұрын
Is it worth it being a coder? What do you do? How much do you make a month?
@craigbaker6382
@craigbaker6382 Жыл бұрын
Million thanks to you for all your quirky and more normal tuts. You are a major influence on my interest in learning Blender as you are perhaps the best at actually demonstrating concepts and showing its potential while remaining entertaining.
@Topcatyo.
@Topcatyo. Жыл бұрын
I appreciate you describing what the parenthesis and brackets are for. So many coding tutorials I've watched have never done me the service of explaining such basic elements, and it immediately made me feel like I understood things 10x more once I knew.
@jeffdavies2824
@jeffdavies2824 Жыл бұрын
Fyi, VS Code has an OSL extension to help with editing Open Shader scripts called "OSL Support" that helps if you want to edit outside of blender. If you want to edit inside of blender, save your file with an .osl extension to get the correct highlighting.
@ojisan4220
@ojisan4220 Жыл бұрын
Thanks a lot CGMatter! But please, inside those Curly Braces, pls use tab for every statement you put there; just a C-style convention and it will make code much more readable
@pile333
@pile333 Жыл бұрын
That'a a natural evolution of geonodes; it should allow us to create less messy or tangled nodes. I guess we could have or customized nodes, am I right? Cool stuff as usual.
@kendarr
@kendarr Жыл бұрын
we can a group node, which is effectively a new node/costum node
@Soulskinner
@Soulskinner Жыл бұрын
It's actually the opposite, kinda. Because Geonodes is rather "visual scripting", or something like this. Like you could write various scripts to generate geometry in Blender, and now you can just use nodes. OSL... Actually, it was in Blender for a long time (at least, I saw some semi-tutorials on it). But rather as "experimental" feature. It looks like, they added it to "supported" category. Interesting thing is that it's not Blender exclusive thing, but something like open standard, used by various renderers. For example, 3Delight uses it now days. Before, it used RSL (Renderman Shading Language). But I don't really know how useful it is, now days. And how hard it is. Like it (RSL) was really technical, because you was writing all the math behind shaders. Yep. Shading models, generated textures and all the other stuff. Meanwhile, considering that usually PBR are used... But on the other hand, it looks like, it can be really useful for creating various shader nodes, to be used with other ones. Which can be easier, and maybe even much more productive. (And fun?)
@centdemeern1
@centdemeern1 Жыл бұрын
While I’m probably not going to learn much from this series myself, since I’ve already worked with tons of other programming languages (including shader languages like GLSL and GDSL), I do appreciate that you’re making this more accessible to everyone! Keep it up!
@nrdkraft
@nrdkraft Жыл бұрын
Wonderful! I remember hearing about OSL years ago. I even have a blend file that has something to do with it but I don’t remember if it was a download from somewhere or what. I knew it was something I needed because sometimes you need something more than a node group will provide. But I never saw anyone explain how to even do anything about it, and I forgot about it, so I’m glad someone is finally doing something about that, thank you! Definitely looking forward to the rest of the series!
@Heavenira
@Heavenira Жыл бұрын
i never clicked so hard on one of your tutorials. ever since you half-assed that OSL Fractal Shader tutorial, I've been dying for a proper OSL tutorial. So happy you are teaching this!!!
@shimoricha
@shimoricha Жыл бұрын
i think i've seen dedouze use this, but i never know what it was. thanks a lot for this
@cineblazer
@cineblazer Жыл бұрын
Ah heck yeah, as a programmer I'm insanely impressed with how good you are at explaining complex topics like this. Genuinely super excited for the rest of this series, you're making a super useful contribution to the internet!
@umbrella0148
@umbrella0148 Жыл бұрын
Thanks this is going to be really useful, I wonder why others don’t talk about it, looks supe4 powerful.
@bertboerland
@bertboerland Жыл бұрын
I am active in a couple of opensource projects, most are by and for developers. And hence code is not something dirty (in a bad way :")). Blender is differnet in the way that a very high percentage of the users cant code. By it self fine, but different
@umbrella0148
@umbrella0148 Жыл бұрын
you're right, i guess it not many ppl want to give it a try. Thank u for supporting opensource projects. I dont know how to code but i see the potential in the OSL so here i go!
@AsirisC
@AsirisC Жыл бұрын
This is great! Finally, someone explaining the basics of OSL shading. It's super helpful. I'd love to see the process of converting or adapting OSL shaders made for Octane/Redshift to Cycles. Understand what the difference of making OSL for different render engines if any and how to properly convert them. Thanks a lot for the series!
@veecel
@veecel Жыл бұрын
According to the official documentation, OSL shaders made for other renderers should ostensibly work for Cycles.
@Derpduck.
@Derpduck. Жыл бұрын
Alright I've cleared my whole week. I'm putting on my coding glasses.
@valovanonym
@valovanonym Жыл бұрын
That's a quite old reference. I miss the silly fast tuts!
@Derpduck.
@Derpduck. Жыл бұрын
@@valovanonym Same
@shitshow_1
@shitshow_1 Жыл бұрын
Duality of a Graphics Developer 🥸
@Vidyut_Gore
@Vidyut_Gore Жыл бұрын
Oh god, I needed this so much. I'm new to blender and pulling my hair out figuring out how to do what. The zoom locks weirdly, typing x to indicate axis threatens to delete objects if my mouse was outside the area when I typed the g or r or s or whatever... and the nodes don't make any sense beyond the basic texture stuff. Coding is way easier. Can totally imagine randomising being really simple like this. Say... for instance colours. You've probably prevented my breakup with blender. Nah. i wouldn't have given up, but this makes things simpler.
@004307ec
@004307ec Жыл бұрын
I have used OSL to create some fractal textures. They are quite fast even on CPU (compared to a slightly optimized Numpy implementation) but the downside is that they are based on float32, which limits the zoom.
@tiagotiagot
@tiagotiagot Жыл бұрын
It doesn't support doubles?
@004307ec
@004307ec Жыл бұрын
@@tiagotiagot According to the language specification, `double` is reserved as a keyword but not in use currently, and float is " guaranteed to be at least IEEE 32-bit float (the standard C float data type)". And Blender mainly use float32 for calculation (based on a post in the Blender Developer Forum)
@Confuseddave
@Confuseddave Жыл бұрын
This is my main experience with OSL too, and also frustrated by the lack of double precision floats.
@ViktorPochtalion
@ViktorPochtalion Жыл бұрын
Always something new with you. Thank you
@Taiterio
@Taiterio Жыл бұрын
Was looking forward to this one to show a friend, thank you!
@רפאל-ב
@רפאל-ב Жыл бұрын
Really excited for this series!
@UnderfundedScientist
@UnderfundedScientist Жыл бұрын
Loving the addition of code to the wheel house
@jeromyperez5532
@jeromyperez5532 5 ай бұрын
You are so awesome for doing this video for people. Thank you for taking your time.
@רפאל-ב
@רפאל-ב Жыл бұрын
That's awesome! I actually wanted to use it for a long time but haven't because I didn't understand how it works
@darrennew8211
@darrennew8211 Жыл бұрын
Now here's a tutorial series I can get into. Excellent!
@johnsondigitalmedia
@johnsondigitalmedia Жыл бұрын
ChatGPT baby. shader metalSurface( color BaseColor = color(0.9, 0.9, 0.9), float Roughness = 0.1, float Metalness = 0.9, float RustLevel = 0.5, float ScratchesLevel = 0.2, color RustColor = color(0.8, 0.2, 0.2), color ScratchesColor = color(0.7, 0.7, 0.7) ) { normal N = normalize(N); point P = transform("shader", P); vector V = normalize(I); vector R = reflect(V, N); // Calculate ambient occlusion float ao = 1 - ambientocclusion("samples", 16, "maxdist", 1); // Calculate diffuse color color diffuse = mix(BaseColor, RustColor, RustLevel) * (1 - Metalness) + Metalness; // Calculate specular reflection color specular = mix(color(0.04, 0.04, 0.04), color(1, 1, 1), Metalness) * pow(clamp(dot(R, V), 0, 1), 1/(Roughness*Roughness)); // Calculate scratches float scratches = noise(P * 10) * ScratchesLevel; scratches = pow(scratches, 2); // Combine all components Ci = diffuse * ao + specular * ao + ScratchesColor * scratches; }
@veecel
@veecel Жыл бұрын
While ChatGPT is a great tool, this code needs work. *N* is a global variable, so normal N = normalize(N); will produce an error: "N" already declared in this scope
@jayjohnson3878
@jayjohnson3878 Жыл бұрын
@@veecel yeah. As usual chatgpt needs a little help. It's still an infant. But it will soon be Skynet.
@olutukko2681
@olutukko2681 Жыл бұрын
This is going to make things quite different for me. For me it's just easier to write code than use visual blocks. And this seems like a simple way to use same properties on multiple files when everything is just on different script files
@asherspira
@asherspira Жыл бұрын
To boldly go... We're no Blender KZbinr has gone before... 🥁🎶🎷
@netkob
@netkob Жыл бұрын
Great to hear about shader programming !!!
@100_JAB
@100_JAB Жыл бұрын
this makes blender seem way more appealing as someone with a coding background
@AshT8524
@AshT8524 Жыл бұрын
Woah this is actually quite interesting, I can compress or make huge shader trees into just single node, and it might be more faster. I hope there is some possibility of optimizing processing time compared to normal nodes.
@neoluigi2078
@neoluigi2078 Жыл бұрын
OMG, I wanted to know what was this thing, I search on the internet but I found nothing, THANK you so much
@pushakargaikwad9402
@pushakargaikwad9402 Жыл бұрын
Great, looking forward to the next video in the series
@svogunelis5
@svogunelis5 Жыл бұрын
Thank you ! We needed tutorials about this !!
@onlyeyeno
@onlyeyeno Жыл бұрын
Thanks for this, and all Your other tutorials. Though I have a question/note regarding the "GPU compatibility" ? I'm on Linux (Pop OS 22.04), and to be able to enable GPU AND OSL I have to enable "OPTIX" in the "Edit>>Preferences >> system>>Cycles Render Devices". If I have it set at "CUDA" the "TickBox" for "Open Shading Language" disappears if I choose "Device GPU"... Is this a "Linux issue", or is it the same on other "platforms".... Or is it just "me" ??
@edgarhammond2252
@edgarhammond2252 Жыл бұрын
Same thing, I have a GeForce 1070 with CUDA enabled, if I enable GPU Complete then the open shading tick box goes away, still don't have an answer even now
@disruptive_innovator
@disruptive_innovator 11 ай бұрын
@@edgarhammond2252 Same card, very similar issue. No idea what's going wrong but this card is at the very bottom of the min spec. Hope it gets improvements eventually because according to NVIDIA, Optix should work on this class of card with new drivers.
@overlorde7526
@overlorde7526 Жыл бұрын
I'm super excited for this, just as you say, I've never seen a comprehensive introduction to OSL or any other SL in blender -aside from a video of yours from a while back-, and that's really a shame because this is really how I prefer to interact with code, as opposed to nodes
@RiceWitch-dingus-400
@RiceWitch-dingus-400 Жыл бұрын
I'm so glad blender recently made osl available for gpu!
@toapyandfriends
@toapyandfriends Жыл бұрын
What are some cool things that you can do with this?
@juncando
@juncando Жыл бұрын
Finally :D Been waiting for this.
@danialsoozani
@danialsoozani Жыл бұрын
#Respect for writing "abcd" instead of "asdf" :D Very cool tutorial, I've always wanted to know what is OSL in practice and what are its benefits... what are its benefits? formulating a complex set of nodes into one shader that is easy more compatible with other sofwares?
@CGMatter
@CGMatter Жыл бұрын
More compatible and loops
@danialsoozani
@danialsoozani Жыл бұрын
@@CGMatter Thanks! can't wait for the next one!
@PhotographyAdventure
@PhotographyAdventure Жыл бұрын
Great video! As a front-end developer, this really inspired me into learning more complex code 🙏🏼
@bobisatelier
@bobisatelier Жыл бұрын
please keep doing this series
@TheStrandedAlliance
@TheStrandedAlliance Жыл бұрын
Finally! I have been waiting for this. Why does no one mention this as a major feature? I'm always confused why shader code is so unpopular.
@gottagowork
@gottagowork Жыл бұрын
Because until recently it has been available for CPU only. Very few are willing to deal with that limitation.
@RealGaryGibson
@RealGaryGibson Жыл бұрын
Very cool! I had no idea this existed.
@Peter-JesusIsTheOnlyWay
@Peter-JesusIsTheOnlyWay Жыл бұрын
Thanks man, great tutorial. I know too little about Blender's scripting side. Please mind your language though, it's a bit unpleasant.
@pROaBDUR
@pROaBDUR Жыл бұрын
you shouldn't have lost the 'tache. you look cool in that!
@Simon2d3d
@Simon2d3d Жыл бұрын
Can you please bring back the thumbnails that describe what's happening in the video so we don't have to mouse over the preview?
@dan339dan
@dan339dan Жыл бұрын
First time I heard about Open Shading Language. So how's this compared to GLSL? And does Blender support GLSL programming?
@ransombot
@ransombot 11 ай бұрын
Not sure if you have ever thought of doing a follow up video on this. But this work flow works stupidly well with ChatGPT. The blender implementation is kinda bad. The play button being python instead of refreshing is confusing, having to be in the correct view or getting black renders is confusing. Not working in EEVEE is confusing. Hitting the run button and getting a python error that tells you nothing is confusing. But once you get it working it's awsome. shader FadeBetweenMasks( int HV = 0, // 0 for vertical, 1 for horizontal float FadeAmount = 0.5, color ImageA = 1, color ImageB = 0, color MaskA = 1, color MaskB = 1, output color OutColor = 0 ) { float fadeCoord; if (HV == 0) { // Vertical fade fadeCoord = (P.y + 0.5) / FadeAmount; } else { // Horizontal fade fadeCoord = (P.x + 0.5) / FadeAmount; } float fadeFactor = smoothstep(0, 1, fadeCoord); color maskedImageA = mix(ImageA, ImageB, fadeFactor); OutColor = mix(MaskA, MaskB, fadeFactor) * maskedImageA; } I got chat GPT to spit that out with some prompts. It's not exactly what I wanted first shot but with some mucking around you can get some complicated stuff in 1 node with some simple talking with GPT. You can also use GPT to say convert GLSL scripts to OSL It's not 100% but it does give you a lot of possibilities if you say like a shadertoy example. You can bake out the textures for use with eevee or other stuff once you get something you want.
@Di-ki-toys
@Di-ki-toys Жыл бұрын
Thank you bro
@Zhincore
@Zhincore Жыл бұрын
I always wanted to get into this! Thank you!
@blenderadd-ons
@blenderadd-ons Жыл бұрын
Dude... so inspiring! Thanks a lot
@YahyaArbab
@YahyaArbab 11 ай бұрын
It would be a better idea for beginners if you wrote all parameters in one line instead of separating them, so they are distinguished from the shader (or I guess function) body where we use semicolon.
@jenovaizquierdo
@jenovaizquierdo Жыл бұрын
Dude awesome, cannot wait for more..
@bradleyhenderson5482
@bradleyhenderson5482 Жыл бұрын
Honestly a god thank you so much for all you do ❤❤🎉
@valovanonym
@valovanonym Жыл бұрын
Always wanted to learn osl, thanks!
@S.Ateeb.A
@S.Ateeb.A Жыл бұрын
nice bro keep us update u r futures
@edgarhammond2252
@edgarhammond2252 Жыл бұрын
CUDA GPU Complete does not work, the tick box goes away
@motbus3
@motbus3 Жыл бұрын
Now we are talking babe
@jameshughes3014
@jameshughes3014 Жыл бұрын
I couldn't get OSL working with GPU in 3.5. If anyone's having this issue, I figured it out - go into edit>preferences>system and turn off your gpu for cuda, but then make sure its turned on for optix
@AHSEN.
@AHSEN. Жыл бұрын
CODING TUTORIAL! Yay! It was almost inevitable after all the AI tutorials :P P.S. CUDA support means Nvidia GPUs only
@notimportant7682
@notimportant7682 Жыл бұрын
I got my hopes up thinking that eevee was getting shader language support
@edgarhammond2252
@edgarhammond2252 Жыл бұрын
I'm using the blender 3.6 alpha, but I can't turn OSL on? I'm using CUDA GPU but there's no check?
@Sonicity_110
@Sonicity_110 Жыл бұрын
From walking to sit...king. idk man
@mynewan
@mynewan Жыл бұрын
This is perfect, so we can ask GPT5 for shaders
@pile333
@pile333 Жыл бұрын
Have you already tested it with geonodes?
@basspig
@basspig Жыл бұрын
Whenever I check the open shading language box the viewport freezes.
@Scrarf4
@Scrarf4 Жыл бұрын
I got jumpscared by a beardless face.
@hamuzhanhazretleri
@hamuzhanhazretleri Жыл бұрын
Finally, OSL for GPUs...
@JoaoVictor-vd9fn
@JoaoVictor-vd9fn Жыл бұрын
As someone who suffers everyday from studying programming, I am staying with the traditional nodes method 😅
@mtscott44
@mtscott44 Жыл бұрын
Good stuff. I'm close.
@the_devil_1230
@the_devil_1230 Жыл бұрын
Texture paint = easy , nodes = medium , Open shading language = hard.
@romanoban
@romanoban Жыл бұрын
what's the name of the programing lenguage u using here?
@TR-707
@TR-707 Жыл бұрын
coding...coding is it like the stuff you ask chatgpt to do? sorry im new
@puhf3328
@puhf3328 Жыл бұрын
Yay new CGM video
@question_mark
@question_mark Жыл бұрын
oh thank u so much
@fergadelics
@fergadelics Жыл бұрын
I’ve been using a shader that’s osl only for a while. It’s cool I can lean on the GPU now. Curious about this series.
@ritpop
@ritpop Жыл бұрын
Is gpt-4 good for this? I've been trying to use it for a while, but I'm used to the nodes
@veecel
@veecel Жыл бұрын
Yes, Chat GPT-4 is a great coding assistant for Blender.
@VadimVirvinsky
@VadimVirvinsky Жыл бұрын
you_know_i_am_something_of_a_programmer_myself.jpg
@thefreshest2379
@thefreshest2379 Жыл бұрын
Amazing!
@ahadhossin9912
@ahadhossin9912 Жыл бұрын
Gonna use chatgpt for this too :>
@jahormaksimau1597
@jahormaksimau1597 Жыл бұрын
This is great!
@UnderfundedScientist
@UnderfundedScientist Жыл бұрын
Is there going to be a have chat gpt make an insane node tutorial ?
@GabiN64
@GabiN64 Ай бұрын
Why cant you use osl for eevee? I prefer eevee
@nicks4727
@nicks4727 Жыл бұрын
is open shading language like GLSL?
@veecel
@veecel Жыл бұрын
They're both shading languages but there are a number of differences. GLSL shaders can be converted to OSL but that requires some work and know how.
@S9universe
@S9universe Жыл бұрын
thanks ♥
@1am228
@1am228 Жыл бұрын
Thank you Ed sheeran of blender
@patrickfoxchild2608
@patrickfoxchild2608 Жыл бұрын
COUNT ME INTERESTED
@pepperpe6716
@pepperpe6716 Жыл бұрын
Leeeets go
@zachhoy
@zachhoy Жыл бұрын
I get this error:OSL script compilation failed, see console for errors, anybody else? Tried CPU as well same thing :( Blender 3.5 stable
@MrNobodyX3
@MrNobodyX3 Жыл бұрын
YES
@ssartworks7396
@ssartworks7396 Жыл бұрын
can you give us a tutorial on how to render with google colab?
@naughtynome4491
@naughtynome4491 Жыл бұрын
neat
@bean_mhm
@bean_mhm Жыл бұрын
OSL lesgoo
@sergey6661313
@sergey6661313 13 күн бұрын
я пишу float a = 0 и у меня не появляется поле a в ноде. :(
@Main267
@Main267 Жыл бұрын
Oh neat. The last time I touched OSL was in 2.9 and saw it was CPU only so I threw that to the garbage bin. The performance hits for doing anything complex compared to the shader nodes themselves wasn't worth it.
@zyugyzarc
@zyugyzarc Жыл бұрын
damn glsl tutorials now? when are we gonna get to upbge lol
@vvill-ga
@vvill-ga 10 ай бұрын
But why not GLSL :(
@alexanderreyesbecerra7443
@alexanderreyesbecerra7443 Жыл бұрын
Try but don't let me say error in the compilation
@LoQueTeando
@LoQueTeando Жыл бұрын
could you use chat gpt to generate that code ???
@veecel
@veecel Жыл бұрын
Yes, Chat GPT-4 is a great coding assistant for Blender.
@marianobasti
@marianobasti Жыл бұрын
No need to learn the language, now we gon use GPT to write the shader
@CGMatter
@CGMatter Жыл бұрын
Exactly
Open Shading Language for Blender #2
7:30
CGMatter
Рет қаралды 9 М.
This is my last depth rant
6:28
CGMatter
Рет қаралды 31 М.
My Daughter's Dumplings Are Filled With Coins #funny #cute #comedy
00:18
Funny daughter's daily life
Рет қаралды 34 МЛН
龟兔赛跑:好可爱的小乌龟#short #angel #clown
01:00
Super Beauty team
Рет қаралды 65 МЛН
DID A VAMPIRE BECOME A DOG FOR A HUMAN? 😳😳😳
00:56
Open Shading Language 2023 Virtual Town Hall
1:00:21
Academy Software Foundation
Рет қаралды 690
50 Blender tips that will make your parents love you again
23:02
Joey Carlino
Рет қаралды 39 М.
Creating a Simple Archway in Blender
21:17
Max Hay
Рет қаралды 17 М.
10 Minutes vs. 10 Years of Animation
19:29
Isto Inc.
Рет қаралды 1,1 МЛН
Light Path Node Demystified and Visualized in Blender
23:26
Deayan Studios
Рет қаралды 48 М.
All Blender Render engines
9:12
InspirationTuts
Рет қаралды 176 М.
7 Ways to Make Lineart in Blender 4.0!
16:34
Vertex Arcade
Рет қаралды 120 М.
PBR Video for 3D!
8:27
CGMatter
Рет қаралды 129 М.
How I made this battle scene in blender
11:05
FxForge
Рет қаралды 684 М.
An introduction to Raymarching
34:03
kishimisu
Рет қаралды 147 М.