Skip to content

Commit 56f8494

Browse files
committed
Update articles to use glsl over c as code highlighter for glsl
1 parent 5dea2c2 commit 56f8494

File tree

2 files changed

+4
-4
lines changed
  • blog/2024
    • 2024-10-17-glsl-development-made-shrimple
    • 2024-10-30-generating-phase-functions-luts-with-mieplot

2 files changed

+4
-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)

0 commit comments

Comments
 (0)