Addeed screenshots and videos
This commit is contained in:
parent
fb65cde444
commit
3e7545ede8
@ -5,20 +5,42 @@
|
|||||||
Generated by sokol-shdc (https://github.com/floooh/sokol-tools)
|
Generated by sokol-shdc (https://github.com/floooh/sokol-tools)
|
||||||
|
|
||||||
Cmdline:
|
Cmdline:
|
||||||
sokol-shdc -i ./samples/cube-sapp.glsl -o F:\dev\luajit\Thunc\sokol-luajit\bin/shaderbin/shader_gen.h -l glsl410 -f sokol
|
sokol-shdc -i ./samples/offscreen-sapp.glsl -o F:\dev\luajit\Thunc\sokol-luajit\bin/shaderbin/shader_gen.h -l glsl410 -f sokol
|
||||||
|
|
||||||
Overview:
|
Overview:
|
||||||
=========
|
=========
|
||||||
Shader program: 'cube':
|
Shader program: 'default':
|
||||||
Get shader desc: cube_shader_desc(sg_query_backend());
|
Get shader desc: default_shader_desc(sg_query_backend());
|
||||||
Vertex shader: vs
|
Vertex shader: vs_default
|
||||||
Attributes:
|
Attributes:
|
||||||
ATTR_vs_position => 0
|
ATTR_vs_default_position => 0
|
||||||
ATTR_vs_color0 => 1
|
ATTR_vs_default_normal => 1
|
||||||
|
ATTR_vs_default_texcoord0 => 2
|
||||||
Uniform block 'vs_params':
|
Uniform block 'vs_params':
|
||||||
C struct: vs_params_t
|
C struct: vs_params_t
|
||||||
Bind slot: SLOT_vs_params => 0
|
Bind slot: SLOT_vs_params => 0
|
||||||
Fragment shader: fs
|
Fragment shader: fs_default
|
||||||
|
Image 'tex':
|
||||||
|
Image type: SG_IMAGETYPE_2D
|
||||||
|
Sample type: SG_IMAGESAMPLETYPE_FLOAT
|
||||||
|
Multisampled: false
|
||||||
|
Bind slot: SLOT_tex => 0
|
||||||
|
Sampler 'smp':
|
||||||
|
Type: SG_SAMPLERTYPE_FILTERING
|
||||||
|
Bind slot: SLOT_smp => 0
|
||||||
|
Image Sampler Pair 'tex_smp':
|
||||||
|
Image: tex
|
||||||
|
Sampler: smp
|
||||||
|
Shader program: 'offscreen':
|
||||||
|
Get shader desc: offscreen_shader_desc(sg_query_backend());
|
||||||
|
Vertex shader: vs_offscreen
|
||||||
|
Attributes:
|
||||||
|
ATTR_vs_offscreen_position => 0
|
||||||
|
ATTR_vs_offscreen_normal => 1
|
||||||
|
Uniform block 'vs_params':
|
||||||
|
C struct: vs_params_t
|
||||||
|
Bind slot: SLOT_vs_params => 0
|
||||||
|
Fragment shader: fs_offscreen
|
||||||
*/
|
*/
|
||||||
#if !defined(SOKOL_GFX_INCLUDED)
|
#if !defined(SOKOL_GFX_INCLUDED)
|
||||||
#error "Please include sokol_gfx.h before shader_gen.h"
|
#error "Please include sokol_gfx.h before shader_gen.h"
|
||||||
@ -30,9 +52,14 @@
|
|||||||
#define SOKOL_SHDC_ALIGN(a) __attribute__((aligned(a)))
|
#define SOKOL_SHDC_ALIGN(a) __attribute__((aligned(a)))
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#define ATTR_vs_position (0)
|
#define ATTR_vs_default_position (0)
|
||||||
#define ATTR_vs_color0 (1)
|
#define ATTR_vs_default_normal (1)
|
||||||
|
#define ATTR_vs_default_texcoord0 (2)
|
||||||
|
#define ATTR_vs_offscreen_position (0)
|
||||||
|
#define ATTR_vs_offscreen_normal (1)
|
||||||
#define SLOT_vs_params (0)
|
#define SLOT_vs_params (0)
|
||||||
|
#define SLOT_tex (0)
|
||||||
|
#define SLOT_smp (0)
|
||||||
#pragma pack(push,1)
|
#pragma pack(push,1)
|
||||||
SOKOL_SHDC_ALIGN(16) typedef struct vs_params_t {
|
SOKOL_SHDC_ALIGN(16) typedef struct vs_params_t {
|
||||||
hmm_mat4 mvp;
|
hmm_mat4 mvp;
|
||||||
@ -43,77 +70,201 @@ SOKOL_SHDC_ALIGN(16) typedef struct vs_params_t {
|
|||||||
|
|
||||||
uniform vec4 vs_params[4];
|
uniform vec4 vs_params[4];
|
||||||
layout(location = 0) in vec4 position;
|
layout(location = 0) in vec4 position;
|
||||||
layout(location = 0) out vec4 color;
|
layout(location = 0) out vec4 nrm;
|
||||||
layout(location = 1) in vec4 color0;
|
layout(location = 1) in vec4 normal;
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
gl_Position = mat4(vs_params[0], vs_params[1], vs_params[2], vs_params[3]) * position;
|
gl_Position = mat4(vs_params[0], vs_params[1], vs_params[2], vs_params[3]) * position;
|
||||||
color = color0;
|
nrm = normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
*/
|
*/
|
||||||
static const uint8_t vs_source_glsl410[284] = {
|
static const uint8_t vs_offscreen_source_glsl410[280] = {
|
||||||
0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x31,0x30,0x0a,0x0a,0x75,0x6e,
|
0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x31,0x30,0x0a,0x0a,0x75,0x6e,
|
||||||
0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x76,0x73,0x5f,0x70,0x61,
|
0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x76,0x73,0x5f,0x70,0x61,
|
||||||
0x72,0x61,0x6d,0x73,0x5b,0x34,0x5d,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,
|
0x72,0x61,0x6d,0x73,0x5b,0x34,0x5d,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,
|
||||||
0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x69,0x6e,
|
0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x69,0x6e,
|
||||||
0x20,0x76,0x65,0x63,0x34,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,
|
0x20,0x76,0x65,0x63,0x34,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,
|
||||||
0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,
|
0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,
|
||||||
0x3d,0x20,0x30,0x29,0x20,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x34,0x20,0x63,0x6f,
|
0x3d,0x20,0x30,0x29,0x20,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x34,0x20,0x6e,0x72,
|
||||||
0x6c,0x6f,0x72,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,
|
0x6d,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,
|
||||||
0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x31,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,
|
0x6f,0x6e,0x20,0x3d,0x20,0x31,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x34,0x20,
|
||||||
0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,
|
0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,
|
||||||
0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,
|
0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,
|
||||||
0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x6d,0x61,0x74,0x34,0x28,
|
0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x6d,0x61,0x74,0x34,0x28,0x76,0x73,
|
||||||
0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2c,0x20,0x76,0x73,
|
0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,
|
||||||
0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,
|
0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,
|
||||||
0x61,0x72,0x61,0x6d,0x73,0x5b,0x32,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,
|
0x61,0x6d,0x73,0x5b,0x32,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,
|
||||||
0x61,0x6d,0x73,0x5b,0x33,0x5d,0x29,0x20,0x2a,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,
|
0x73,0x5b,0x33,0x5d,0x29,0x20,0x2a,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,
|
||||||
0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,
|
0x3b,0x0a,0x20,0x20,0x20,0x20,0x6e,0x72,0x6d,0x20,0x3d,0x20,0x6e,0x6f,0x72,0x6d,
|
||||||
0x63,0x6f,0x6c,0x6f,0x72,0x30,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
|
0x61,0x6c,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
|
||||||
};
|
};
|
||||||
/*
|
/*
|
||||||
#version 410
|
#version 410
|
||||||
|
|
||||||
layout(location = 0) out vec4 frag_color;
|
layout(location = 0) out vec4 frag_color;
|
||||||
layout(location = 0) in vec4 color;
|
layout(location = 0) in vec4 nrm;
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
frag_color = color;
|
frag_color = vec4((nrm.xyz * 0.5) + vec3(0.5), 1.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
*/
|
*/
|
||||||
static const uint8_t fs_source_glsl410[135] = {
|
static const uint8_t fs_offscreen_source_glsl410[166] = {
|
||||||
0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x31,0x30,0x0a,0x0a,0x6c,0x61,
|
0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x31,0x30,0x0a,0x0a,0x6c,0x61,
|
||||||
0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,
|
0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,
|
||||||
0x30,0x29,0x20,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x34,0x20,0x66,0x72,0x61,0x67,
|
0x30,0x29,0x20,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x34,0x20,0x66,0x72,0x61,0x67,
|
||||||
0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,
|
0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,
|
||||||
0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x69,0x6e,0x20,
|
0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x69,0x6e,0x20,
|
||||||
0x76,0x65,0x63,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x0a,0x76,0x6f,0x69,
|
0x76,0x65,0x63,0x34,0x20,0x6e,0x72,0x6d,0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,
|
||||||
0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,
|
0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,
|
||||||
0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,
|
0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x28,
|
||||||
0x72,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
|
0x6e,0x72,0x6d,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x30,0x2e,0x35,0x29,0x20,0x2b,
|
||||||
|
0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x35,0x29,0x2c,0x20,0x31,0x2e,0x30,0x29,
|
||||||
|
0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
|
||||||
};
|
};
|
||||||
static inline const sg_shader_desc* cube_shader_desc(sg_backend backend) {
|
/*
|
||||||
|
#version 410
|
||||||
|
|
||||||
|
uniform vec4 vs_params[4];
|
||||||
|
layout(location = 0) in vec4 position;
|
||||||
|
layout(location = 1) out vec2 uv;
|
||||||
|
layout(location = 2) in vec2 texcoord0;
|
||||||
|
layout(location = 0) out vec4 nrm;
|
||||||
|
layout(location = 1) in vec4 normal;
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
mat4 _22 = mat4(vs_params[0], vs_params[1], vs_params[2], vs_params[3]);
|
||||||
|
gl_Position = _22 * position;
|
||||||
|
uv = texcoord0;
|
||||||
|
nrm = _22 * normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
*/
|
||||||
|
static const uint8_t vs_default_source_glsl410[400] = {
|
||||||
|
0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x31,0x30,0x0a,0x0a,0x75,0x6e,
|
||||||
|
0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x76,0x73,0x5f,0x70,0x61,
|
||||||
|
0x72,0x61,0x6d,0x73,0x5b,0x34,0x5d,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,
|
||||||
|
0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x69,0x6e,
|
||||||
|
0x20,0x76,0x65,0x63,0x34,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,
|
||||||
|
0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,
|
||||||
|
0x3d,0x20,0x31,0x29,0x20,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x32,0x20,0x75,0x76,
|
||||||
|
0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,
|
||||||
|
0x6e,0x20,0x3d,0x20,0x32,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x32,0x20,0x74,
|
||||||
|
0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,
|
||||||
|
0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x6f,
|
||||||
|
0x75,0x74,0x20,0x76,0x65,0x63,0x34,0x20,0x6e,0x72,0x6d,0x3b,0x0a,0x6c,0x61,0x79,
|
||||||
|
0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x31,
|
||||||
|
0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x34,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,
|
||||||
|
0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,
|
||||||
|
0x0a,0x20,0x20,0x20,0x20,0x6d,0x61,0x74,0x34,0x20,0x5f,0x32,0x32,0x20,0x3d,0x20,
|
||||||
|
0x6d,0x61,0x74,0x34,0x28,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,
|
||||||
|
0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x5d,0x2c,
|
||||||
|
0x20,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x32,0x5d,0x2c,0x20,0x76,
|
||||||
|
0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x33,0x5d,0x29,0x3b,0x0a,0x20,0x20,
|
||||||
|
0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,
|
||||||
|
0x5f,0x32,0x32,0x20,0x2a,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,
|
||||||
|
0x20,0x20,0x20,0x20,0x75,0x76,0x20,0x3d,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,
|
||||||
|
0x64,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6e,0x72,0x6d,0x20,0x3d,0x20,0x5f,0x32,
|
||||||
|
0x32,0x20,0x2a,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
|
||||||
|
|
||||||
|
};
|
||||||
|
/*
|
||||||
|
#version 410
|
||||||
|
|
||||||
|
uniform sampler2D tex_smp;
|
||||||
|
|
||||||
|
layout(location = 1) in vec2 uv;
|
||||||
|
layout(location = 0) in vec4 nrm;
|
||||||
|
layout(location = 0) out vec4 frag_color;
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
frag_color = vec4(texture(tex_smp, uv * vec2(20.0, 10.0)).xyz * fma(clamp(dot(nrm.xyz, vec3(0.57735025882720947265625, 0.57735025882720947265625, -0.57735025882720947265625)), 0.0, 1.0), 2.0, 0.25), 1.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
*/
|
||||||
|
static const uint8_t fs_default_source_glsl410[379] = {
|
||||||
|
0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x31,0x30,0x0a,0x0a,0x75,0x6e,
|
||||||
|
0x69,0x66,0x6f,0x72,0x6d,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x32,0x44,0x20,
|
||||||
|
0x74,0x65,0x78,0x5f,0x73,0x6d,0x70,0x3b,0x0a,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,
|
||||||
|
0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x31,0x29,0x20,0x69,
|
||||||
|
0x6e,0x20,0x76,0x65,0x63,0x32,0x20,0x75,0x76,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,
|
||||||
|
0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,
|
||||||
|
0x69,0x6e,0x20,0x76,0x65,0x63,0x34,0x20,0x6e,0x72,0x6d,0x3b,0x0a,0x6c,0x61,0x79,
|
||||||
|
0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,
|
||||||
|
0x29,0x20,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x34,0x20,0x66,0x72,0x61,0x67,0x5f,
|
||||||
|
0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,
|
||||||
|
0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,
|
||||||
|
0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x74,0x65,0x78,0x74,
|
||||||
|
0x75,0x72,0x65,0x28,0x74,0x65,0x78,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x75,0x76,0x20,
|
||||||
|
0x2a,0x20,0x76,0x65,0x63,0x32,0x28,0x32,0x30,0x2e,0x30,0x2c,0x20,0x31,0x30,0x2e,
|
||||||
|
0x30,0x29,0x29,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x66,0x6d,0x61,0x28,0x63,0x6c,
|
||||||
|
0x61,0x6d,0x70,0x28,0x64,0x6f,0x74,0x28,0x6e,0x72,0x6d,0x2e,0x78,0x79,0x7a,0x2c,
|
||||||
|
0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x35,0x37,0x37,0x33,0x35,0x30,0x32,0x35,
|
||||||
|
0x38,0x38,0x32,0x37,0x32,0x30,0x39,0x34,0x37,0x32,0x36,0x35,0x36,0x32,0x35,0x2c,
|
||||||
|
0x20,0x30,0x2e,0x35,0x37,0x37,0x33,0x35,0x30,0x32,0x35,0x38,0x38,0x32,0x37,0x32,
|
||||||
|
0x30,0x39,0x34,0x37,0x32,0x36,0x35,0x36,0x32,0x35,0x2c,0x20,0x2d,0x30,0x2e,0x35,
|
||||||
|
0x37,0x37,0x33,0x35,0x30,0x32,0x35,0x38,0x38,0x32,0x37,0x32,0x30,0x39,0x34,0x37,
|
||||||
|
0x32,0x36,0x35,0x36,0x32,0x35,0x29,0x29,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,
|
||||||
|
0x2e,0x30,0x29,0x2c,0x20,0x32,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x32,0x35,0x29,0x2c,
|
||||||
|
0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
|
||||||
|
};
|
||||||
|
static inline const sg_shader_desc* default_shader_desc(sg_backend backend) {
|
||||||
if (backend == SG_BACKEND_GLCORE) {
|
if (backend == SG_BACKEND_GLCORE) {
|
||||||
static sg_shader_desc desc;
|
static sg_shader_desc desc;
|
||||||
static bool valid;
|
static bool valid;
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
valid = true;
|
valid = true;
|
||||||
desc.attrs[0].name = "position";
|
desc.attrs[0].name = "position";
|
||||||
desc.attrs[1].name = "color0";
|
desc.attrs[1].name = "normal";
|
||||||
desc.vs.source = (const char*)vs_source_glsl410;
|
desc.attrs[2].name = "texcoord0";
|
||||||
|
desc.vs.source = (const char*)vs_default_source_glsl410;
|
||||||
desc.vs.entry = "main";
|
desc.vs.entry = "main";
|
||||||
desc.vs.uniform_blocks[0].size = 64;
|
desc.vs.uniform_blocks[0].size = 64;
|
||||||
desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140;
|
desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140;
|
||||||
desc.vs.uniform_blocks[0].uniforms[0].name = "vs_params";
|
desc.vs.uniform_blocks[0].uniforms[0].name = "vs_params";
|
||||||
desc.vs.uniform_blocks[0].uniforms[0].type = SG_UNIFORMTYPE_FLOAT4;
|
desc.vs.uniform_blocks[0].uniforms[0].type = SG_UNIFORMTYPE_FLOAT4;
|
||||||
desc.vs.uniform_blocks[0].uniforms[0].array_count = 4;
|
desc.vs.uniform_blocks[0].uniforms[0].array_count = 4;
|
||||||
desc.fs.source = (const char*)fs_source_glsl410;
|
desc.fs.source = (const char*)fs_default_source_glsl410;
|
||||||
desc.fs.entry = "main";
|
desc.fs.entry = "main";
|
||||||
desc.label = "cube_shader";
|
desc.fs.images[0].used = true;
|
||||||
|
desc.fs.images[0].multisampled = false;
|
||||||
|
desc.fs.images[0].image_type = SG_IMAGETYPE_2D;
|
||||||
|
desc.fs.images[0].sample_type = SG_IMAGESAMPLETYPE_FLOAT;
|
||||||
|
desc.fs.samplers[0].used = true;
|
||||||
|
desc.fs.samplers[0].sampler_type = SG_SAMPLERTYPE_FILTERING;
|
||||||
|
desc.fs.image_sampler_pairs[0].used = true;
|
||||||
|
desc.fs.image_sampler_pairs[0].image_slot = 0;
|
||||||
|
desc.fs.image_sampler_pairs[0].sampler_slot = 0;
|
||||||
|
desc.fs.image_sampler_pairs[0].glsl_name = "tex_smp";
|
||||||
|
desc.label = "default_shader";
|
||||||
|
}
|
||||||
|
return &desc;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
static inline const sg_shader_desc* offscreen_shader_desc(sg_backend backend) {
|
||||||
|
if (backend == SG_BACKEND_GLCORE) {
|
||||||
|
static sg_shader_desc desc;
|
||||||
|
static bool valid;
|
||||||
|
if (!valid) {
|
||||||
|
valid = true;
|
||||||
|
desc.attrs[0].name = "position";
|
||||||
|
desc.attrs[1].name = "normal";
|
||||||
|
desc.vs.source = (const char*)vs_offscreen_source_glsl410;
|
||||||
|
desc.vs.entry = "main";
|
||||||
|
desc.vs.uniform_blocks[0].size = 64;
|
||||||
|
desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140;
|
||||||
|
desc.vs.uniform_blocks[0].uniforms[0].name = "vs_params";
|
||||||
|
desc.vs.uniform_blocks[0].uniforms[0].type = SG_UNIFORMTYPE_FLOAT4;
|
||||||
|
desc.vs.uniform_blocks[0].uniforms[0].array_count = 4;
|
||||||
|
desc.fs.source = (const char*)fs_offscreen_source_glsl410;
|
||||||
|
desc.fs.entry = "main";
|
||||||
|
desc.label = "offscreen_shader";
|
||||||
}
|
}
|
||||||
return &desc;
|
return &desc;
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
media/2024-10-07 11-31-08.mp4
Normal file
BIN
media/2024-10-07 11-31-08.mp4
Normal file
Binary file not shown.
BIN
media/2024-10-07 11-32-21.mp4
Normal file
BIN
media/2024-10-07 11-32-21.mp4
Normal file
Binary file not shown.
BIN
media/cimgui_sapp.png
Normal file
BIN
media/cimgui_sapp.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 142 KiB |
BIN
media/nuklear_sapp.png
Normal file
BIN
media/nuklear_sapp.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 77 KiB |
BIN
media/offscreen_sappjpeg.jpeg
Normal file
BIN
media/offscreen_sappjpeg.jpeg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 146 KiB |
Loading…
Reference in New Issue
Block a user