1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

docs: add link to shader inclusion example (#12613)

This commit is contained in:
Larpon
2021-11-29 17:26:32 +01:00
committed by GitHub
parent 0f59d88ba6
commit 83260e5074
6 changed files with 17 additions and 104 deletions

View File

@@ -9,25 +9,8 @@
* Example .obj model of V from SurmanPP
*
* HOW TO COMPILE SHADERS:
* - download the sokol shader convertor tool from https://github.com/floooh/sokol-tools-bin
*
* - compile the .glsl shader with:
* linux : sokol-shdc --input gouraud.glsl --output gouraud.h --slang glsl330
* windows: sokol-shdc.exe --input gouraud.glsl --output gouraud.h --slang glsl330
*
* --slang parameter can be:
* - glsl330: desktop GL
* - glsl100: GLES2 / WebGL
* - glsl300es: GLES3 / WebGL2
* - hlsl4: D3D11
* - hlsl5: D3D11
* - metal_macos: Metal on macOS
* - metal_ios: Metal on iOS device
* - metal_sim: Metal on iOS simulator
* - wgpu: WebGPU
*
* you can have multiple platforms at the same time passing parameters like this: --slang glsl330:hlsl5:metal_macos
* for further infos have a look at the sokol shader tool docs.
* Run `v shader .` in this directory to compile the shaders.
* For more info and help with shader compilation see `docs.md` and `v help shader`.
*
* ALTERNATIVE .OBJ MODELS:
* you can load alternative models putting them in the "assets/model" folder with or without their .mtl file.
@@ -50,7 +33,7 @@ import obj
// GLSL Include and functions
#flag -I @VMODROOT/.
#include "gouraud.h" #Please use sokol-shdc to generate the necessary rt_glsl.h file from rt_glsl.glsl (see the instructions at the top of this file)
#include "gouraud.h" # Should be generated with `v shader .` (see the instructions at the top of this file)
fn C.gouraud_shader_desc(gfx.Backend) &C.sg_shader_desc