You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
</span><spanstyle="color:#b48ead;">let</span><spanstyle="color:#c0c5ce;"> p = clip_to_world.</span><spanstyle="color:#96b5b4;">mul_vec4</span><spanstyle="color:#c0c5ce;">(cs_pos);
</span><spanstyle="color:#b48ead;">let</span><spanstyle="color:#c0c5ce;"> dir = (ws_pos - eye_pos).</span><spanstyle="color:#96b5b4;">normalize</span><spanstyle="color:#c0c5ce;">();
769
+
</span><spanstyle="color:#b48ead;">let</span><spanstyle="color:#c0c5ce;"> color = </span><spanstyle="color:#96b5b4;">sky</span><spanstyle="color:#c0c5ce;">(dir, sun_pos); </span><spanstyle="color:#65737e;">// evaluate Preetham sky model
<p><ahref="https://github.com/EmbarkStudios/rust-gpu">Rust GPU</a> is a project backe
B41A
d by <ahref="https://www.embark-studios.com/">Embark Studios</a>
966
-
to make Rust a first-class language and ecosystem for building GPU code.</p>
967
-
<p>Although still in very early stages of development,
968
-
<ahref="https://github.com/EmbarkStudios/rust-gpu/releases/tag/v0.1">Rust GPU released v0.1 in October</a>,
969
-
and has already garnered over 2000 stars on Github.
970
-
Currently, compiling and running very simple shaders
971
-
works, and a significant portion of the core library also compiles. While things
972
-
like if-statements and while-loops are working, many things aren't implemented yet.
973
-
For example, for-loops, iterators and match/switch aren't supported yet. That
974
-
means that while being technically usable, Rust GPU is far from being
975
-
production-ready.</p>
976
-
<p>The motivation behind the project:</p>
977
-
<blockquote>
978
-
<p>Historically in games, GPU programming has been done through writing either
979
-
HLSL, or to a lesser extent GLSL. These are simple programming languages that
980
-
have evolved along with rendering APIs over the years. However, as game engines
981
-
have evolved, these languages have failed to provide mechanisms for dealing with
982
-
large codebases, and have generally stayed behind the curve compared to other
983
-
programming languages.</p>
984
-
<p>In part this is because it's a niche language for a niche market, and in part
985
-
this has been because the industry as a whole has sunk quite a lot of time and
986
-
effort into the status quo. While over-all better alternatives to both languages
987
-
exist, none of them are in a place to replace HLSL or GLSL. Either because they
988
-
are vendor locked, or because they don't support the traditional graphics
989
-
pipeline. Examples of this include CUDA and OpenCL. And while attempts have been
990
-
made to create language in this space, none of them have gained any notable
</span><spanstyle="color:#b48ead;">let</span><spanstyle="color:#c0c5ce;"> p = clip_to_world.</span><spanstyle="color:#96b5b4;">mul_vec4</span><spanstyle="color:#c0c5ce;">(cs_pos);
</span><spanstyle="color:#b48ead;">let</span><spanstyle="color:#c0c5ce;"> dir = (ws_pos - eye_pos).</span><spanstyle="color:#96b5b4;">normalize</span><spanstyle="color:#c0c5ce;">();
1004
-
</span><spanstyle="color:#b48ead;">let</span><spanstyle="color:#c0c5ce;"> color = </span><spanstyle="color:#96b5b4;">sky</span><spanstyle="color:#c0c5ce;">(dir, sun_pos); </span><spanstyle="color:#65737e;">// evaluate Preetham sky model
0 commit comments