Shader Laboratory
843 subscribers
265 photos
15 videos
59 files
404 links
Shader Laboratory
a channel about shaders in telegram

ID : @smkgames

MyStack : goo.gl/smMuqe 😎👌
Download Telegram
Forwarded from Kamali
اینو با شیدرفورج ساختم ولی خب سر فرصت با شیدرگراف هم براتون میسازم
Forwarded from Alireza Tabasi
یک نکته ای رو در مورد شیدر استاندارد یونیتی و نحوه استفاده از اون رو من به بعضی دوستان گفتم ولی دیدم بازم رعایت نمیکنن.
گفتم توی یک پست کوتاه کمی درباره این قضیه بنویسم.

در یونیتی نسخه 5 شیدری به انجین اضافه شد به اسم standard shader که تمام متغییر های شیدر های مختلفی که توی سیستم قدیمی یونیتی بود رو کنار هم جمع کرد.
تقریبا میشه گفت با همین یک شیدر هرنوع متریالی رو میشه پیاده سازی کرد(مثل چوب- سنگ- آینه و...) اما نکته ای که گمراه کننده هست و اول پست بهش اشاره کردم اینه که استاندارد متریال چون تعداد زیادی متغییر و به طبعش محاسبات داره به نظر شیدر سنگین و نامناسبی برای بازی ها بخصوص بازی های موبایل میاد.
در حالی که شیدر های قدیمی یونیتی هم ورودی های کمتری میگیرن هم خیلی ظاهر ساده تری دارن.
اما برخلاف تصور اولیه استاندارد شیدر یونیتی اینطوری عمل میکنه که شما اگر متغییر هاشو دست نزنید(مقادیر اولیه متغییر ها) و یا هرجا که احتیاج به تکسچر داره رو بهش نسبت ندید خودش اون محاسبات رو پشت پرده حذف و شیدر خودکار برای اون متریال مورد نظر شما اپتیمایز میشه.

تکه ای از داکیومنت یونیتی بخش Standard Shader.

"Its features are enabled or disabled by simply using or not using the various texture slots and parameters in the material editor.
Standard shader is data-driven: Unity will only use the shader code required by the configuration the user has set for the material. In other words if a feature or texture slot of the material is not used, there is no cost for it and the shader combination is optimised behind the scenes."

منبع:
https://docs.unity3d.com/Manual/shader-StandardShader.html

https://docs.unity3d.com/Manual/StandardShaderContextAndContent.html
Alireza Tabasi
یک نکته ای رو در مورد شیدر استاندارد یونیتی و نحوه استفاده از اون رو من به بعضی دوستان گفتم ولی دیدم بازم رعایت نمیکنن. گفتم توی یک پست کوتاه کمی درباره این قضیه بنویسم. در یونیتی نسخه 5 شیدری به انجین اضافه شد به اسم standard shader که تمام متغییر های شیدر…
تو شیدر استاندارد از shader_feature استفاده شده به اینا میگن preprocessor directives

shader_feature is very similar to multi_compile. The only difference is that Unity does not include unused variants of shader_feature shaders in the final build. For this reason, you should use shader_feature for keywords that are set from the Materials, while multi_compile is better for keywords that are set from code globally.

ما یک چیز دیگه هم داریم به نام مولتی کامپایل که باعث میشه یک شیدر به چند حالت مختلف کامپایل بشه

https://docs.unity3d.com/Manual/SL-MultipleProgramVariants.html


https://blogs.unity3d.com/2018/05/14/stripping-scriptable-shader-variants/
Shader Laboratory
https://github.com/dmnsgn/glsl-tone-map
https://www.shadertoy.com/view/WdjSW3

- Red: Reinhard
- Purple: Modified Reinhard
- Orange: GT
- Blue: ACES
- Green: Unreal 3 matched to ACES
- Pink: GT with different parameters
- Yellow: AMD matched to ACES

#hdr #tonemapping #tonecurves
https://www.shadertoy.com/view/4tXyDB

Animation showing how to generate a hexagonal grid, or partitioning. Visually explaining the process.

#animation #mod #floor #hexagons