Skip to content

Commit

Permalink
Updated side navigation and test new code blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
Froyok authored Dec 5, 2023
1 parent 212d5da commit 0416ed6
Show file tree
Hide file tree
Showing 46 changed files with 372 additions and 1 deletion.
20 changes: 19 additions & 1 deletion gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,25 @@ module.exports = {
},
{
title: "Shader API",
path: "/api/"
path: "/api/",
pages: [
{
title : "Changelog",
path: "/api/changelog/",
},
{
title : "Libraries",
path: "/api/libraries/",
},
{
title : "Parameters",
path: "/api/parameters/",
},
{
title : "Shaders",
path: "/api/shaders/",
}
]
},
]
},
Expand Down
1 change: 1 addition & 0 deletions src/pages/api/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ keywords:



<CodeBlock languages="glsl"/>



Expand Down
2 changes: 2 additions & 0 deletions src/pages/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ In Substance 3D Painter, you can write your own shaders in *GLSL*. We allow



<CodeBlock languages="glsl"/>
```glsl
void shade(V2F inputs) {
diffuseShadingOutput(vec3(1.0, 0.0, 1.0));
Expand Down Expand Up @@ -159,6 +160,7 @@ You can declare additional non required information to give some hint to the



<CodeBlock languages="glsl"/>
```glsl
//: metadata {
//: "key1":"value1",
Expand Down
6 changes: 6 additions & 0 deletions src/pages/api/libraries/lib-alpha.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ keywords:



<CodeBlock languages="glsl"/>



Expand All @@ -46,6 +47,7 @@ keywords:



<CodeBlock languages="glsl"/>
```glsl
Expand All @@ -65,6 +67,7 @@ Opacity map, provided by the engine.



<CodeBlock languages="glsl"/>
```glsl
//: param auto channel_opacity
uniform SamplerSparse opacity_tex;
Expand All @@ -84,6 +87,7 @@ Alpha test threshold.



<CodeBlock languages="glsl"/>
```glsl
//: param custom {
//: "default": 0.33,
Expand All @@ -109,6 +113,7 @@ Alpha test dithering.



<CodeBlock languages="glsl"/>
```glsl
//: param custom {
//: "default": false,
Expand All @@ -134,6 +139,7 @@ Emulate alpha test : discard current fragment if



<CodeBlock languages="glsl"/>
```glsl
void alphaKill(float alpha)
{
Expand Down
2 changes: 2 additions & 0 deletions src/pages/api/libraries/lib-bayer.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ keywords:



<CodeBlock languages="glsl"/>



Expand All @@ -46,6 +47,7 @@ keywords:



<CodeBlock languages="glsl"/>
```glsl
float bayerMatrix8(uvec2 coords) {
return (float(bayer(coords.x, coords.y)) + 0.5) / 64.0;
Expand Down
4 changes: 4 additions & 0 deletions src/pages/api/libraries/lib-bent-normal.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ keywords:



<CodeBlock languages="glsl"/>



Expand Down Expand Up @@ -52,6 +53,7 @@ Import from library



<CodeBlock languages="glsl"/>
```glsl
Expand Down Expand Up @@ -104,6 +106,7 @@ Helper to compute the bent normal from tangent space normal given by



<CodeBlock languages="glsl"/>
```glsl
vec3 computeWSBentNormal(SparseCoord coord, vec3 tangent, vec3 bitangent, vec3 normal)
{
Expand Down Expand Up @@ -131,6 +134,7 @@ Compute bent normals



<CodeBlock languages="glsl"/>
```glsl
void computeBentNormal(inout LocalVectors vectors, V2F inputs) {
if (use_bent_normal) {
Expand Down
7 changes: 7 additions & 0 deletions src/pages/api/libraries/lib-coat.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ keywords:



<CodeBlock languages="glsl"/>



Expand All @@ -50,6 +51,7 @@ Import from library



<CodeBlock languages="glsl"/>
```glsl
```
Expand All @@ -68,6 +70,7 @@ All engine parameters useful for coat.



<CodeBlock languages="glsl"/>
```glsl
//: param custom {
//: "group": "Coat",
Expand Down Expand Up @@ -114,6 +117,7 @@ Import from library



<CodeBlock languages="glsl"/>
```glsl
Expand All @@ -133,6 +137,7 @@ Compute an f0 at the interface between to materials from their indices of refrac



<CodeBlock languages="glsl"/>
```glsl
float iorToSpecularLevel(float iorFrom, float iorTo)
{
Expand All @@ -155,6 +160,7 @@ Return the coat normal in world space.



<CodeBlock languages="glsl"/>
```glsl
vec3 getWSCoatNormal(SparseCoord coord, vec3 tangent, vec3 bitangent, vec3 normal)
{
Expand Down Expand Up @@ -183,6 +189,7 @@ Compute the approximate colored coat absorption for a given view direction.



<CodeBlock languages="glsl"/>
```glsl
vec3 coatPassageColorMultiplier(vec3 coatColor, float coatOpacity, float ndv)
{
Expand Down
4 changes: 4 additions & 0 deletions src/pages/api/libraries/lib-defines.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ keywords:



<CodeBlock languages="glsl"/>



Expand All @@ -50,6 +51,7 @@ keywords:



<CodeBlock languages="glsl"/>
```glsl
#ifndef uniform_specialization
#define uniform_specialization uniform
Expand All @@ -70,6 +72,7 @@ Some useful constants



<CodeBlock languages="glsl"/>
```glsl
const float M_PI = 3.14159265;
const float M_2PI = 2.0 * M_PI;
Expand All @@ -92,6 +95,7 @@ Blending modes constants



<CodeBlock languages="glsl"/>
```glsl
const int BlendingMode_Disable = 0;
const int BlendingMode_Replace = 1;
Expand Down
5 changes: 5 additions & 0 deletions src/pages/api/libraries/lib-emissive.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ keywords:



<CodeBlock languages="glsl"/>



Expand All @@ -49,6 +50,7 @@ Import from library



<CodeBlock languages="glsl"/>
```glsl
```
Expand All @@ -67,6 +69,7 @@ The emissive channel texture.



<CodeBlock languages="glsl"/>
```glsl
//: param auto channel_emissive
uniform SamplerSparse emissive_tex;
Expand All @@ -86,6 +89,7 @@ A value used to tweak the emissive intensity.



<CodeBlock languages="glsl"/>
```glsl
//: param custom {
//: "default": 1.0,
Expand Down Expand Up @@ -113,6 +117,7 @@ Compute the emissive radiance to the viewer's eye



<CodeBlock languages="glsl"/>
```glsl
vec3 pbrComputeEmissive(SamplerSparse emissive, SparseCoord coord)
{
Expand Down
6 changes: 6 additions & 0 deletions src/pages/api/libraries/lib-env.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ keywords:



<CodeBlock languages="glsl"/>



Expand All @@ -51,6 +52,7 @@ Needed for math constants



<CodeBlock languages="glsl"/>
```glsl
```
Expand All @@ -69,6 +71,7 @@ Engine provided parameters



<CodeBlock languages="glsl"/>
```glsl
//: param auto texture_environment
uniform sampler2D environment_texture;
Expand Down Expand Up @@ -101,6 +104,7 @@ Helper that allows one to sample environment. Rotation is taken into



<CodeBlock languages="glsl"/>
```glsl
vec3 envSample(vec3 dir, float lod)
{
Expand Down Expand Up @@ -128,6 +132,7 @@ Transform a direction from world to environment space



<CodeBlock languages="glsl"/>
```glsl
vec3 worldToEnvSpace(vec3 dirW)
{
Expand All @@ -151,6 +156,7 @@ Return the irradiance for a given direction. The computation is based on



<CodeBlock languages="glsl"/>
```glsl
vec3 envIrradiance(vec3 dirW)
{
Expand Down
Loading

0 comments on commit 0416ed6

Please sign in to comment.