Content deleted Content added
No edit summary Tags: Reverted Mobile edit Mobile web edit |
Jim McKeeth (talk | contribs) added Infobox and unofficial logo |
||
(10 intermediate revisions by 9 users not shown) | |||
Line 2:
{{distinguish|Open Shading Language}}
{{Infobox software
| name = GLSL
| title = GLSL
| logo = GLSL_Logo_(Unofficial).svg
| logo size = x64px
| logo caption = ''Unofficial logo''
| screenshot =
| caption =
| collapsible =
| author = [[OpenGL ARB]]
| developer = [[Khronos Group]]
| released = {{Start date and age|2002|07|24}} (as an extension)
| discontinued =
| latest_release_version = 4.60.8
| latest_release_date = {{Start date and age|2023|08|14}}<ref>{{cite web|url=https://registry.khronos.org/OpenGL/specs/gl/GLSLangSpec.4.60.html|title=The OpenGL® Shading Language, Version 4.60.8}}</ref>
| latest preview version =
| latest preview date = <!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} -->
| programming language =
| operating_system =
| platform = [[Cross-platform]]
| size =
| genre = [[Programming Language]]
| license =
| website =
| standard =
| AsOf =
}}
[[File:Linux kernel and OpenGL video games.svg|thumb|[[Video games]] outsource rendering calculations to the [[Graphics processing unit|GPU]] over [[OpenGL]] in real-time. Shaders are written in '''OpenGL Shading Language''' and compiled. The compiled programs are executed on the GPU.]]
'''OpenGL Shading Language''' ('''GLSL''') is a [[High level programming language|high-level]] [[shading language]] with a syntax based on the [[C (programming language)|C programming language]]. It was created by the [[OpenGL ARB]] (OpenGL Architecture Review Board) to give developers more direct control of the [[graphics pipeline]] without having to use [[ARB assembly
==Background==
Line 89 ⟶ 117:
GLSL defines a subset of the [[C preprocessor]] (CPP), combined with its own special directives for specifying versions and OpenGL extensions. The parts removed from CPP are those relating to file names such as {{code|#include}} and {{code|__FILE__}}.<ref>{{cite book |title=OpenGL Programming Guide: The Official Guide to Learning OpenGL, Version 4.3, Eighth Edition |url=https://www.oreilly.com/library/view/opengl-programming-guide/9780132748445/ch02lev2sec5.html |language=en |chapter=Shader Preprocessor}}</ref>
The {{code|GL_ARB_shading_language_include}} extension<ref>{{cite web |title=ARB_shading_language_include |url=https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_shading_language_include.txt |website=Khronos.org |access-date=2020-05-31}}</ref> (implemented for example in Nvidia drivers<ref>{{cite web |title=NVIDIA driver 265.90 WHQL Quadro |url=https://forums.laptopvideo2go.com/topic/27639-nvidia-driver-26590-whql-quadro/?tab=comments#comment-134520 |archive-url=https://web.archive.org/web/20210308165926/https://forums.laptopvideo2go.com/topic/27639-nvidia-driver-26590-whql-quadro/?tab=comments#comment-134520 |url-status=dead |archive-date=March 8, 2021 |website=LaptopVideo2Go Forums }}</ref> on Windows and Linux, and all Mesa 20.0.0<ref>{{cite web |title=Mesa 20.0.0 Release Notes / 2020-02-19 |url=https://www.mesa3d.org/relnotes/20.0.0.html |website=www.mesa3d.org |access-date=2020-05-31 |archive-date=2020-05-12 |archive-url=https://web.archive.org/web/20200512220620/https://mesa3d.org/relnotes/20.0.0.html |url-status=dead }}</ref> drivers on Linux, FreeBSD and Android) implements ability to use {{code|#include}} in source code, allowing easier sharing of code and definitions between many shaders without extra manual pre-processing. Similar extension {{code|GL_GOOGLE_include_directive}} and {{code|GL_GOOGLE_cpp_style_line_directive}} exist for using GLSL with Vulkan, and are supported in reference SPIR-V compiler ({{code|glslang}} aka glslangValidator).<ref>{{cite web |title=#include directive support by antiagainst · Pull Request #46 · KhronosGroup/glslang |url=https://github.com/KhronosGroup/glslang/pull/46 |website=GitHub |access-date=2020-05-31 |language=en}}</ref><ref>{{cite web |title=Preprocessing line number handling by antiagainst · Pull Request #38 · KhronosGroup/glslang |url=https://github.com/KhronosGroup/glslang/pull/38 |website=GitHub |language=en}}</ref><ref>{{cite web |title=Extend the syntax of #line and __FILE__ to support filename strings by antiagainst · Pull Request #43 · KhronosGroup/glslang |url=https://github.com/KhronosGroup/glslang/pull/43 |website=GitHub |language=en}}</ref>
==Compilation and execution==
Line 117 ⟶ 145:
*[[ARB assembly language]], a low-level shading language
*[[Cg (programming language)|Cg]], a high-level shading language for programming vertex and pixel shaders
*[[High-Level Shader Language|HLSL]], a high-level shading language for use with [[Direct3D]] and [[SPIR-V]]
*[[TGSI]], a low-level intermediate language introduced by [[Gallium3D]]
*[[AMDIL]], a low-level intermediate language used internally at AMD
*[[RenderMan Shading Language]]
*[[WebGPU Shading Language|WGSL]], a shading language with a Rust-like syntax for WebGPU originally based on [[SPIR-V]]
*[[Metal (API)|Metal Shading Language]], a shading language used with [[Apple Inc.|Apple]] platform's proprietary Metal [[Graphics API]]<ref>{{cite web|url=https://developer.apple.com/metal/Metal-Shading-Language-Specification.pdf]|title=Metal Shading Language Specification Version 3.2}}</ref>
*[[Open Shading Language]], a shading language developed by [[Sony Pictures Imageworks]]
== References ==
Line 146 ⟶ 176:
[[Category:OpenGL]]
[[Category:Shading languages]]
[[Category:Virtual reality]]
|