Skip to content

Commit a1f4c8d

Browse files
authored
Merge pull request #25 from deccer/main
This PR enables glsl as a valid code highlighter in markdown code blocks
2 parents 65a0b28 + 56f8494 commit a1f4c8d

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

blog/2024/2024-10-17-glsl-development-made-shrimple/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Writing the same structure definitions for buffers in both C or C++ and GLSL is
6161
is to abuse macros. It also requires shading language includes.
6262

6363
The first step is to write a "shared header" of common definitions that can be understood by both GLSL and C++. This file is split into sections that are only compiled in one language or the other:
64-
```c
64+
```glsl
6565
#ifndef COMMON_H
6666
#define COMMON_H
6767
@@ -83,7 +83,7 @@ The first step is to write a "shared header" of common definitions that can be u
8383
```
8484

8585
The second step is to put structure definitions in a file that both languages understand. This can be a separate header, or in the body of the shader itself. For an example of the latter:
86-
```c
86+
```glsl
8787
// Common section
8888
#include "Common.h"
8989

blog/2024/2024-10-30-generating-phase-functions-luts-with-mieplot/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ glm::vec3 MapToUnitSphere(glm::vec2 uv)
161161
162162
I suggest testing your normalization by plugging in a known-good analytical phase function like Henyey-Greenstein or Schlick's. These integrate to 1 and so don't require hacky normalization:
163163
164-
```cpp
164+
```glsl
165165
float phaseHG(float g, float cosTheta)
166166
{
167167
return (1.0 - g * g) / (4.0 * M_PI * pow(1.0 + g * g - 2.0 * g * cosTheta, 1.5));
@@ -180,7 +180,7 @@ After normalizing the data, we can put it into a 1D texture.
180180

181181
We only need to keep in mind that the our LUT-based phase function is parameterized by theta (unlike HG and Schlick above). Here's how you might access it in GLSL:
182182

183-
```c
183+
```glsl
184184
layout(binding = 0) uniform sampler1D s_phaseFunction;
185185
186186
vec3 phaseLut(float cosTheta)

docusaurus.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ const config: Config = {
133133
prism: {
134134
theme: prismThemes.duotoneLight,
135135
darkTheme: prismThemes.duotoneDark,
136+
additionalLanguages: [
137+
'glsl'
138+
]
136139
},
137140
} satisfies Preset.ThemeConfig,
138141
};

0 commit comments

Comments
 (0)