aboutsummaryrefslogtreecommitdiff
path: root/interactive/glsl-layout-calculator/index.html
blob: 22b3078ac68292a42643a6595222ab3f9cd86464 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<!DOCTYPE html>
<html>

  <head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>GLSL Layout Calculator</title>
	<link rel="stylesheet" href="style.css">
  </head>

  <body>
	<h2>GLSL Std140 and Std430 Layout Calculator</h2>
	<a href="https://jackjamison.net">by Jack Jamison</a>
	<br>
	<br>
	<div>
	  <textarea rows=20 cols=25 id="input"></textarea>
	  <textarea rows=20 cols=40 id="output" readOnly=true></textarea>
	  <br>
	  <select id="version_select" options=["one"]>
		<option value="std140" selected>Std 140</option>
		<option value="std430">Std 430</option>
	  </select><br>
	</div>

	<h2>Instructions</h2>
	<p>Write your declarations on the left, get your output on the right. For the most part, you can paste in GLSL code.<br><br>
	  You can define structs and uniform blocks with the syntax "#uniform <b>name</b>" or "#struct <b>name</b>".</p>

	<h2>About</h2>
	<p>This tool was made because tons of resources online about GLSL alignment are wrong, such as <a href="https://ptgmedia.pearsoncmg.com/images/9780321552624/downloads/0321552628_AppL.pdf">this one</a>.</p>
	<a href="https://registry.khronos.org/OpenGL/specs/gl/glspec46.core.pdf">For detailed rules, read the OpenGL spec, pages 146-147</a><br>
	<a href="https://github.com/JackJ30/glsl-alignment-calculator">Source code</a><br>

	<script type="text/javascript" src="odin.js"></script>
	<script type="text/javascript" src="index.js"></script>
  </body>

</html>