mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2025-03-28 16:00:01 -04:00
Added texture loading example.
This commit is contained in:
parent
f55f5e2f2a
commit
7accea7b5d
87 changed files with 3072 additions and 2245 deletions
examples
00-helloworld
01-cubes
02-metaballs
03-raymarch
04-mesh
05-instancing
06-bump
common
runtime
include
premake
src
bgfx.cppbgfx_p.hbgfx_shader.shcommon.shconfig.hfs_clear_dx11.bin.hfs_debugfont.scfs_debugfont_dx11.bin.hrenderer_d3d11.cpprenderer_d3d11.hrenderer_d3d9.cpprenderer_gl.cpprenderer_null.cppvarying.def.scvs_clear.scvs_clear_dx11.bin.hvs_debugfont.scvs_debugfont_dx11.bin.hvs_debugfont_glsl.bin.h
tools
|
@ -14,7 +14,7 @@ void fatalCb(bgfx::Fatal::Enum _code, const char* _str)
|
|||
|
||||
int _main_(int _argc, char** _argv)
|
||||
{
|
||||
bgfx::init(BX_PLATFORM_WINDOWS, fatalCb);
|
||||
bgfx::init(fatalCb);
|
||||
bgfx::reset(1280, 720);
|
||||
|
||||
// Enable debug text.
|
||||
|
@ -45,6 +45,9 @@ int _main_(int _argc, char** _argv)
|
|||
// Advance to next frame. Rendering thread will be kicked to
|
||||
// process submitted rendering primitives.
|
||||
bgfx::frame();
|
||||
|
||||
extern void emscripten_yield();
|
||||
emscripten_yield();
|
||||
}
|
||||
|
||||
// Shutdown bgfx.
|
||||
|
|
|
@ -90,17 +90,16 @@ static const bgfx::Memory* load(const char* _filePath)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static const bgfx::Memory* loadShader(const char* _name, const char* _default = NULL)
|
||||
static const bgfx::Memory* loadShader(const char* _name)
|
||||
{
|
||||
char filePath[512];
|
||||
shaderFilePath(filePath, _name);
|
||||
BX_UNUSED(_default);
|
||||
return load(filePath);
|
||||
}
|
||||
|
||||
int _main_(int _argc, char** _argv)
|
||||
{
|
||||
bgfx::init(BX_PLATFORM_WINDOWS, fatalCb);
|
||||
bgfx::init(fatalCb);
|
||||
bgfx::reset(1280, 720);
|
||||
|
||||
// Enable debug text.
|
||||
|
|
|
@ -7,3 +7,10 @@ BGFX_DIR=../..
|
|||
RUNTIME_DIR=$(BGFX_DIR)/examples/runtime
|
||||
|
||||
include $(BGFX_DIR)/premake/shader.mk
|
||||
|
||||
rebuild:
|
||||
@make -s --no-print-directory TARGET=0 clean all
|
||||
@make -s --no-print-directory TARGET=1 clean all
|
||||
@make -s --no-print-directory TARGET=2 clean all
|
||||
@make -s --no-print-directory TARGET=3 clean all
|
||||
@make -s --no-print-directory TARGET=4 clean all
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
vec4 v_color0 : COLOR0 = vec4(1.0, 0.0, 0.0, 1.0);
|
||||
|
||||
vec3 a_position : POSITION;
|
||||
vec4 a_color : COLOR0;
|
||||
vec4 a_color0 : COLOR0;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
$input a_position, a_color
|
||||
$input a_position, a_color0
|
||||
$output v_color0
|
||||
|
||||
/*
|
||||
|
@ -11,5 +11,5 @@ $output v_color0
|
|||
void main()
|
||||
{
|
||||
gl_Position = mul(u_modelViewProj, vec4(a_position, 1.0) );
|
||||
v_color0 = a_color;
|
||||
v_color0 = a_color0;
|
||||
}
|
||||
|
|
|
@ -7,3 +7,10 @@ BGFX_DIR=../..
|
|||
RUNTIME_DIR=$(BGFX_DIR)/examples/runtime
|
||||
|
||||
include $(BGFX_DIR)/premake/shader.mk
|
||||
|
||||
rebuild:
|
||||
@make -s --no-print-directory TARGET=0 clean all
|
||||
@make -s --no-print-directory TARGET=1 clean all
|
||||
@make -s --no-print-directory TARGET=2 clean all
|
||||
@make -s --no-print-directory TARGET=3 clean all
|
||||
@make -s --no-print-directory TARGET=4 clean all
|
||||
|
|
|
@ -75,11 +75,10 @@ static const bgfx::Memory* load(const char* _filePath)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static const bgfx::Memory* loadShader(const char* _name, const char* _default = NULL)
|
||||
static const bgfx::Memory* loadShader(const char* _name)
|
||||
{
|
||||
char filePath[512];
|
||||
shaderFilePath(filePath, _name);
|
||||
BX_UNUSED(_default);
|
||||
return load(filePath);
|
||||
}
|
||||
|
||||
|
@ -500,7 +499,7 @@ uint32_t triangulate(uint8_t* _result, uint32_t _stride, const float* __restrict
|
|||
|
||||
int _main_(int _argc, char** _argv)
|
||||
{
|
||||
bgfx::init(BX_PLATFORM_WINDOWS, fatalCb);
|
||||
bgfx::init(fatalCb);
|
||||
bgfx::reset(1280, 720);
|
||||
|
||||
// Enable debug text.
|
||||
|
|
|
@ -3,4 +3,4 @@ vec4 v_color0 : COLOR0 = vec4(1.0, 0.0, 0.0, 1.0);
|
|||
|
||||
vec3 a_position : POSITION;
|
||||
vec3 a_normal : NORMAL;
|
||||
vec4 a_color : COLOR0;
|
||||
vec4 a_color0 : COLOR0;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
$input a_position, a_normal, a_color
|
||||
$input a_position, a_normal, a_color0
|
||||
$output v_normal, v_color0
|
||||
|
||||
/*
|
||||
|
@ -12,5 +12,5 @@ void main()
|
|||
{
|
||||
gl_Position = mul(u_modelViewProj, vec4(a_position, 1.0) );
|
||||
v_normal = mul(u_model, vec4(a_normal, 0.0) ).xyz;
|
||||
v_color0 = a_color;
|
||||
v_color0 = a_color0;
|
||||
}
|
||||
|
|
|
@ -7,3 +7,10 @@ BGFX_DIR=../..
|
|||
RUNTIME_DIR=$(BGFX_DIR)/examples/runtime
|
||||
|
||||
include $(BGFX_DIR)/premake/shader.mk
|
||||
|
||||
rebuild:
|
||||
@make -s --no-print-directory TARGET=0 clean all
|
||||
@make -s --no-print-directory TARGET=1 clean all
|
||||
@make -s --no-print-directory TARGET=2 clean all
|
||||
@make -s --no-print-directory TARGET=3 clean all
|
||||
@make -s --no-print-directory TARGET=4 clean all
|
||||
|
|
|
@ -65,11 +65,10 @@ static const bgfx::Memory* load(const char* _filePath)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static const bgfx::Memory* loadShader(const char* _name, const char* _default = NULL)
|
||||
static const bgfx::Memory* loadShader(const char* _name)
|
||||
{
|
||||
char filePath[512];
|
||||
shaderFilePath(filePath, _name);
|
||||
BX_UNUSED(_default);
|
||||
return load(filePath);
|
||||
}
|
||||
|
||||
|
@ -179,7 +178,7 @@ void renderScreenSpaceQuad(uint32_t _view, bgfx::ProgramHandle _program, float _
|
|||
|
||||
int _main_(int _argc, char** _argv)
|
||||
{
|
||||
bgfx::init(BX_PLATFORM_WINDOWS, fatalCb);
|
||||
bgfx::init(fatalCb);
|
||||
bgfx::reset(1280, 720);
|
||||
|
||||
// Enable debug text.
|
||||
|
@ -231,9 +230,9 @@ int _main_(int _argc, char** _argv)
|
|||
s_PosColorTexCoord0Decl.add(bgfx::Attrib::TexCoord0, 2, bgfx::AttribType::Float);
|
||||
s_PosColorTexCoord0Decl.end();
|
||||
|
||||
bgfx::UniformHandle u_time = bgfx::createUniform("u_time", bgfx::ConstantType::Uniform1f);
|
||||
bgfx::UniformHandle u_mtx = bgfx::createUniform("u_mtx", bgfx::ConstantType::Uniform4x4fv);
|
||||
bgfx::UniformHandle u_lightDir = bgfx::createUniform("u_lightDir", bgfx::ConstantType::Uniform3fv);
|
||||
bgfx::UniformHandle u_time = bgfx::createUniform("u_time", bgfx::UniformType::Uniform1f);
|
||||
bgfx::UniformHandle u_mtx = bgfx::createUniform("u_mtx", bgfx::UniformType::Uniform4x4fv);
|
||||
bgfx::UniformHandle u_lightDir = bgfx::createUniform("u_lightDir", bgfx::UniformType::Uniform3fv);
|
||||
|
||||
bgfx::ProgramHandle raymarching = loadProgram("vs_raymarching", "fs_raymarching");
|
||||
|
||||
|
|
|
@ -2,5 +2,5 @@ vec4 v_color0 : COLOR0 = vec4(1.0, 0.0, 0.0, 1.0);
|
|||
vec2 v_texcoord0 : TEXCOORD0 = vec2(0.0, 0.0);
|
||||
|
||||
vec3 a_position : POSITION;
|
||||
vec4 a_color : COLOR0;
|
||||
vec4 a_color0 : COLOR0;
|
||||
vec2 a_texcoord0 : TEXCOORD0;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
$input a_position, a_color, a_texcoord0
|
||||
$input a_position, a_color0, a_texcoord0
|
||||
$output v_color0, v_texcoord0
|
||||
|
||||
/*
|
||||
|
@ -11,6 +11,6 @@ $output v_color0, v_texcoord0
|
|||
void main()
|
||||
{
|
||||
gl_Position = mul(u_modelViewProj, vec4(a_position, 1.0) );
|
||||
v_color0 = a_color;
|
||||
v_color0 = a_color0;
|
||||
v_texcoord0 = a_texcoord0;
|
||||
}
|
||||
|
|
|
@ -7,3 +7,10 @@ BGFX_DIR=../..
|
|||
RUNTIME_DIR=$(BGFX_DIR)/examples/runtime
|
||||
|
||||
include $(BGFX_DIR)/premake/shader.mk
|
||||
|
||||
rebuild:
|
||||
@make -s --no-print-directory TARGET=0 clean all
|
||||
@make -s --no-print-directory TARGET=1 clean all
|
||||
@make -s --no-print-directory TARGET=2 clean all
|
||||
@make -s --no-print-directory TARGET=3 clean all
|
||||
@make -s --no-print-directory TARGET=4 clean all
|
||||
|
|
|
@ -54,11 +54,10 @@ static const bgfx::Memory* load(const char* _filePath)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static const bgfx::Memory* loadShader(const char* _name, const char* _default = NULL)
|
||||
static const bgfx::Memory* loadShader(const char* _name)
|
||||
{
|
||||
char filePath[512];
|
||||
shaderFilePath(filePath, _name);
|
||||
BX_UNUSED(_default);
|
||||
return load(filePath);
|
||||
}
|
||||
|
||||
|
@ -102,7 +101,7 @@ struct Mesh
|
|||
|
||||
if (ctmGetInteger(ctm, CTM_HAS_NORMALS) )
|
||||
{
|
||||
m_decl.add(bgfx::Attrib::Normal, 3, bgfx::AttribType::Float, true);
|
||||
m_decl.add(bgfx::Attrib::Normal, 4, bgfx::AttribType::Uint8, true);
|
||||
}
|
||||
|
||||
if (0 < ctmGetInteger(ctm, CTM_UV_MAP_COUNT) )
|
||||
|
@ -152,10 +151,10 @@ struct Mesh
|
|||
|
||||
if (NULL != normals)
|
||||
{
|
||||
float* nxyz = (float*)&data[normalOffset];
|
||||
nxyz[0] = normals[0];
|
||||
nxyz[1] = normals[1];
|
||||
nxyz[2] = normals[2];
|
||||
uint8_t* nxyz = (uint8_t*)&data[normalOffset];
|
||||
nxyz[0] = uint8_t(normals[0]*127.0f + 128.0f);
|
||||
nxyz[1] = uint8_t(normals[1]*127.0f + 128.0f);
|
||||
nxyz[2] = uint8_t(normals[2]*127.0f + 128.0f);
|
||||
normals += 3;
|
||||
}
|
||||
|
||||
|
@ -195,7 +194,7 @@ struct Mesh
|
|||
|
||||
int _main_(int _argc, char** _argv)
|
||||
{
|
||||
bgfx::init(BX_PLATFORM_WINDOWS, fatalCb);
|
||||
bgfx::init(fatalCb);
|
||||
bgfx::reset(1280, 720);
|
||||
|
||||
// Enable debug text.
|
||||
|
@ -240,7 +239,7 @@ int _main_(int _argc, char** _argv)
|
|||
break;
|
||||
}
|
||||
|
||||
bgfx::UniformHandle u_time = bgfx::createUniform("u_time", bgfx::ConstantType::Uniform1f);
|
||||
bgfx::UniformHandle u_time = bgfx::createUniform("u_time", bgfx::UniformType::Uniform1f);
|
||||
|
||||
bgfx::ProgramHandle program = loadProgram("vs_mesh", "fs_mesh");
|
||||
|
||||
|
|
|
@ -5,6 +5,6 @@ vec3 v_pos : TEXCOORD1 = vec3(0.0, 0.0, 0.0);
|
|||
vec3 v_view : TEXCOORD2 = vec3(0.0, 0.0, 0.0);
|
||||
|
||||
vec3 a_position : POSITION;
|
||||
vec4 a_color : COLOR0;
|
||||
vec4 a_color0 : COLOR0;
|
||||
vec2 a_texcoord0 : TEXCOORD0;
|
||||
vec3 a_normal : NORMAL;
|
||||
|
|
|
@ -17,12 +17,15 @@ void main()
|
|||
float sx = sin(pos.x*32.0+u_time*4.0)*0.5+0.5;
|
||||
float cy = cos(pos.y*32.0+u_time*4.0)*0.5+0.5;
|
||||
vec3 displacement = vec3(sx, cy, sx*cy);
|
||||
pos = pos + a_normal*displacement*vec3(0.06, 0.06, 0.06);
|
||||
vec3 normal = a_normal.xyz*2.0 - 1.0;
|
||||
|
||||
pos = pos + normal*displacement*vec3(0.06, 0.06, 0.06);
|
||||
|
||||
gl_Position = mul(u_modelViewProj, vec4(pos, 1.0) );
|
||||
v_pos = gl_Position.xyz;
|
||||
v_view = mul(u_modelView, vec4(pos, 1.0) ).xyz;
|
||||
v_normal = mul(u_modelView, vec4(a_normal, 0.0) ).xyz;
|
||||
|
||||
v_normal = mul(u_modelView, vec4(normal, 0.0) ).xyz;
|
||||
|
||||
float len = length(displacement)*0.4+0.6;
|
||||
v_color0 = vec4(len, len, len, 1.0);
|
||||
|
|
|
@ -90,17 +90,16 @@ static const bgfx::Memory* load(const char* _filePath)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static const bgfx::Memory* loadShader(const char* _name, const char* _default = NULL)
|
||||
static const bgfx::Memory* loadShader(const char* _name)
|
||||
{
|
||||
char filePath[512];
|
||||
shaderFilePath(filePath, _name);
|
||||
BX_UNUSED(_default);
|
||||
return load(filePath);
|
||||
}
|
||||
|
||||
int _main_(int _argc, char** _argv)
|
||||
{
|
||||
bgfx::init(BX_PLATFORM_WINDOWS, fatalCb);
|
||||
bgfx::init(fatalCb);
|
||||
bgfx::reset(1280, 720);
|
||||
|
||||
// Enable debug text.
|
||||
|
|
|
@ -7,3 +7,10 @@ BGFX_DIR=../..
|
|||
RUNTIME_DIR=$(BGFX_DIR)/examples/runtime
|
||||
|
||||
include $(BGFX_DIR)/premake/shader.mk
|
||||
|
||||
rebuild:
|
||||
@make -s --no-print-directory TARGET=0 clean all
|
||||
@make -s --no-print-directory TARGET=1 clean all
|
||||
@make -s --no-print-directory TARGET=2 clean all
|
||||
@make -s --no-print-directory TARGET=3 clean all
|
||||
@make -s --no-print-directory TARGET=4 clean all
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
vec4 v_color0 : COLOR0 = vec4(1.0, 0.0, 0.0, 1.0);
|
||||
|
||||
vec3 a_position : POSITION;
|
||||
vec4 a_color : COLOR0;
|
||||
vec4 a_color0 : COLOR0;
|
||||
vec4 i_data0 : TEXCOORD3;
|
||||
vec4 i_data1 : TEXCOORD4;
|
||||
vec4 i_data2 : TEXCOORD5;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
$input a_position, a_color, i_data0, i_data1, i_data2, i_data3, i_data4
|
||||
$input a_position, a_color0, i_data0, i_data1, i_data2, i_data3, i_data4
|
||||
$output v_color0
|
||||
|
||||
/*
|
||||
|
@ -18,5 +18,5 @@ void main()
|
|||
|
||||
vec4 worldPos = instMul(model, vec4(a_position, 1.0) );
|
||||
gl_Position = mul(u_viewProj, worldPos);
|
||||
v_color0 = a_color*i_data4;
|
||||
v_color0 = a_color0*i_data4;
|
||||
}
|
||||
|
|
477
examples/06-bump/bump.cpp
Normal file
477
examples/06-bump/bump.cpp
Normal file
|
@ -0,0 +1,477 @@
|
|||
/*
|
||||
* Copyright 2011-2012 Branimir Karadzic. All rights reserved.
|
||||
* License: http://www.opensource.org/licenses/BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <bgfx.h>
|
||||
#include <bx/bx.h>
|
||||
#include <bx/countof.h>
|
||||
#include <bx/timer.h>
|
||||
#include "../common/dbg.h"
|
||||
#include "../common/math.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
void fatalCb(bgfx::Fatal::Enum _code, const char* _str)
|
||||
{
|
||||
DBG("%x: %s", _code, _str);
|
||||
}
|
||||
|
||||
struct PosNormalTangentTexcoordVertex
|
||||
{
|
||||
float m_x;
|
||||
float m_y;
|
||||
float m_z;
|
||||
uint32_t m_normal;
|
||||
uint32_t m_tangent;
|
||||
float m_u;
|
||||
float m_v;
|
||||
};
|
||||
|
||||
static bgfx::VertexDecl s_PosNormalTangentTexcoordDecl;
|
||||
|
||||
uint32_t packUint32(uint8_t _x, uint8_t _y, uint8_t _z, uint8_t _w)
|
||||
{
|
||||
union
|
||||
{
|
||||
uint32_t ui32;
|
||||
uint8_t arr[4];
|
||||
} un;
|
||||
|
||||
un.arr[0] = _x;
|
||||
un.arr[1] = _y;
|
||||
un.arr[2] = _z;
|
||||
un.arr[3] = _w;
|
||||
|
||||
return un.ui32;
|
||||
}
|
||||
|
||||
void unpackUint32(uint8_t _result[4], uint32_t _packed)
|
||||
{
|
||||
union
|
||||
{
|
||||
uint32_t ui32;
|
||||
uint8_t arr[4];
|
||||
} un;
|
||||
|
||||
un.ui32 = _packed;
|
||||
_result[0] = un.arr[0];
|
||||
_result[1] = un.arr[1];
|
||||
_result[2] = un.arr[2];
|
||||
_result[3] = un.arr[3];
|
||||
}
|
||||
|
||||
uint32_t packF4u(float _x, float _y = 0.0f, float _z = 0.0f, float _w = 0.0f)
|
||||
{
|
||||
const uint8_t xx = uint8_t(_x*127.0f + 128.0f);
|
||||
const uint8_t yy = uint8_t(_y*127.0f + 128.0f);
|
||||
const uint8_t zz = uint8_t(_z*127.0f + 128.0f);
|
||||
const uint8_t ww = uint8_t(_w*127.0f + 128.0f);
|
||||
return packUint32(xx, yy, zz, ww);
|
||||
}
|
||||
|
||||
void unpackF4u(float _result[3], uint32_t _packed)
|
||||
{
|
||||
uint8_t unpacked[4];
|
||||
unpackUint32(unpacked, _packed);
|
||||
_result[0] = (float(unpacked[0]) - 128.0f)/127.0f;
|
||||
_result[1] = (float(unpacked[1]) - 128.0f)/127.0f;
|
||||
_result[2] = (float(unpacked[2]) - 128.0f)/127.0f;
|
||||
_result[3] = (float(unpacked[3]) - 128.0f)/127.0f;
|
||||
}
|
||||
|
||||
static PosNormalTangentTexcoordVertex s_cubeVertices[24] =
|
||||
{
|
||||
{-1.0f, 1.0f, 1.0f, packF4u( 0.0f, 0.0f, 1.0f), 0, 0.0f, 0.0f },
|
||||
{ 1.0f, 1.0f, 1.0f, packF4u( 0.0f, 0.0f, 1.0f), 0, 1.0f, 0.0f },
|
||||
{-1.0f, -1.0f, 1.0f, packF4u( 0.0f, 0.0f, 1.0f), 0, 0.0f, 1.0f },
|
||||
{ 1.0f, -1.0f, 1.0f, packF4u( 0.0f, 0.0f, 1.0f), 0, 1.0f, 1.0f },
|
||||
{-1.0f, 1.0f, -1.0f, packF4u( 0.0f, 0.0f, -1.0f), 0, 0.0f, 0.0f },
|
||||
{ 1.0f, 1.0f, -1.0f, packF4u( 0.0f, 0.0f, -1.0f), 0, 1.0f, 0.0f },
|
||||
{-1.0f, -1.0f, -1.0f, packF4u( 0.0f, 0.0f, -1.0f), 0, 0.0f, 1.0f },
|
||||
{ 1.0f, -1.0f, -1.0f, packF4u( 0.0f, 0.0f, -1.0f), 0, 1.0f, 1.0f },
|
||||
{-1.0f, 1.0f, 1.0f, packF4u( 0.0f, 1.0f, 0.0f), 0, 0.0f, 0.0f },
|
||||
{ 1.0f, 1.0f, 1.0f, packF4u( 0.0f, 1.0f, 0.0f), 0, 1.0f, 0.0f },
|
||||
{-1.0f, 1.0f, -1.0f, packF4u( 0.0f, 1.0f, 0.0f), 0, 0.0f, 1.0f },
|
||||
{ 1.0f, 1.0f, -1.0f, packF4u( 0.0f, 1.0f, 0.0f), 0, 1.0f, 1.0f },
|
||||
{-1.0f, -1.0f, 1.0f, packF4u( 0.0f, -1.0f, 0.0f), 0, 0.0f, 0.0f },
|
||||
{ 1.0f, -1.0f, 1.0f, packF4u( 0.0f, -1.0f, 0.0f), 0, 1.0f, 0.0f },
|
||||
{-1.0f, -1.0f, -1.0f, packF4u( 0.0f, -1.0f, 0.0f), 0, 0.0f, 1.0f },
|
||||
{ 1.0f, -1.0f, -1.0f, packF4u( 0.0f, -1.0f, 0.0f), 0, 1.0f, 1.0f },
|
||||
{ 1.0f, -1.0f, 1.0f, packF4u( 1.0f, 0.0f, 0.0f), 0, 0.0f, 0.0f },
|
||||
{ 1.0f, 1.0f, 1.0f, packF4u( 1.0f, 0.0f, 0.0f), 0, 1.0f, 0.0f },
|
||||
{ 1.0f, -1.0f, -1.0f, packF4u( 1.0f, 0.0f, 0.0f), 0, 0.0f, 1.0f },
|
||||
{ 1.0f, 1.0f, -1.0f, packF4u( 1.0f, 0.0f, 0.0f), 0, 1.0f, 1.0f },
|
||||
{-1.0f, -1.0f, 1.0f, packF4u(-1.0f, 0.0f, 0.0f), 0, 0.0f, 0.0f },
|
||||
{-1.0f, 1.0f, 1.0f, packF4u(-1.0f, 0.0f, 0.0f), 0, 1.0f, 0.0f },
|
||||
{-1.0f, -1.0f, -1.0f, packF4u(-1.0f, 0.0f, 0.0f), 0, 0.0f, 1.0f },
|
||||
{-1.0f, 1.0f, -1.0f, packF4u(-1.0f, 0.0f, 0.0f), 0, 1.0f, 1.0f },
|
||||
};
|
||||
|
||||
static const uint16_t s_cubeIndices[36] =
|
||||
{
|
||||
0, 2, 1,
|
||||
1, 2, 3,
|
||||
4, 5, 6,
|
||||
5, 7, 6,
|
||||
|
||||
8, 10, 9,
|
||||
9, 10, 11,
|
||||
12, 13, 14,
|
||||
13, 15, 14,
|
||||
|
||||
16, 18, 17,
|
||||
17, 18, 19,
|
||||
20, 21, 22,
|
||||
21, 23, 22,
|
||||
};
|
||||
|
||||
static const char* s_shaderPath = NULL;
|
||||
|
||||
static void shaderFilePath(char* _out, const char* _name)
|
||||
{
|
||||
strcpy(_out, s_shaderPath);
|
||||
strcat(_out, _name);
|
||||
strcat(_out, ".bin");
|
||||
}
|
||||
|
||||
long int fsize(FILE* _file)
|
||||
{
|
||||
long int pos = ftell(_file);
|
||||
fseek(_file, 0L, SEEK_END);
|
||||
long int size = ftell(_file);
|
||||
fseek(_file, pos, SEEK_SET);
|
||||
return size;
|
||||
}
|
||||
|
||||
static const bgfx::Memory* load(const char* _filePath)
|
||||
{
|
||||
FILE* file = fopen(_filePath, "rb");
|
||||
if (NULL != file)
|
||||
{
|
||||
uint32_t size = (uint32_t)fsize(file);
|
||||
const bgfx::Memory* mem = bgfx::alloc(size+1);
|
||||
size_t ignore = fread(mem->data, 1, size, file);
|
||||
BX_UNUSED(ignore);
|
||||
fclose(file);
|
||||
mem->data[mem->size-1] = '\0';
|
||||
return mem;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static const bgfx::Memory* loadShader(const char* _name)
|
||||
{
|
||||
char filePath[512];
|
||||
shaderFilePath(filePath, _name);
|
||||
return load(filePath);
|
||||
}
|
||||
|
||||
static const bgfx::Memory* loadTexture(const char* _name)
|
||||
{
|
||||
char filePath[512];
|
||||
strcpy(filePath, "textures/");
|
||||
strcat(filePath, _name);
|
||||
return load(filePath);
|
||||
}
|
||||
|
||||
template<typename Ty>
|
||||
void calcTangents(const uint16_t* _indices, uint32_t _numIndices, Ty* _vertices, uint16_t _numVertices)
|
||||
{
|
||||
float* tangents = new float[6*_numVertices];
|
||||
memset(tangents, 0, 6*_numVertices*sizeof(float) );
|
||||
|
||||
float* tan = tangents;
|
||||
for (uint32_t ii = 0, num = _numIndices/3; ii < num; ++ii)
|
||||
{
|
||||
const uint16_t* indices = &_indices[ii*3];
|
||||
const Ty& v0 = _vertices[indices[0] ];
|
||||
const Ty& v1 = _vertices[indices[1] ];
|
||||
const Ty& v2 = _vertices[indices[2] ];
|
||||
|
||||
const float bax = v1.m_x - v0.m_x;
|
||||
const float bay = v1.m_y - v0.m_y;
|
||||
const float baz = v1.m_z - v0.m_z;
|
||||
const float bau = v1.m_u - v0.m_u;
|
||||
const float bav = v1.m_v - v0.m_v;
|
||||
|
||||
const float cax = v2.m_x - v0.m_x;
|
||||
const float cay = v2.m_y - v0.m_y;
|
||||
const float caz = v2.m_z - v0.m_z;
|
||||
const float cau = v2.m_u - v0.m_u;
|
||||
const float cav = v2.m_v - v0.m_v;
|
||||
|
||||
const float det = (bau * cav - bav * cau);
|
||||
const float invDet = 1.0f / det;
|
||||
|
||||
const float tx = (bax * cav - cax * bav) * invDet;
|
||||
const float ty = (bay * cav - cay * bav) * invDet;
|
||||
const float tz = (baz * cav - caz * bav) * invDet;
|
||||
|
||||
const float bx = (cax * bau - bax * cau) * invDet;
|
||||
const float by = (cay * bau - bay * cau) * invDet;
|
||||
const float bz = (caz * bau - baz * cau) * invDet;
|
||||
|
||||
for (uint32_t jj = 0; jj < 3; ++jj)
|
||||
{
|
||||
float* tanu = &tangents[indices[jj]*6];
|
||||
float* tanv = &tanu[3];
|
||||
tanu[0] += tx;
|
||||
tanu[1] += ty;
|
||||
tanu[2] += tz;
|
||||
|
||||
tanv[0] += bx;
|
||||
tanv[1] += by;
|
||||
tanv[2] += bz;
|
||||
}
|
||||
}
|
||||
|
||||
for (uint32_t ii = 0; ii < _numVertices; ++ii)
|
||||
{
|
||||
Ty& v0 = _vertices[ii];
|
||||
const float* tanu = &tangents[ii*6];
|
||||
const float* tanv = &tangents[ii*6 + 3];
|
||||
|
||||
float normal[3];
|
||||
unpackF4u(normal, v0.m_normal);
|
||||
float ndt = vec3Dot(normal, tanu);
|
||||
|
||||
float nxt[3];
|
||||
vec3Cross(nxt, normal, tanu);
|
||||
|
||||
float tmp[3];
|
||||
tmp[0] = tanu[0] - normal[0] * ndt;
|
||||
tmp[1] = tanu[1] - normal[1] * ndt;
|
||||
tmp[2] = tanu[2] - normal[2] * ndt;
|
||||
|
||||
float tangent[3];
|
||||
vec3Norm(tangent, tmp);
|
||||
|
||||
float tw = vec3Dot(nxt, tanv) < 0.0f ? -1.0f : 1.0f;
|
||||
v0.m_tangent = packF4u(tangent[0], tangent[1], tangent[2], tw);
|
||||
}
|
||||
}
|
||||
|
||||
int _main_(int _argc, char** _argv)
|
||||
{
|
||||
bgfx::init(fatalCb);
|
||||
bgfx::reset(1280, 720);
|
||||
|
||||
// Enable debug text.
|
||||
bgfx::setDebug(BGFX_DEBUG_TEXT);
|
||||
|
||||
// Set view 0 default viewport.
|
||||
bgfx::setViewRect(0, 0, 0, 1280, 720);
|
||||
|
||||
// Set view 0 clear state.
|
||||
bgfx::setViewClear(0
|
||||
, BGFX_CLEAR_COLOR_BIT|BGFX_CLEAR_DEPTH_BIT
|
||||
, 0x303030ff
|
||||
, 1.0f
|
||||
, 0
|
||||
);
|
||||
|
||||
// Setup root path for binary shaders. Shader binaries are different
|
||||
// for each renderer.
|
||||
switch (bgfx::getRendererType() )
|
||||
{
|
||||
case bgfx::RendererType::Null:
|
||||
case bgfx::RendererType::Direct3D9:
|
||||
s_shaderPath = "shaders/dx9/";
|
||||
break;
|
||||
|
||||
case bgfx::RendererType::Direct3D11:
|
||||
s_shaderPath = "shaders/dx11/";
|
||||
break;
|
||||
|
||||
case bgfx::RendererType::OpenGL:
|
||||
s_shaderPath = "shaders/glsl/";
|
||||
break;
|
||||
|
||||
case bgfx::RendererType::OpenGLES2:
|
||||
case bgfx::RendererType::OpenGLES3:
|
||||
s_shaderPath = "shaders/gles/";
|
||||
break;
|
||||
}
|
||||
|
||||
// Create vertex stream declaration.
|
||||
s_PosNormalTangentTexcoordDecl.begin();
|
||||
s_PosNormalTangentTexcoordDecl.add(bgfx::Attrib::Position, 3, bgfx::AttribType::Float);
|
||||
s_PosNormalTangentTexcoordDecl.add(bgfx::Attrib::Normal, 4, bgfx::AttribType::Uint8, true);
|
||||
s_PosNormalTangentTexcoordDecl.add(bgfx::Attrib::Tangent, 4, bgfx::AttribType::Uint8, true);
|
||||
s_PosNormalTangentTexcoordDecl.add(bgfx::Attrib::TexCoord0, 2, bgfx::AttribType::Float);
|
||||
s_PosNormalTangentTexcoordDecl.end();
|
||||
|
||||
const bgfx::Memory* mem;
|
||||
|
||||
calcTangents(s_cubeIndices, countof(s_cubeIndices), s_cubeVertices, countof(s_cubeVertices) );
|
||||
|
||||
// Create static vertex buffer.
|
||||
mem = bgfx::makeRef(s_cubeVertices, sizeof(s_cubeVertices) );
|
||||
bgfx::VertexBufferHandle vbh = bgfx::createVertexBuffer(mem, s_PosNormalTangentTexcoordDecl);
|
||||
|
||||
// Create static index buffer.
|
||||
mem = bgfx::makeRef(s_cubeIndices, sizeof(s_cubeIndices) );
|
||||
bgfx::IndexBufferHandle ibh = bgfx::createIndexBuffer(mem);
|
||||
|
||||
// Create texture sampler uniforms.
|
||||
bgfx::UniformHandle u_texColor = bgfx::createUniform("u_texColor", bgfx::UniformType::Uniform1iv);
|
||||
bgfx::UniformHandle u_texNormal = bgfx::createUniform("u_texNormal", bgfx::UniformType::Uniform1iv);
|
||||
|
||||
uint16_t numLights = 4;
|
||||
bgfx::UniformHandle u_lightPosRadius = bgfx::createUniform("u_lightPosRadius", bgfx::UniformType::Uniform4fv, numLights);
|
||||
bgfx::UniformHandle u_lightRgbInnerR = bgfx::createUniform("u_lightRgbInnerR", bgfx::UniformType::Uniform4fv, numLights);
|
||||
|
||||
// Load vertex shader.
|
||||
mem = loadShader("vs_bump");
|
||||
bgfx::VertexShaderHandle vsh = bgfx::createVertexShader(mem);
|
||||
|
||||
// Load fragment shader.
|
||||
mem = loadShader("fs_bump");
|
||||
bgfx::FragmentShaderHandle fsh = bgfx::createFragmentShader(mem);
|
||||
|
||||
// Create program from shaders.
|
||||
bgfx::ProgramHandle program = bgfx::createProgram(vsh, fsh);
|
||||
|
||||
// We can destroy vertex and fragment shader here since
|
||||
// their reference is kept inside bgfx after calling createProgram.
|
||||
// Vertex and fragment shader will be destroyed once program is^
|
||||
// destroyed.
|
||||
bgfx::destroyVertexShader(vsh);
|
||||
bgfx::destroyFragmentShader(fsh);
|
||||
|
||||
// Load diffuse texture.
|
||||
mem = loadTexture("fieldstone-rgba.dds");
|
||||
bgfx::TextureHandle texture_rgba = bgfx::createTexture(mem);
|
||||
|
||||
// Load normal texture.
|
||||
mem = loadTexture("fieldstone-n.dds");
|
||||
bgfx::TextureHandle texture_n = bgfx::createTexture(mem);
|
||||
|
||||
while (true)
|
||||
{
|
||||
// This dummy draw call is here to make sure that view 0 is cleared
|
||||
// if no other draw calls are submitted to view 0.
|
||||
bgfx::submit(0);
|
||||
|
||||
int64_t now = bx::getHPCounter();
|
||||
static int64_t last = now;
|
||||
const int64_t frameTime = now - last;
|
||||
last = now;
|
||||
const double freq = double(bx::getHPFrequency() );
|
||||
const double toMs = 1000.0/freq;
|
||||
|
||||
float time = (float)(now/freq);
|
||||
|
||||
// Use debug font to print information about this example.
|
||||
bgfx::dbgTextClear();
|
||||
bgfx::dbgTextPrintf(0, 1, 0x4f, "bgfx/examples/06-bump");
|
||||
bgfx::dbgTextPrintf(0, 2, 0x6f, "Description: Loading textures.");
|
||||
bgfx::dbgTextPrintf(0, 3, 0x0f, "Frame: % 7.3f[ms]", double(frameTime)*toMs);
|
||||
|
||||
float at[3] = { 0.0f, 0.0f, 0.0f };
|
||||
float eye[3] = { 0.0f, 0.0f, -7.0f };
|
||||
|
||||
float view[16];
|
||||
float proj[16];
|
||||
mtxLookAt(view, eye, at);
|
||||
mtxProj(proj, 60.0f, 16.0f/9.0f, 0.1f, 100.0f);
|
||||
|
||||
float lightPosRadius[4][4];
|
||||
for (uint32_t ii = 0; ii < numLights; ++ii)
|
||||
{
|
||||
lightPosRadius[ii][0] = sin( (time*(0.1f + ii*0.17f) + float(ii*M_PI_2)*1.37f ) )*3.0f;
|
||||
lightPosRadius[ii][1] = cos( (time*(0.2f + ii*0.29f) + float(ii*M_PI_2)*1.49f ) )*3.0f;
|
||||
lightPosRadius[ii][2] = -2.5f;
|
||||
lightPosRadius[ii][3] = 3.0f;
|
||||
}
|
||||
|
||||
bgfx::setUniform(u_lightPosRadius, lightPosRadius, numLights);
|
||||
|
||||
float lightRgbInnerR[4][4] =
|
||||
{
|
||||
1.0f, 0.7f, 0.2f, 0.8f,
|
||||
0.7f, 0.2f, 1.0f, 0.8f,
|
||||
0.2f, 1.0f, 0.7f, 0.8f,
|
||||
1.0f, 0.4f, 0.2f, 0.8f,
|
||||
};
|
||||
|
||||
bgfx::setUniform(u_lightRgbInnerR, lightRgbInnerR, numLights);
|
||||
|
||||
// Set view and projection matrix for view 0.
|
||||
bgfx::setViewTransform(0, view, proj);
|
||||
|
||||
const uint16_t instanceStride = 64;
|
||||
const bgfx::InstanceDataBuffer* idb = bgfx::allocInstanceDataBuffer(9, instanceStride);
|
||||
if (NULL != idb)
|
||||
{
|
||||
uint8_t* data = idb->data;
|
||||
|
||||
// Write instance data for 3x3 cubes.
|
||||
for (uint32_t yy = 0; yy < 3; ++yy)
|
||||
{
|
||||
for (uint32_t xx = 0; xx < 3; ++xx)
|
||||
{
|
||||
float* mtx = (float*)data;
|
||||
mtxRotateXY(mtx, time*0.023f + xx*0.21f, time*0.03f + yy*0.37f);
|
||||
mtx[12] = -3.0f + float(xx)*3.0f;
|
||||
mtx[13] = -3.0f + float(yy)*3.0f;
|
||||
mtx[14] = 0.0f;
|
||||
|
||||
float* color = (float*)&data[64];
|
||||
color[0] = sin(time+float(xx)/11.0f)*0.5f+0.5f;
|
||||
color[1] = cos(time+float(yy)/11.0f)*0.5f+0.5f;
|
||||
color[2] = sin(time*3.0f)*0.5f+0.5f;
|
||||
color[3] = 1.0f;
|
||||
|
||||
data += instanceStride;
|
||||
}
|
||||
}
|
||||
|
||||
uint16_t numInstances = (data - idb->data)/instanceStride;
|
||||
|
||||
// Set vertex and fragment shaders.
|
||||
bgfx::setProgram(program);
|
||||
|
||||
// Set vertex and index buffer.
|
||||
bgfx::setVertexBuffer(vbh);
|
||||
bgfx::setIndexBuffer(ibh);
|
||||
|
||||
// Set instance data buffer.
|
||||
bgfx::setInstanceDataBuffer(idb, numInstances);
|
||||
|
||||
// Bind textures.
|
||||
bgfx::setTexture(0, u_texColor, texture_rgba);
|
||||
bgfx::setTexture(1, u_texNormal, texture_n);
|
||||
|
||||
// Set render states.
|
||||
bgfx::setState(BGFX_STATE_RGB_WRITE
|
||||
|BGFX_STATE_DEPTH_WRITE
|
||||
|BGFX_STATE_DEPTH_TEST_LESS
|
||||
);
|
||||
|
||||
// Submit primitive for rendering to view 0.
|
||||
bgfx::submit(0);
|
||||
}
|
||||
|
||||
// Advance to next frame. Rendering thread will be kicked to
|
||||
// process submitted rendering primitives.
|
||||
bgfx::frame();
|
||||
}
|
||||
|
||||
// Cleanup.
|
||||
bgfx::destroyIndexBuffer(ibh);
|
||||
bgfx::destroyVertexBuffer(vbh);
|
||||
bgfx::destroyProgram(program);
|
||||
bgfx::destroyTexture(texture_rgba);
|
||||
bgfx::destroyTexture(texture_n);
|
||||
bgfx::destroyUniform(u_texColor);
|
||||
bgfx::destroyUniform(u_texNormal);
|
||||
|
||||
// Shutdown bgfx.
|
||||
bgfx::shutdown();
|
||||
|
||||
return 0;
|
||||
}
|
BIN
examples/06-bump/fieldstone-n.tga
Normal file
BIN
examples/06-bump/fieldstone-n.tga
Normal file
Binary file not shown.
After (image error) Size: 768 KiB |
BIN
examples/06-bump/fieldstone-rgba.tga
Normal file
BIN
examples/06-bump/fieldstone-rgba.tga
Normal file
Binary file not shown.
After (image error) Size: 768 KiB |
82
examples/06-bump/fs_bump.sc
Normal file
82
examples/06-bump/fs_bump.sc
Normal file
|
@ -0,0 +1,82 @@
|
|||
$input v_wpos, v_view, v_normal, v_tangent, v_texcoord0
|
||||
|
||||
/*
|
||||
* Copyright 2011-2012 Branimir Karadzic. All rights reserved.
|
||||
* License: http://www.opensource.org/licenses/BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include "../common/common.sh"
|
||||
|
||||
SAMPLER2D(u_texColor, 0);
|
||||
SAMPLER2D(u_texNormal, 1);
|
||||
uniform vec4 u_lightPosRadius[4];
|
||||
uniform vec4 u_lightRgbInnerR[4];
|
||||
|
||||
vec2 blinn(vec3 _lightDir, vec3 _normal, vec3 _viewDir)
|
||||
{
|
||||
float ndotl = dot(_normal, _lightDir);
|
||||
vec3 reflected = _lightDir - 2.0*ndotl*_normal; // reflect(_lightDir, _normal);
|
||||
float rdotv = dot(reflected, _viewDir);
|
||||
return vec2(ndotl, rdotv);
|
||||
}
|
||||
|
||||
float fresnel(float _ndotl, float _bias, float _pow)
|
||||
{
|
||||
float facing = (1.0 - _ndotl);
|
||||
return max(_bias + (1.0 - _bias) * pow(facing, _pow), 0.0);
|
||||
}
|
||||
|
||||
vec4 lit(float _ndotl, float _rdotv, float _m)
|
||||
{
|
||||
float diff = max(0.0, _ndotl);
|
||||
float spec = step(0.0, _ndotl) * max(0.0, _rdotv * _m);
|
||||
return vec4(1.0, diff, spec, 1.0);
|
||||
}
|
||||
|
||||
vec4 powRgba(vec4 _rgba, float _pow)
|
||||
{
|
||||
vec4 result;
|
||||
result.xyz = pow(_rgba.xyz, vec3_splat(_pow) );
|
||||
result.w = _rgba.w;
|
||||
return result;
|
||||
}
|
||||
|
||||
vec4 toLinear(vec4 _rgba)
|
||||
{
|
||||
return powRgba(_rgba, 2.2);
|
||||
}
|
||||
|
||||
vec4 toGamma(vec4 _rgba)
|
||||
{
|
||||
return powRgba(_rgba, 1.0/2.2);
|
||||
}
|
||||
|
||||
vec3 calcLight(int _idx, mat3 _tbn, vec3 _wpos, vec3 _normal, vec3 _view)
|
||||
{
|
||||
vec3 lp = u_lightPosRadius[_idx].xyz - _wpos;
|
||||
float attn = 1.0 - smoothstep(u_lightRgbInnerR[_idx].w, 1.0, length(lp) / u_lightPosRadius[_idx].w);
|
||||
vec3 lightDir = mul(_tbn, normalize(lp) );
|
||||
vec2 bln = blinn(lightDir, _normal, _view);
|
||||
vec4 lc = lit(bln.x, bln.y, 1.0);
|
||||
vec3 rgb = u_lightRgbInnerR[_idx].xyz*max(0.0, saturate(lc.y) ) * attn;
|
||||
return rgb;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
mat3 tbn = mat3(v_tangent, cross(v_normal, v_tangent), v_normal);
|
||||
|
||||
vec3 normal = normalize(2.0*texture2D(u_texNormal, v_texcoord0).xyz-1.0);
|
||||
|
||||
vec3 lightColor;
|
||||
lightColor = calcLight(0, tbn, v_wpos, normal, v_view);
|
||||
lightColor += calcLight(1, tbn, v_wpos, normal, v_view);
|
||||
lightColor += calcLight(2, tbn, v_wpos, normal, v_view);
|
||||
lightColor += calcLight(3, tbn, v_wpos, normal, v_view);
|
||||
|
||||
vec4 color = toLinear(texture2D(u_texColor, v_texcoord0) );
|
||||
|
||||
gl_FragColor.xyz = max(vec3_splat(0.05), lightColor.xyz)*color.xyz; // + fres*pow(lc.z, 128.0); //normal.xyz; //color.xyz; //*normal;
|
||||
gl_FragColor.w = 1.0;
|
||||
gl_FragColor = toGamma(gl_FragColor);
|
||||
}
|
16
examples/06-bump/makefile
Normal file
16
examples/06-bump/makefile
Normal file
|
@ -0,0 +1,16 @@
|
|||
#
|
||||
# Copyright 2011-2012 Branimir Karadzic. All rights reserved.
|
||||
# License: http://www.opensource.org/licenses/BSD-2-Clause
|
||||
#
|
||||
|
||||
BGFX_DIR=../..
|
||||
RUNTIME_DIR=$(BGFX_DIR)/examples/runtime
|
||||
|
||||
include $(BGFX_DIR)/premake/shader.mk
|
||||
|
||||
rebuild:
|
||||
@make -s --no-print-directory TARGET=0 clean all
|
||||
@make -s --no-print-directory TARGET=1 clean all
|
||||
@make -s --no-print-directory TARGET=2 clean all
|
||||
@make -s --no-print-directory TARGET=3 clean all
|
||||
@make -s --no-print-directory TARGET=4 clean all
|
14
examples/06-bump/varying.def.sc
Normal file
14
examples/06-bump/varying.def.sc
Normal file
|
@ -0,0 +1,14 @@
|
|||
vec2 v_texcoord0 : TEXCOORD0 = vec2(0.0, 0.0);
|
||||
vec3 v_wpos : TEXCOORD1 = vec3(0.0, 0.0, 0.0);
|
||||
vec3 v_view : TEXCOORD2 = vec3(0.0, 0.0, 0.0);
|
||||
vec3 v_normal : NORMAL = vec3(0.0, 0.0, 1.0);
|
||||
vec3 v_tangent : TANGENT = vec3(1.0, 0.0, 0.0);
|
||||
|
||||
vec3 a_position : POSITION;
|
||||
vec3 a_normal : NORMAL;
|
||||
vec3 a_tangent : TANGENT;
|
||||
vec2 a_texcoord0 : TEXCOORD0;
|
||||
vec4 i_data0 : TEXCOORD4;
|
||||
vec4 i_data1 : TEXCOORD5;
|
||||
vec4 i_data2 : TEXCOORD6;
|
||||
vec4 i_data3 : TEXCOORD7;
|
41
examples/06-bump/vs_bump.sc
Normal file
41
examples/06-bump/vs_bump.sc
Normal file
|
@ -0,0 +1,41 @@
|
|||
$input a_position, a_normal, a_tangent, a_texcoord0, i_data0, i_data1, i_data2, i_data3
|
||||
$output v_wpos, v_view, v_normal, v_tangent, v_texcoord0
|
||||
|
||||
/*
|
||||
* Copyright 2011-2012 Branimir Karadzic. All rights reserved.
|
||||
* License: http://www.opensource.org/licenses/BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include "../common/common.sh"
|
||||
|
||||
void main()
|
||||
{
|
||||
mat4 model;
|
||||
model[0] = i_data0;
|
||||
model[1] = i_data1;
|
||||
model[2] = i_data2;
|
||||
model[3] = i_data3;
|
||||
|
||||
vec3 wpos = instMul(model, vec4(a_position, 1.0) ).xyz;
|
||||
gl_Position = mul(u_viewProj, vec4(wpos, 1.0) );
|
||||
|
||||
vec3 normal = a_normal * 2.0f - 1.0f;
|
||||
vec3 wnormal = instMul(model, vec4(normal, 0.0) ).xyz;
|
||||
|
||||
vec3 tangent = a_tangent * 2.0f - 1.0f;
|
||||
vec3 wtangent = instMul(model, vec4(tangent.xyz, 0.0) ).xyz;
|
||||
|
||||
vec3 viewNormal = normalize(mul(u_view, vec4(wnormal, 0.0) ).xyz);
|
||||
vec3 viewTangent = normalize(mul(u_view, vec4(wtangent, 0.0) ).xyz);
|
||||
mat3 tbn = mat3(viewTangent, cross(viewNormal, viewTangent), viewNormal);
|
||||
|
||||
v_wpos = wpos;
|
||||
|
||||
vec3 view = -mul(u_view, vec4(wpos, 1.0) ).xyz;
|
||||
v_view = mul(tbn, view);
|
||||
|
||||
v_normal = viewNormal;
|
||||
v_tangent = viewTangent;
|
||||
|
||||
v_texcoord0 = a_texcoord0;
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
vec4 v_color0 : COLOR0 = vec4(1.0, 0.0, 0.0, 1.0);
|
||||
vec3 v_normal : NORMAL = vec3(0.0, 0.0, 1.0);
|
||||
vec2 v_texcoord0 : TEXCOORD0 = vec2(0.0, 0.0);
|
||||
vec3 v_pos : TEXCOORD1 = vec3(0.0, 0.0, 0.0);
|
||||
vec3 v_view : TEXCOORD2 = vec3(0.0, 0.0, 0.0);
|
||||
|
||||
vec3 a_position : POSITION;
|
||||
vec4 a_color : COLOR0;
|
||||
vec2 a_texcoord0 : TEXCOORD0;
|
||||
vec3 a_normal : NORMAL;
|
BIN
examples/runtime/shaders/dx11/fs_bump.bin
Normal file
BIN
examples/runtime/shaders/dx11/fs_bump.bin
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
examples/runtime/shaders/dx11/vs_bump.bin
Normal file
BIN
examples/runtime/shaders/dx11/vs_bump.bin
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
examples/runtime/shaders/dx9/fs_bump.bin
Normal file
BIN
examples/runtime/shaders/dx9/fs_bump.bin
Normal file
Binary file not shown.
BIN
examples/runtime/shaders/dx9/vs_bump.bin
Normal file
BIN
examples/runtime/shaders/dx9/vs_bump.bin
Normal file
Binary file not shown.
Binary file not shown.
BIN
examples/runtime/shaders/gles/fs_bump.bin
Normal file
BIN
examples/runtime/shaders/gles/fs_bump.bin
Normal file
Binary file not shown.
BIN
examples/runtime/shaders/gles/vs_bump.bin
Normal file
BIN
examples/runtime/shaders/gles/vs_bump.bin
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
examples/runtime/shaders/glsl/fs_bump.bin
Normal file
BIN
examples/runtime/shaders/glsl/fs_bump.bin
Normal file
Binary file not shown.
BIN
examples/runtime/shaders/glsl/vs_bump.bin
Normal file
BIN
examples/runtime/shaders/glsl/vs_bump.bin
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
examples/runtime/textures/fieldstone-n.dds
Normal file
BIN
examples/runtime/textures/fieldstone-n.dds
Normal file
Binary file not shown.
BIN
examples/runtime/textures/fieldstone-rgba.dds
Normal file
BIN
examples/runtime/textures/fieldstone-rgba.dds
Normal file
Binary file not shown.
|
@ -189,6 +189,7 @@ namespace bgfx
|
|||
{
|
||||
Position = 0,
|
||||
Normal,
|
||||
Tangent,
|
||||
Color0,
|
||||
Color1,
|
||||
Indices,
|
||||
|
@ -283,7 +284,7 @@ namespace bgfx
|
|||
VertexBufferHandle handle;
|
||||
};
|
||||
|
||||
struct ConstantType
|
||||
struct UniformType
|
||||
{
|
||||
enum Enum
|
||||
{
|
||||
|
@ -327,7 +328,7 @@ namespace bgfx
|
|||
RendererType::Enum getRendererType();
|
||||
|
||||
///
|
||||
void init(bool _createRenderThread = true, FatalFn _fatal = NULL, ReallocFn _realloc = NULL, FreeFn _free = NULL, CacheFn _cache = NULL);
|
||||
void init(FatalFn _fatal = NULL, ReallocFn _realloc = NULL, FreeFn _free = NULL, CacheFn _cache = NULL);
|
||||
|
||||
///
|
||||
void shutdown();
|
||||
|
@ -365,10 +366,10 @@ namespace bgfx
|
|||
///
|
||||
void setDebug(uint32_t _debug);
|
||||
|
||||
///
|
||||
/// Clear internal debug text buffer.
|
||||
void dbgTextClear(uint8_t _attr = 0, bool _small = false);
|
||||
|
||||
///
|
||||
/// Print into internal debug text buffer.
|
||||
void dbgTextPrintf(uint16_t _x, uint16_t _y, uint8_t _attr, const char* _format, ...);
|
||||
|
||||
///
|
||||
|
@ -471,49 +472,57 @@ namespace bgfx
|
|||
void destroyRenderTarget(RenderTargetHandle _handle);
|
||||
|
||||
///
|
||||
UniformHandle createUniform(const char* _name, ConstantType::Enum _type, uint16_t _num = 1);
|
||||
UniformHandle createUniform(const char* _name, UniformType::Enum _type, uint16_t _num = 1);
|
||||
|
||||
///
|
||||
void destroyUniform(UniformHandle _handle);
|
||||
|
||||
///
|
||||
/// Set view rectangle. Draw primitive outside view will be clipped.
|
||||
void setViewRect(uint8_t _id, uint16_t _x, uint16_t _y, uint16_t _width, uint16_t _height);
|
||||
|
||||
///
|
||||
void setViewRectMask(uint32_t _viewMask, uint16_t _x, uint16_t _y, uint16_t _width, uint16_t _height);
|
||||
|
||||
///
|
||||
/// Set view clear flags.
|
||||
void setViewClear(uint8_t _id, uint8_t _flags, uint32_t _rgba = 0x000000ff, float _depth = 1.0f, uint8_t _stencil = 0);
|
||||
|
||||
///
|
||||
void setViewClearMask(uint32_t _viewMask, uint8_t _flags, uint32_t _rgba = 0x000000ff, float _depth = 1.0f, uint8_t _stencil = 0);
|
||||
|
||||
///
|
||||
/// Set view into sequential mode. Draw calls will be sorted in the same
|
||||
/// order in which submit calls were called.
|
||||
void setViewSeq(uint8_t _id, bool _enabled);
|
||||
|
||||
///
|
||||
void setViewSeqMask(uint32_t _viewMask, bool _enabled);
|
||||
|
||||
///
|
||||
/// Set view render target. View without render target draws primitives
|
||||
/// into default backbuffer.
|
||||
void setViewRenderTarget(uint8_t _id, RenderTargetHandle _handle);
|
||||
|
||||
///
|
||||
void setViewRenderTargetMask(uint32_t _viewMask, RenderTargetHandle _handle);
|
||||
|
||||
///
|
||||
/// Set view view and projection matrices, all draw primitives in this
|
||||
/// view will use these matrices.
|
||||
void setViewTransform(uint8_t _id, const void* _view, const void* _proj, uint8_t _other = 0xff);
|
||||
|
||||
///
|
||||
void setViewTransformMask(uint32_t _viewMask, const void* _view, const void* _proj, uint8_t _other = 0xff);
|
||||
|
||||
///
|
||||
/// Set render states for draw primitive.
|
||||
/// BGFX_STATE_*
|
||||
void setState(uint64_t _state);
|
||||
|
||||
/// Set model matrix for draw primitive. If it is not called model will
|
||||
/// be rendered with identity model matrix.
|
||||
///
|
||||
/// Returns index into matrix cache in case the same model matrix has to
|
||||
/// be used for other draw primitive call.
|
||||
uint32_t setTransform(const void* _mtx, uint16_t _num = 1);
|
||||
|
||||
///
|
||||
void setTransform(uint32_t _cache = 0, uint16_t _num = 1);
|
||||
/// Set model matrix from matrix cache for draw primitive.
|
||||
void setTransform(uint32_t _cache, uint16_t _num = 1);
|
||||
|
||||
///
|
||||
void setUniform(UniformHandle _handle, const void* _value, uint16_t _num = 1);
|
||||
|
@ -543,7 +552,7 @@ namespace bgfx
|
|||
void setVertexBuffer(const TransientVertexBuffer* _vb, uint32_t _numVertices = UINT32_MAX);
|
||||
|
||||
///
|
||||
void setInstanceDataBuffer(const InstanceDataBuffer* _idb);
|
||||
void setInstanceDataBuffer(const InstanceDataBuffer* _idb, uint16_t _num = UINT16_MAX);
|
||||
|
||||
///
|
||||
void setProgram(ProgramHandle _handle);
|
||||
|
|
|
@ -4,15 +4,9 @@ project "example-05-instancing"
|
|||
|
||||
debugdir (BGFX_DIR .. "examples/runtime/")
|
||||
|
||||
defines {
|
||||
"OPENCTM_STATIC",
|
||||
"OPENCTM_NO_CPP",
|
||||
}
|
||||
|
||||
includedirs {
|
||||
BGFX_DIR .. "../bx/include",
|
||||
BGFX_DIR .. "include",
|
||||
BGFX_DIR .. "3rdparty/openctm/lib",
|
||||
}
|
||||
|
||||
files {
|
||||
|
@ -24,7 +18,6 @@ project "example-05-instancing"
|
|||
|
||||
links {
|
||||
"bgfx",
|
||||
"openctm",
|
||||
}
|
||||
|
||||
configuration { "emscripten" }
|
||||
|
|
36
premake/example-06-bump.lua
Normal file
36
premake/example-06-bump.lua
Normal file
|
@ -0,0 +1,36 @@
|
|||
project "example-06-bump"
|
||||
uuid "ffb23e6c-167b-11e2-81df-94c4dd6a022f"
|
||||
kind "WindowedApp"
|
||||
|
||||
debugdir (BGFX_DIR .. "examples/runtime/")
|
||||
|
||||
includedirs {
|
||||
BGFX_DIR .. "../bx/include",
|
||||
BGFX_DIR .. "include",
|
||||
}
|
||||
|
||||
files {
|
||||
BGFX_DIR .. "examples/common/**.cpp",
|
||||
BGFX_DIR .. "examples/common/**.h",
|
||||
BGFX_DIR .. "examples/06-bump/**.cpp",
|
||||
BGFX_DIR .. "examples/06-bump/**.h",
|
||||
}
|
||||
|
||||
links {
|
||||
"bgfx",
|
||||
}
|
||||
|
||||
configuration { "nacl" }
|
||||
targetextension ".nexe"
|
||||
|
||||
configuration { "nacl", "Release" }
|
||||
postbuildcommands {
|
||||
"@echo Stripping symbols.",
|
||||
"@$(NACL)/bin/x86_64-nacl-strip -s \"$(TARGET)\""
|
||||
}
|
||||
|
||||
configuration { "linux" }
|
||||
links {
|
||||
"GL",
|
||||
"pthread",
|
||||
}
|
|
@ -153,7 +153,6 @@ configuration { "mingw" }
|
|||
defines { "WIN32" }
|
||||
includedirs { BX_DIR .. "include/compat/mingw" }
|
||||
buildoptions {
|
||||
"-std=c++0x",
|
||||
"-U__STRICT_ANSI__",
|
||||
"-Wunused-value",
|
||||
"-fdata-sections",
|
||||
|
@ -164,6 +163,11 @@ configuration { "mingw" }
|
|||
"-Wl,--gc-sections",
|
||||
}
|
||||
|
||||
configuration { "*.cpp", "mingw" }
|
||||
buildoptions {
|
||||
"-std=c++0x"
|
||||
}
|
||||
|
||||
configuration { "x32", "mingw" }
|
||||
targetdir (BGFX_BUILD_DIR .. "win32_mingw" .. "/bin")
|
||||
objdir (BGFX_BUILD_DIR .. "win32_mingw" .. "/obj")
|
||||
|
@ -178,7 +182,6 @@ configuration { "x64", "mingw" }
|
|||
|
||||
configuration { "linux" }
|
||||
buildoptions {
|
||||
"-std=c++0x",
|
||||
"-U__STRICT_ANSI__",
|
||||
"-Wunused-value",
|
||||
"-mfpmath=sse", -- force SSE to get 32-bit and 64-bit builds deterministic.
|
||||
|
@ -188,6 +191,11 @@ configuration { "linux" }
|
|||
"-Wl,--gc-sections",
|
||||
}
|
||||
|
||||
configuration { "*.cpp", "linux" }
|
||||
buildoptions {
|
||||
"-std=c++0x"
|
||||
}
|
||||
|
||||
configuration { "linux", "x32" }
|
||||
targetdir (BGFX_BUILD_DIR .. "linux32_gcc" .. "/bin")
|
||||
objdir (BGFX_BUILD_DIR .. "linux32_gcc" .. "/obj")
|
||||
|
@ -217,7 +225,6 @@ configuration { "nacl" }
|
|||
defines { "_BSD_SOURCE=1", "_POSIX_C_SOURCE=199506", "_XOPEN_SOURCE=600" }
|
||||
includedirs { BX_DIR .. "include/compat/nacl" }
|
||||
buildoptions {
|
||||
"-std=c++0x",
|
||||
"-U__STRICT_ANSI__",
|
||||
"-pthread",
|
||||
"-fno-stack-protector",
|
||||
|
@ -233,6 +240,11 @@ configuration { "nacl" }
|
|||
"-Wl,--gc-sections",
|
||||
}
|
||||
|
||||
configuration { "*.cpp", "nacl" }
|
||||
buildoptions {
|
||||
"-std=c++0x"
|
||||
}
|
||||
|
||||
configuration { "x32", "nacl" }
|
||||
targetdir (BGFX_BUILD_DIR .. "nacl-x86" .. "/bin")
|
||||
objdir (BGFX_BUILD_DIR .. "nacl-x86" .. "/obj")
|
||||
|
@ -271,3 +283,4 @@ dofile "example-02-metaballs.lua"
|
|||
dofile "example-03-raymarch.lua"
|
||||
dofile "example-04-mesh.lua"
|
||||
dofile "example-05-instancing.lua"
|
||||
dofile "example-06-bump.lua"
|
||||
|
|
|
@ -64,12 +64,12 @@ ASM = $(VS_ASM) $(FS_ASM)
|
|||
|
||||
$(BUILD_INTERMEDIATE_DIR)/vs_%.bin : vs_%.sc
|
||||
@echo [$(<)]
|
||||
@$(SHADERC) $(VS_FLAGS) --type vertex --depends -o $(@) -f $(<)
|
||||
@$(SHADERC) $(VS_FLAGS) --type vertex --depends -o $(@) -f $(<) --disasm
|
||||
@cp $(@) $(BUILD_OUTPUT_DIR)/$(@F)
|
||||
|
||||
$(BUILD_INTERMEDIATE_DIR)/fs_%.bin : fs_%.sc
|
||||
@echo [$(<)]
|
||||
@$(SHADERC) $(FS_FLAGS) --type fragment --depends -o $(@) -f $(<)
|
||||
@$(SHADERC) $(FS_FLAGS) --type fragment --depends -o $(@) -f $(<) --disasm
|
||||
@cp $(@) $(BUILD_OUTPUT_DIR)/$(@F)
|
||||
|
||||
.PHONY: all
|
||||
|
|
|
@ -10,11 +10,16 @@ project "shaderc"
|
|||
GLSL_OPTIMIZER .. "src/glsl/msvc",
|
||||
}
|
||||
|
||||
configuration { "windows" }
|
||||
configuration { "windows", "vs*" }
|
||||
includedirs {
|
||||
GLSL_OPTIMIZER .. "include/c99",
|
||||
}
|
||||
|
||||
configuration { "windows" }
|
||||
includedirs {
|
||||
"$(DXSDK_DIR)/include",
|
||||
}
|
||||
|
||||
links {
|
||||
"d3dx9",
|
||||
"d3dcompiler",
|
||||
|
@ -23,6 +28,12 @@ project "shaderc"
|
|||
|
||||
configuration {}
|
||||
|
||||
defines { -- fcpp
|
||||
"NINCLUDE=64",
|
||||
"NWORK=65536",
|
||||
"NBUFF=65536",
|
||||
}
|
||||
|
||||
includedirs {
|
||||
BGFX_DIR .. "../bx/include",
|
||||
|
||||
|
|
24
src/bgfx.cpp
24
src/bgfx.cpp
|
@ -517,7 +517,7 @@ namespace bgfx
|
|||
#endif // BGFX_CONFIG_RENDERER_
|
||||
}
|
||||
|
||||
void init(bool _createRenderThread, FatalFn _fatal, ReallocFn _realloc, FreeFn _free, CacheFn _cache)
|
||||
void init(FatalFn _fatal, ReallocFn _realloc, FreeFn _free, CacheFn _cache)
|
||||
{
|
||||
if (NULL != _fatal)
|
||||
{
|
||||
|
@ -537,7 +537,9 @@ namespace bgfx
|
|||
}
|
||||
|
||||
s_threadIndex = BGFX_MAIN_THREAD_MAGIC;
|
||||
s_ctx.init(_createRenderThread);
|
||||
|
||||
// On NaCl renderer is on the main thread.
|
||||
s_ctx.init(!BX_PLATFORM_NACL);
|
||||
}
|
||||
|
||||
void shutdown()
|
||||
|
@ -669,7 +671,7 @@ namespace bgfx
|
|||
#endif // BGFX_CONFIG_DEBUG
|
||||
}
|
||||
|
||||
const uint32_t g_constantTypeSize[ConstantType::Count] =
|
||||
const uint32_t g_uniformTypeSize[UniformType::Count] =
|
||||
{
|
||||
sizeof(int32_t),
|
||||
sizeof(float),
|
||||
|
@ -683,14 +685,14 @@ namespace bgfx
|
|||
4*4*sizeof(float),
|
||||
};
|
||||
|
||||
void ConstantBuffer::writeUniform(ConstantType::Enum _type, uint16_t _loc, const void* _value, uint16_t _num)
|
||||
void ConstantBuffer::writeUniform(UniformType::Enum _type, uint16_t _loc, const void* _value, uint16_t _num)
|
||||
{
|
||||
uint32_t opcode = encodeOpcode(_type, _loc, _num, true);
|
||||
write(opcode);
|
||||
write(_value, g_constantTypeSize[_type]*_num);
|
||||
write(_value, g_uniformTypeSize[_type]*_num);
|
||||
}
|
||||
|
||||
void ConstantBuffer::writeUniformRef(ConstantType::Enum _type, uint16_t _loc, const void* _value, uint16_t _num)
|
||||
void ConstantBuffer::writeUniformRef(UniformType::Enum _type, uint16_t _loc, const void* _value, uint16_t _num)
|
||||
{
|
||||
uint32_t opcode = encodeOpcode(_type, _loc, _num, false);
|
||||
write(opcode);
|
||||
|
@ -722,7 +724,7 @@ namespace bgfx
|
|||
{
|
||||
# if BX_PLATFORM_WINDOWS|BX_PLATFORM_XBOX360
|
||||
m_renderThread = CreateThread(NULL, 16<<10, renderThread, NULL, 0, NULL);
|
||||
# elif BX_PLATFORM_LINUX
|
||||
# elif BX_PLATFORM_POSIX
|
||||
pthread_create(&m_renderThread, NULL, renderThread, NULL);
|
||||
# endif // BX_PLATFORM_
|
||||
}
|
||||
|
@ -770,7 +772,7 @@ namespace bgfx
|
|||
# if BX_PLATFORM_WINDOWS|BX_PLATFORM_XBOX360
|
||||
WaitForSingleObject(m_renderThread, INFINITE);
|
||||
m_renderThread = NULL;
|
||||
# elif BX_PLATFORM_LINUX
|
||||
# elif BX_PLATFORM_POSIX
|
||||
pthread_join(m_renderThread, NULL);
|
||||
m_renderThread = 0;
|
||||
# endif // BX_PLATFORM_*
|
||||
|
@ -1085,7 +1087,7 @@ namespace bgfx
|
|||
s_ctx.destroyRenderTarget(_handle);
|
||||
}
|
||||
|
||||
UniformHandle createUniform(const char* _name, ConstantType::Enum _type, uint16_t _num)
|
||||
UniformHandle createUniform(const char* _name, UniformType::Enum _type, uint16_t _num)
|
||||
{
|
||||
return s_ctx.createUniform(_name, _type, _num);
|
||||
}
|
||||
|
@ -1211,9 +1213,9 @@ namespace bgfx
|
|||
s_ctx.m_submit->setVertexBuffer(_vb, _numVertices);
|
||||
}
|
||||
|
||||
void setInstanceDataBuffer(const InstanceDataBuffer* _idb)
|
||||
void setInstanceDataBuffer(const InstanceDataBuffer* _idb, uint16_t _num)
|
||||
{
|
||||
s_ctx.m_submit->setInstanceDataBuffer(_idb);
|
||||
s_ctx.m_submit->setInstanceDataBuffer(_idb, _num);
|
||||
}
|
||||
|
||||
void setProgram(ProgramHandle _handle)
|
||||
|
|
56
src/bgfx_p.h
56
src/bgfx_p.h
|
@ -179,7 +179,7 @@ namespace bgfx
|
|||
const Memory* m_mem;
|
||||
};
|
||||
|
||||
extern const uint32_t g_constantTypeSize[ConstantType::Count];
|
||||
extern const uint32_t g_uniformTypeSize[UniformType::Count];
|
||||
extern FatalFn g_fatal;
|
||||
extern ReallocFn g_realloc;
|
||||
extern FreeFn g_free;
|
||||
|
@ -696,9 +696,9 @@ namespace bgfx
|
|||
uint16_t m_flags;
|
||||
};
|
||||
|
||||
struct Constant
|
||||
struct Uniform
|
||||
{
|
||||
ConstantType::Enum m_type;
|
||||
UniformType::Enum m_type;
|
||||
uint16_t m_num;
|
||||
};
|
||||
|
||||
|
@ -733,7 +733,7 @@ namespace bgfx
|
|||
g_free(_constantBuffer);
|
||||
}
|
||||
|
||||
static uint32_t encodeOpcode(ConstantType::Enum _type, uint16_t _loc, uint16_t _num, uint16_t _copy)
|
||||
static uint32_t encodeOpcode(UniformType::Enum _type, uint16_t _loc, uint16_t _num, uint16_t _copy)
|
||||
{
|
||||
uint32_t opcode = 0;
|
||||
|
||||
|
@ -752,7 +752,7 @@ namespace bgfx
|
|||
return opcode;
|
||||
}
|
||||
|
||||
static void decodeOpcode(uint32_t _opcode, ConstantType::Enum& _type, uint16_t& _loc, uint16_t& _num, uint16_t& _copy)
|
||||
static void decodeOpcode(uint32_t _opcode, UniformType::Enum& _type, uint16_t& _loc, uint16_t& _num, uint16_t& _copy)
|
||||
{
|
||||
uint32_t copy;
|
||||
uint32_t num;
|
||||
|
@ -767,7 +767,7 @@ namespace bgfx
|
|||
loc = _opcode&CONSTANT_OPCODE_LOC_MASK;
|
||||
_opcode >>= CONSTANT_OPCODE_LOC_BITS;
|
||||
|
||||
_type = (ConstantType::Enum)(_opcode&CONSTANT_OPCODE_TYPE_MASK);
|
||||
_type = (UniformType::Enum)(_opcode&CONSTANT_OPCODE_TYPE_MASK);
|
||||
_opcode >>= CONSTANT_OPCODE_TYPE_BITS;
|
||||
|
||||
_copy = (uint16_t)copy;
|
||||
|
@ -822,12 +822,12 @@ namespace bgfx
|
|||
|
||||
void finish()
|
||||
{
|
||||
write(ConstantType::End);
|
||||
write(UniformType::End);
|
||||
m_pos = 0;
|
||||
}
|
||||
|
||||
void writeUniform(ConstantType::Enum _type, uint16_t _loc, const void* _value, uint16_t _num = 1);
|
||||
void writeUniformRef(ConstantType::Enum _type, uint16_t _loc, const void* _value, uint16_t _num = 1);
|
||||
void writeUniform(UniformType::Enum _type, uint16_t _loc, const void* _value, uint16_t _num = 1);
|
||||
void writeUniformRef(UniformType::Enum _type, uint16_t _loc, const void* _value, uint16_t _num = 1);
|
||||
void commit();
|
||||
|
||||
private:
|
||||
|
@ -878,9 +878,9 @@ namespace bgfx
|
|||
return NULL;
|
||||
}
|
||||
|
||||
const UniformInfo& reg(const char* _name, const void* _data, UniformFn _func = NULL)
|
||||
const UniformInfo& add(const char* _name, const void* _data, UniformFn _func = NULL)
|
||||
{
|
||||
UniformHashMap::const_iterator it = m_uniforms.find(_name);
|
||||
UniformHashMap::iterator it = m_uniforms.find(_name);
|
||||
if (it == m_uniforms.end() )
|
||||
{
|
||||
UniformInfo info;
|
||||
|
@ -1141,13 +1141,13 @@ namespace bgfx
|
|||
g_free(const_cast<TransientVertexBuffer*>(_vb) );
|
||||
}
|
||||
|
||||
void setInstanceDataBuffer(const InstanceDataBuffer* _idb)
|
||||
void setInstanceDataBuffer(const InstanceDataBuffer* _idb, uint16_t _num)
|
||||
{
|
||||
#if BGFX_CONFIG_RENDERER_OPENGLES2
|
||||
#else
|
||||
m_state.m_instanceDataOffset = _idb->offset;
|
||||
m_state.m_instanceDataStride = _idb->stride;
|
||||
m_state.m_numInstances = _idb->num;
|
||||
m_state.m_numInstances = uint16_min(_idb->num, _num);
|
||||
m_state.m_instanceDataBuffer = _idb->handle;
|
||||
g_free(const_cast<InstanceDataBuffer*>(_idb) );
|
||||
#endif // BGFX_CONFIG_RENDERER_OPENGLES
|
||||
|
@ -1227,7 +1227,7 @@ namespace bgfx
|
|||
return offset;
|
||||
}
|
||||
|
||||
void writeConstant(ConstantType::Enum _type, UniformHandle _handle, const void* _value, uint16_t _num)
|
||||
void writeConstant(UniformType::Enum _type, UniformHandle _handle, const void* _value, uint16_t _num)
|
||||
{
|
||||
m_constantBuffer->writeUniform(_type, _handle.idx, _value, _num);
|
||||
}
|
||||
|
@ -1517,7 +1517,7 @@ namespace bgfx
|
|||
|
||||
#if BX_PLATFORM_WINDOWS || BX_PLATFORM_XBOX360
|
||||
DWORD WINAPI renderThread(LPVOID _arg);
|
||||
#elif BX_PLATFORM_LINUX
|
||||
#elif BX_PLATFORM_POSIX
|
||||
void* renderThread(void*);
|
||||
#endif // BX_PLATFORM_
|
||||
|
||||
|
@ -2092,15 +2092,15 @@ namespace bgfx
|
|||
m_submit->free(_handle);
|
||||
}
|
||||
|
||||
UniformHandle createUniform(const char* _name, ConstantType::Enum _type, uint16_t _num)
|
||||
UniformHandle createUniform(const char* _name, UniformType::Enum _type, uint16_t _num)
|
||||
{
|
||||
BX_CHECK(PredefinedUniform::Count == nameToPredefinedUniformEnum(_name), "%s is predefined uniform name.", _name);
|
||||
|
||||
UniformHandle handle = { m_uniformHandle.alloc() };
|
||||
|
||||
Constant& constant = m_constant[handle.idx];
|
||||
constant.m_type = _type;
|
||||
constant.m_num = _num;
|
||||
Uniform& uniform = m_uniform[handle.idx];
|
||||
uniform.m_type = _type;
|
||||
uniform.m_num = _num;
|
||||
|
||||
CommandBuffer& cmdbuf = getCommandBuffer(CommandBuffer::CreateUniform);
|
||||
cmdbuf.write(handle);
|
||||
|
@ -2127,9 +2127,9 @@ namespace bgfx
|
|||
|
||||
void setUniform(UniformHandle _handle, const void* _value, uint16_t _num)
|
||||
{
|
||||
Constant& constant = m_constant[_handle.idx];
|
||||
BX_CHECK(constant.m_num >= _num, "Truncated uniform update. %d (max: %d)", _num, constant.m_num);
|
||||
m_submit->writeConstant(constant.m_type, _handle, _value, uint16_min(constant.m_num, _num) );
|
||||
Uniform& uniform = m_uniform[_handle.idx];
|
||||
BX_CHECK(uniform.m_num >= _num, "Truncated uniform update. %d (max: %d)", _num, uniform.m_num);
|
||||
m_submit->writeConstant(uniform.m_type, _handle, _value, uint16_min(uniform.m_num, _num) );
|
||||
}
|
||||
|
||||
void setUniform(ProgramHandle /*_program*/, UniformHandle /*_handle*/, const void* /*_value*/)
|
||||
|
@ -2356,7 +2356,7 @@ namespace bgfx
|
|||
void rendererDestroyTexture(TextureHandle _handle);
|
||||
void rendererCreateRenderTarget(RenderTargetHandle _handle, uint16_t _width, uint16_t _height, uint32_t _flags, uint32_t _textureFlags);
|
||||
void rendererDestroyRenderTarget(RenderTargetHandle _handle);
|
||||
void rendererCreateUniform(UniformHandle _handle, ConstantType::Enum _type, uint16_t _num, const char* _name);
|
||||
void rendererCreateUniform(UniformHandle _handle, UniformType::Enum _type, uint16_t _num, const char* _name);
|
||||
void rendererDestroyUniform(UniformHandle _handle);
|
||||
void rendererSaveScreenShot(Memory* _mem);
|
||||
void rendererUpdateUniform(uint16_t _loc, const void* _data, uint32_t _size);
|
||||
|
@ -2368,19 +2368,19 @@ namespace bgfx
|
|||
{
|
||||
uint32_t opcode = _constantBuffer->read();
|
||||
|
||||
if (ConstantType::End == opcode)
|
||||
if (UniformType::End == opcode)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
ConstantType::Enum type;
|
||||
UniformType::Enum type;
|
||||
uint16_t loc;
|
||||
uint16_t num;
|
||||
uint16_t copy;
|
||||
ConstantBuffer::decodeOpcode(opcode, type, loc, num, copy);
|
||||
|
||||
const char* data;
|
||||
uint32_t size = g_constantTypeSize[type]*num;
|
||||
uint32_t size = g_uniformTypeSize[type]*num;
|
||||
data = _constantBuffer->read(size);
|
||||
rendererUpdateUniform(loc, data, size);
|
||||
}
|
||||
|
@ -2726,7 +2726,7 @@ namespace bgfx
|
|||
UniformHandle handle;
|
||||
_cmdbuf.read(handle);
|
||||
|
||||
ConstantType::Enum type;
|
||||
UniformType::Enum type;
|
||||
_cmdbuf.read(type);
|
||||
|
||||
uint16_t num;
|
||||
|
@ -2875,7 +2875,7 @@ namespace bgfx
|
|||
RenderTargetHandle m_rt[BGFX_CONFIG_MAX_VIEWS];
|
||||
Clear m_clear[BGFX_CONFIG_MAX_VIEWS];
|
||||
Rect m_rect[BGFX_CONFIG_MAX_VIEWS];
|
||||
Constant m_constant[BGFX_CONFIG_MAX_UNIFORMS];
|
||||
Uniform m_uniform[BGFX_CONFIG_MAX_UNIFORMS];
|
||||
uint16_t m_seq[BGFX_CONFIG_MAX_VIEWS];
|
||||
uint16_t m_seqMask[BGFX_CONFIG_MAX_VIEWS];
|
||||
|
||||
|
|
|
@ -13,20 +13,56 @@
|
|||
# define dFdy ddy
|
||||
|
||||
# if BGFX_SHADER_LANGUAGE_HLSL > 3
|
||||
struct BgfxSampler2D
|
||||
{
|
||||
SamplerState m_sampler;
|
||||
Texture2D m_texture;
|
||||
};
|
||||
|
||||
vec4 bgfxTexture2D(BgfxSampler2D _sampler, vec2 _coord)
|
||||
{
|
||||
return _sampler.m_texture.Sample(_sampler.m_sampler, _coord);
|
||||
}
|
||||
|
||||
struct BgfxSampler3D
|
||||
{
|
||||
SamplerState m_sampler;
|
||||
Texture3D m_texture;
|
||||
};
|
||||
|
||||
vec4 bgfxTexture3D(BgfxSampler3D _sampler, vec3 _coord)
|
||||
{
|
||||
return _sampler.m_texture.Sample(_sampler.m_sampler, _coord);
|
||||
}
|
||||
|
||||
struct BgfxSamplerCube
|
||||
{
|
||||
SamplerState m_sampler;
|
||||
TextureCube m_texture;
|
||||
};
|
||||
|
||||
vec4 bgfxTextureCube(BgfxSamplerCube _sampler, vec3 _coord)
|
||||
{
|
||||
return _sampler.m_texture.Sample(_sampler.m_sampler, _coord);
|
||||
}
|
||||
|
||||
# define SAMPLER2D(_name, _reg) \
|
||||
uniform SamplerState _name ## Sampler : register(s[_reg]); \
|
||||
uniform Texture2D _name : register(t[_reg])
|
||||
# define texture2D(_name, _coord) _name.Sample(_name ## Sampler, _coord)
|
||||
uniform SamplerState _name ## Sampler : register(s[_reg]); \
|
||||
uniform Texture2D _name ## Texture : register(t[_reg]); \
|
||||
static BgfxSampler2D _name = { _name ## Sampler, _name ## Texture }
|
||||
# define texture2D(_name, _coord) bgfxTexture2D(_name, _coord)
|
||||
|
||||
# define SAMPLER3D(_name, _reg) \
|
||||
uniform SamplerState _name : register(s[_reg]) \
|
||||
uniform Texture3D _name : register(t[_reg])
|
||||
# define texture3D(_name, _coord) _name.Sample(_name ## Sampler, _coord)
|
||||
uniform SamplerState _name ## Sampler : register(s[_reg]); \
|
||||
uniform Texture3D _name ## Texture : register(t[_reg]); \
|
||||
static BgfxSampler3D _name = { _name ## Sampler, _name ## Texture }
|
||||
# define texture3D(_name, _coord) bgfxTexture3D(_name, _coord)
|
||||
|
||||
# define SAMPLERCUBE(_name, _reg) \
|
||||
uniform SamplerState _name ## Sampler : register(s[_reg]); \
|
||||
uniform TextureCube _name : register(t[_reg])
|
||||
# define textureCube(_name, _coord) _name.Sample(_name ## Sampler, _coord)
|
||||
uniform SamplerState _name ## Sampler : register(s[_reg]); \
|
||||
uniform TextureCube _name ## Texture : register(t[_reg]); \
|
||||
static BgfxSamplerCube _name = { _name ## Sampler, _name ## Texture }
|
||||
# define textureCube(_name, _coord) bgfxTextureCube(_name, _coord)
|
||||
# else
|
||||
# define SAMPLER2D(_name, _reg) uniform sampler2D _name : register(s ## _reg)
|
||||
# define texture2D tex2D
|
||||
|
@ -45,8 +81,9 @@ vec4 instMul(mat4 _mtx, vec4 _vec)
|
|||
return mul(_vec, _mtx);
|
||||
}
|
||||
#elif BGFX_SHADER_LANGUAGE_GLSL
|
||||
# define frac fract
|
||||
# define lerp mix
|
||||
# define atan2(_x, _y) atan(_x, _y)
|
||||
# define frac(_x) fract(_x)
|
||||
# define lerp(_x, _y, _t) mix(_x, _y, _t)
|
||||
# define mul(_a, _b) ( (_a) * (_b) )
|
||||
# define saturate(_x) clamp(_x, 0.0, 1.0)
|
||||
# define SAMPLER2D(_name, _reg) uniform sampler2D _name
|
||||
|
|
|
@ -16,6 +16,4 @@ uniform mat4 u_modelViewProj;
|
|||
uniform mat4 u_modelViewProjX;
|
||||
uniform mat4 u_viewProjX;
|
||||
|
||||
SAMPLER2D(u_texColor, 0);
|
||||
|
||||
#endif // __SHADER_COMMON_H__
|
||||
|
|
37
src/config.h
37
src/config.h
|
@ -14,34 +14,45 @@
|
|||
&& !defined(BGFX_CONFIG_RENDERER_NULL)
|
||||
|
||||
# ifndef BGFX_CONFIG_RENDERER_DIRECT3D9
|
||||
# define BGFX_CONFIG_RENDERER_DIRECT3D9 (BX_PLATFORM_WINDOWS|BX_PLATFORM_XBOX360)
|
||||
# define BGFX_CONFIG_RENDERER_DIRECT3D9 (0 \
|
||||
| BX_PLATFORM_WINDOWS \
|
||||
| BX_PLATFORM_XBOX360 \
|
||||
)
|
||||
# endif // BGFX_CONFIG_RENDERER_DIRECT3D9
|
||||
|
||||
# ifndef BGFX_CONFIG_RENDERER_DIRECT3D11
|
||||
# define BGFX_CONFIG_RENDERER_DIRECT3D11 0
|
||||
# define BGFX_CONFIG_RENDERER_DIRECT3D11 (0 \
|
||||
)
|
||||
# endif // BGFX_CONFIG_RENDERER_DIRECT3D11
|
||||
|
||||
# ifndef BGFX_CONFIG_RENDERER_OPENGL
|
||||
# define BGFX_CONFIG_RENDERER_OPENGL (BX_PLATFORM_LINUX|BX_PLATFORM_OSX)
|
||||
# define BGFX_CONFIG_RENDERER_OPENGL (0 \
|
||||
| BX_PLATFORM_LINUX \
|
||||
| BX_PLATFORM_OSX \
|
||||
)
|
||||
# endif // BGFX_CONFIG_RENDERER_OPENGL
|
||||
|
||||
# ifndef BGFX_CONFIG_RENDERER_OPENGLES2
|
||||
# define BGFX_CONFIG_RENDERER_OPENGLES2 (BX_PLATFORM_EMSCRIPTEN \
|
||||
|BX_PLATFORM_NACL \
|
||||
|BX_PLATFORM_ANDROID \
|
||||
|BX_PLATFORM_IOS)
|
||||
# define BGFX_CONFIG_RENDERER_OPENGLES2 (0 \
|
||||
| BX_PLATFORM_EMSCRIPTEN \
|
||||
| BX_PLATFORM_NACL \
|
||||
| BX_PLATFORM_ANDROID \
|
||||
| BX_PLATFORM_IOS \
|
||||
)
|
||||
# endif // BGFX_CONFIG_RENDERER_OPENGLES2
|
||||
|
||||
# ifndef BGFX_CONFIG_RENDERER_OPENGLES3
|
||||
# define BGFX_CONFIG_RENDERER_OPENGLES3 0
|
||||
# define BGFX_CONFIG_RENDERER_OPENGLES3 (0 \
|
||||
)
|
||||
# endif // BGFX_CONFIG_RENDERER_OPENGLES3
|
||||
|
||||
# ifndef BGFX_CONFIG_RENDERER_NULL
|
||||
# define BGFX_CONFIG_RENDERER_NULL (!(BGFX_CONFIG_RENDERER_DIRECT3D9 \
|
||||
|BGFX_CONFIG_RENDERER_DIRECT3D11 \
|
||||
|BGFX_CONFIG_RENDERER_OPENGL \
|
||||
|BGFX_CONFIG_RENDERER_OPENGLES2 \
|
||||
|BGFX_CONFIG_RENDERER_OPENGLES3 \
|
||||
# define BGFX_CONFIG_RENDERER_NULL (!(0 \
|
||||
| BGFX_CONFIG_RENDERER_DIRECT3D9 \
|
||||
| BGFX_CONFIG_RENDERER_DIRECT3D11 \
|
||||
| BGFX_CONFIG_RENDERER_OPENGL \
|
||||
| BGFX_CONFIG_RENDERER_OPENGLES2 \
|
||||
| BGFX_CONFIG_RENDERER_OPENGLES3 \
|
||||
) )
|
||||
# endif // BGFX_CONFIG_RENDERER_NULL
|
||||
#endif // !defined...
|
||||
|
|
|
@ -1,38 +1,38 @@
|
|||
static const uint8_t fs_clear_dx11[553] =
|
||||
static const uint8_t fs_clear_dx11[554] =
|
||||
{
|
||||
0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x00, 0x14, 0x02, 0x44, 0x58, 0x42, 0x43, 0xda, 0x0f, 0xc3, 0x91, 0x70, 0x6f, 0xd4, 0x7b, // ....DXBC....po.{
|
||||
0xeb, 0xe0, 0x21, 0x07, 0x79, 0xd8, 0x54, 0xd4, 0x01, 0x00, 0x00, 0x00, 0x14, 0x02, 0x00, 0x00, // ..!.y.T.........
|
||||
0x05, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // ....4...........
|
||||
0x34, 0x01, 0x00, 0x00, 0x78, 0x01, 0x00, 0x00, 0x52, 0x44, 0x45, 0x46, 0x70, 0x00, 0x00, 0x00, // 4...x...RDEFp...
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, // ............<...
|
||||
0x00, 0x05, 0xff, 0xff, 0x00, 0x91, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x52, 0x44, 0x31, 0x31, // ........<...RD11
|
||||
0x3c, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, // <....... ...(...
|
||||
0x24, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4d, 0x69, 0x63, 0x72, // $...........Micr
|
||||
0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, // osoft (R) HLSL S
|
||||
0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, // hader Compiler 9
|
||||
0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0xab, 0xab, 0xab, // .29.952.3111....
|
||||
0x49, 0x53, 0x47, 0x4e, 0x4c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, // ISGNL...........
|
||||
0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // 8...............
|
||||
0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........D.......
|
||||
0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, // ................
|
||||
0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, // SV_POSITION.COLO
|
||||
0x52, 0x00, 0xab, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // R...OSGN,.......
|
||||
0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .... ...........
|
||||
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, // ............SV_T
|
||||
0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x45, 0x58, 0x3c, 0x00, 0x00, 0x00, // ARGET...SHEX<...
|
||||
0x50, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, 0x62, 0x10, 0x00, 0x03, // P.......j...b...
|
||||
0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, // ........e.... ..
|
||||
0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // ....6.... ......
|
||||
0x46, 0x1e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x53, 0x54, 0x41, 0x54, // F.......>...STAT
|
||||
0x94, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x00, 0x00, 0x14, 0x02, 0x44, 0x58, 0x42, 0x43, 0xda, 0x0f, 0xc3, 0x91, 0x70, 0x6f, 0xd4, // .....DXBC....po.
|
||||
0x7b, 0xeb, 0xe0, 0x21, 0x07, 0x79, 0xd8, 0x54, 0xd4, 0x01, 0x00, 0x00, 0x00, 0x14, 0x02, 0x00, // {..!.y.T........
|
||||
0x00, 0x05, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // .....4..........
|
||||
0x00, 0x34, 0x01, 0x00, 0x00, 0x78, 0x01, 0x00, 0x00, 0x52, 0x44, 0x45, 0x46, 0x70, 0x00, 0x00, // .4...x...RDEFp..
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, // .............<..
|
||||
0x00, 0x00, 0x05, 0xff, 0xff, 0x00, 0x91, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x52, 0x44, 0x31, // .........<...RD1
|
||||
0x31, 0x3c, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, // 1<....... ...(..
|
||||
0x00, 0x24, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4d, 0x69, 0x63, // .$...........Mic
|
||||
0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, // rosoft (R) HLSL
|
||||
0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, // Shader Compiler
|
||||
0x39, 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0xab, 0xab, // 9.29.952.3111...
|
||||
0xab, 0x49, 0x53, 0x47, 0x4e, 0x4c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // .ISGNL..........
|
||||
0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // .8..............
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .........D......
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, // ................
|
||||
0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, // .SV_POSITION.COL
|
||||
0x4f, 0x52, 0x00, 0xab, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // OR...OSGN,......
|
||||
0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ..... ..........
|
||||
0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, // .............SV_
|
||||
0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x45, 0x58, 0x3c, 0x00, 0x00, // TARGET...SHEX<..
|
||||
0x00, 0x50, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, 0x62, 0x10, 0x00, // .P.......j...b..
|
||||
0x03, 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, // .........e.... .
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, // .....6.... .....
|
||||
0x00, 0x46, 0x1e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x53, 0x54, 0x41, // .F.......>...STA
|
||||
0x54, 0x94, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // T...............
|
||||
0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .........
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ..........
|
||||
};
|
||||
|
|
|
@ -7,6 +7,8 @@ $input v_color0, v_color1, v_texcoord0
|
|||
|
||||
#include "common.sh"
|
||||
|
||||
SAMPLER2D(u_texColor, 0);
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 color = lerp(v_color1, v_color0, texture2D(u_texColor, v_texcoord0).xxxx);
|
||||
|
|
|
@ -1,61 +1,61 @@
|
|||
static const uint8_t fs_debugfont_dx11[913] =
|
||||
static const uint8_t fs_debugfont_dx11[922] =
|
||||
{
|
||||
0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x00, 0x7c, 0x03, 0x44, 0x58, 0x42, 0x43, 0xd3, 0x76, 0x1b, 0xcc, 0x1f, 0xe1, 0xf5, 0xdf, // ..|.DXBC.v......
|
||||
0xf3, 0xe2, 0xb1, 0x53, 0x82, 0xc1, 0xcf, 0x87, 0x01, 0x00, 0x00, 0x00, 0x7c, 0x03, 0x00, 0x00, // ...S........|...
|
||||
0x05, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x08, 0x01, 0x00, 0x00, 0x94, 0x01, 0x00, 0x00, // ....4...........
|
||||
0xc8, 0x01, 0x00, 0x00, 0xe0, 0x02, 0x00, 0x00, 0x52, 0x44, 0x45, 0x46, 0xcc, 0x00, 0x00, 0x00, // ........RDEF....
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, // ............<...
|
||||
0x00, 0x05, 0xff, 0xff, 0x00, 0x91, 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0x52, 0x44, 0x31, 0x31, // ............RD11
|
||||
0x3c, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, // <....... ...(...
|
||||
0x24, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, // $...........|...
|
||||
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, 0x00, // ................
|
||||
0x02, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, // ................
|
||||
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x74, 0x65, // ............u_te
|
||||
0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x00, 0x75, 0x5f, // xColorSampler.u_
|
||||
0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, // texColor.Microso
|
||||
0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, // ft (R) HLSL Shad
|
||||
0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, 0x2e, 0x32, 0x39, // er Compiler 9.29
|
||||
0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0xab, 0xab, 0x49, 0x53, 0x47, 0x4e, // .952.3111...ISGN
|
||||
0x84, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, // ............h...
|
||||
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x0f, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....t...........
|
||||
0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, // ............t...
|
||||
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // ................
|
||||
0x0f, 0x0f, 0x00, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ....z...........
|
||||
0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, // ............SV_P
|
||||
0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0x54, 0x45, // OSITION.COLOR.TE
|
||||
0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, // XCOORD..OSGN,...
|
||||
0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ .......
|
||||
0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, // ................
|
||||
0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x45, 0x58, // SV_TARGET...SHEX
|
||||
0x10, 0x01, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, // ....P...D...j...
|
||||
0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x18, 0x00, 0x04, // Z....`......X...
|
||||
0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, // .p......UU..b...
|
||||
0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, // ........b.......
|
||||
0x02, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, // ....b...2.......
|
||||
0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, // e.... ......h...
|
||||
0x02, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x8b, 0xc2, 0x00, 0x00, 0x80, 0x43, 0x55, 0x15, 0x00, // ....E.......CU..
|
||||
0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, // ........F.......
|
||||
0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // F~.......`......
|
||||
0x00, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, // ............F...
|
||||
0x01, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // ....F...A.......
|
||||
0x32, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, // 2...............
|
||||
0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, // ....F.......F...
|
||||
0x02, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ....1...........
|
||||
0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x81, 0x80, 0x80, 0x3b, // :........@.....;
|
||||
0x0d, 0x00, 0x04, 0x03, 0x0a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, // ............6...
|
||||
0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // . ......F.......
|
||||
0x3e, 0x00, 0x00, 0x01, 0x53, 0x54, 0x41, 0x54, 0x94, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, // >...STAT........
|
||||
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x00, 0x00, 0x84, 0x03, 0x44, 0x58, 0x42, 0x43, 0x7f, 0x04, 0x32, 0xab, 0xf6, 0xa8, 0x90, // .....DXBC..2....
|
||||
0xe5, 0x2c, 0xd4, 0x3b, 0xd7, 0xa9, 0x89, 0x79, 0xfd, 0x01, 0x00, 0x00, 0x00, 0x84, 0x03, 0x00, // .,.;...y........
|
||||
0x00, 0x05, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x9c, 0x01, 0x00, // .....4..........
|
||||
0x00, 0xd0, 0x01, 0x00, 0x00, 0xe8, 0x02, 0x00, 0x00, 0x52, 0x44, 0x45, 0x46, 0xd4, 0x00, 0x00, // .........RDEF...
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, // .............<..
|
||||
0x00, 0x00, 0x05, 0xff, 0xff, 0x00, 0x91, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x52, 0x44, 0x31, // .............RD1
|
||||
0x31, 0x3c, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, // 1<....... ...(..
|
||||
0x00, 0x24, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, // .$...........|..
|
||||
0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x8e, 0x00, 0x00, // ................
|
||||
0x00, 0x02, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, // ................
|
||||
0xff, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x74, // .............u_t
|
||||
0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x00, 0x75, // exColorSampler.u
|
||||
0x5f, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, // _texColorTexture
|
||||
0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, // .Microsoft (R) H
|
||||
0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, // LSL Shader Compi
|
||||
0x6c, 0x65, 0x72, 0x20, 0x39, 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, // ler 9.29.952.311
|
||||
0x31, 0x00, 0xab, 0xab, 0xab, 0x49, 0x53, 0x47, 0x4e, 0x84, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, // 1....ISGN.......
|
||||
0x00, 0x08, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // .....h..........
|
||||
0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, // .............t..
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // ................
|
||||
0x00, 0x0f, 0x0f, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .....t..........
|
||||
0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x7a, 0x00, 0x00, // .............z..
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // ................
|
||||
0x00, 0x03, 0x03, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, // .....SV_POSITION
|
||||
0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, // .COLOR.TEXCOORD.
|
||||
0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // .OSGN,..........
|
||||
0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // . ..............
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, // .........SV_TARG
|
||||
0x45, 0x54, 0x00, 0xab, 0xab, 0x53, 0x48, 0x45, 0x58, 0x10, 0x01, 0x00, 0x00, 0x50, 0x00, 0x00, // ET...SHEX....P..
|
||||
0x00, 0x44, 0x00, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, // .D...j...Z....`.
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x18, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, // .....X....p.....
|
||||
0x00, 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, // .UU..b..........
|
||||
0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, // .b...........b..
|
||||
0x03, 0x32, 0x10, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, // .2.......e.... .
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, // .....h.......E..
|
||||
0x8b, 0xc2, 0x00, 0x00, 0x80, 0x43, 0x55, 0x15, 0x00, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // .....CU.........
|
||||
0x00, 0x46, 0x10, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, // .F.......F~.....
|
||||
0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, // ..`.............
|
||||
0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, // .....F.......F..
|
||||
0x80, 0x41, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, // .A.......2......
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, // .............F..
|
||||
0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, // .....F.......1..
|
||||
0x07, 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, // .........:......
|
||||
0x00, 0x01, 0x40, 0x00, 0x00, 0x81, 0x80, 0x80, 0x3b, 0x0d, 0x00, 0x04, 0x03, 0x0a, 0x00, 0x10, // ..@.....;.......
|
||||
0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, // .....6.... .....
|
||||
0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x53, 0x54, 0x41, // .F.......>...STA
|
||||
0x54, 0x94, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // T...............
|
||||
0x00, 0x04, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // ................
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, // .
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ..........
|
||||
};
|
||||
|
|
|
@ -102,6 +102,7 @@ namespace bgfx
|
|||
{
|
||||
{ "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
|
||||
{ "NORMAL", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
|
||||
{ "TANGENT", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
|
||||
{ "COLOR", 0, DXGI_FORMAT_R8G8B8A8_UINT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
|
||||
{ "COLOR", 1, DXGI_FORMAT_R8G8B8A8_UINT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
|
||||
{ "BLENDINDICES", 0, DXGI_FORMAT_R8G8B8A8_UINT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
|
||||
|
@ -324,8 +325,8 @@ namespace bgfx
|
|||
|
||||
for (uint32_t ii = 0; ii < PredefinedUniform::Count; ++ii)
|
||||
{
|
||||
m_predefinedUniforms[ii].create(ConstantType::Uniform4x4fv, 1, false);
|
||||
m_uniformReg.reg(getPredefinedUniformName(PredefinedUniform::Enum(ii) ), &m_predefinedUniforms[ii]);
|
||||
m_predefinedUniforms[ii].create(UniformType::Uniform4x4fv, 1, false);
|
||||
m_uniformReg.add(getPredefinedUniformName(PredefinedUniform::Enum(ii) ), &m_predefinedUniforms[ii]);
|
||||
}
|
||||
|
||||
postReset();
|
||||
|
@ -773,8 +774,8 @@ namespace bgfx
|
|||
Texture m_textures[BGFX_CONFIG_MAX_TEXTURES];
|
||||
VertexDecl m_vertexDecls[BGFX_CONFIG_MAX_VERTEX_DECLS];
|
||||
RenderTarget m_renderTargets[BGFX_CONFIG_MAX_RENDER_TARGETS];
|
||||
Uniform m_uniforms[BGFX_CONFIG_MAX_UNIFORMS];
|
||||
Uniform m_predefinedUniforms[PredefinedUniform::Count];
|
||||
UniformBuffer m_uniforms[BGFX_CONFIG_MAX_UNIFORMS];
|
||||
UniformBuffer m_predefinedUniforms[PredefinedUniform::Count];
|
||||
UniformRegistry m_uniformReg;
|
||||
|
||||
StateCacheT<ID3D11BlendState> m_blendStateCache;
|
||||
|
@ -911,12 +912,12 @@ namespace bgfx
|
|||
{
|
||||
uint32_t opcode = read();
|
||||
|
||||
if (ConstantType::End == opcode)
|
||||
if (UniformType::End == opcode)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
ConstantType::Enum type;
|
||||
UniformType::Enum type;
|
||||
uint16_t loc;
|
||||
uint16_t num;
|
||||
uint16_t copy;
|
||||
|
@ -925,7 +926,7 @@ namespace bgfx
|
|||
const char* data;
|
||||
if (copy)
|
||||
{
|
||||
data = read(g_constantTypeSize[type]*num);
|
||||
data = read(g_uniformTypeSize[type]*num);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -933,8 +934,8 @@ namespace bgfx
|
|||
}
|
||||
|
||||
#define CASE_IMPLEMENT_UNIFORM(_uniform, _glsuffix, _dxsuffix, _type) \
|
||||
case ConstantType::_uniform: \
|
||||
case ConstantType::_uniform|BGFX_UNIFORM_FRAGMENTBIT: \
|
||||
case UniformType::_uniform: \
|
||||
case UniformType::_uniform|BGFX_UNIFORM_FRAGMENTBIT: \
|
||||
{ \
|
||||
s_renderCtx.setShaderConstant(type, loc, data, num); \
|
||||
} \
|
||||
|
@ -952,7 +953,7 @@ namespace bgfx
|
|||
CASE_IMPLEMENT_UNIFORM(Uniform3x3fv, Matrix3fv, F, float);
|
||||
CASE_IMPLEMENT_UNIFORM(Uniform4x4fv, Matrix4fv, F, float);
|
||||
|
||||
case ConstantType::End:
|
||||
case UniformType::End:
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -1183,13 +1184,13 @@ namespace bgfx
|
|||
else
|
||||
{
|
||||
const UniformInfo* info = s_renderCtx.m_uniformReg.find(name);
|
||||
Uniform* uniform = info != NULL ? (Uniform*)info->m_data : NULL;
|
||||
UniformBuffer* uniform = info != NULL ? (UniformBuffer*)info->m_data : NULL;
|
||||
|
||||
if (NULL != uniform)
|
||||
{
|
||||
kind = "user";
|
||||
data = uniform->m_data;
|
||||
m_constantBuffer->writeUniformRef( (ConstantType::Enum)(type|fragmentBit), regIndex, data, regCount);
|
||||
m_constantBuffer->writeUniformRef( (UniformType::Enum)(type|fragmentBit), regIndex, data, regCount);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1607,9 +1608,9 @@ namespace bgfx
|
|||
s_renderCtx.m_textureStage.m_sampler[_stage] = m_sampler;
|
||||
}
|
||||
|
||||
void Uniform::create(ConstantType::Enum _type, uint16_t _num, bool _alloc)
|
||||
void UniformBuffer::create(UniformType::Enum _type, uint16_t _num, bool _alloc)
|
||||
{
|
||||
uint32_t size = BX_ALIGN_16(g_constantTypeSize[_type]*_num);
|
||||
uint32_t size = BX_ALIGN_16(g_uniformTypeSize[_type]*_num);
|
||||
if (_alloc)
|
||||
{
|
||||
m_data = g_realloc(NULL, size);
|
||||
|
@ -1626,7 +1627,7 @@ namespace bgfx
|
|||
DX_CHECK(s_renderCtx.m_device->CreateBuffer(&desc, NULL, &m_ptr) );
|
||||
}
|
||||
|
||||
void Uniform::destroy()
|
||||
void UniformBuffer::destroy()
|
||||
{
|
||||
if (NULL != m_data)
|
||||
{
|
||||
|
@ -1769,10 +1770,10 @@ namespace bgfx
|
|||
s_renderCtx.m_renderTargets[_handle.idx].destroy();
|
||||
}
|
||||
|
||||
void Context::rendererCreateUniform(UniformHandle _handle, ConstantType::Enum _type, uint16_t _num, const char* _name)
|
||||
void Context::rendererCreateUniform(UniformHandle _handle, UniformType::Enum _type, uint16_t _num, const char* _name)
|
||||
{
|
||||
s_renderCtx.m_uniforms[_handle.idx].create(_type, _num);
|
||||
s_renderCtx.m_uniformReg.reg(_name, &s_renderCtx.m_uniforms[_handle.idx]);
|
||||
s_renderCtx.m_uniformReg.add(_name, &s_renderCtx.m_uniforms[_handle.idx]);
|
||||
}
|
||||
|
||||
void Context::rendererDestroyUniform(UniformHandle _handle)
|
||||
|
|
|
@ -108,15 +108,15 @@ namespace bgfx
|
|||
bool m_dynamic;
|
||||
};
|
||||
|
||||
struct Uniform
|
||||
struct UniformBuffer
|
||||
{
|
||||
Uniform()
|
||||
UniformBuffer()
|
||||
: m_ptr(NULL)
|
||||
, m_data(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
void create(ConstantType::Enum _type, uint16_t _num, bool _alloc = true);
|
||||
void create(UniformType::Enum _type, uint16_t _num, bool _alloc = true);
|
||||
void destroy();
|
||||
|
||||
ID3D11Buffer* m_ptr;
|
||||
|
|
|
@ -844,6 +844,7 @@ namespace bgfx
|
|||
{
|
||||
{ 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0 },
|
||||
{ 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_NORMAL, 0 },
|
||||
{ 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TANGENT, 0 },
|
||||
{ 0, 0, D3DDECLTYPE_UBYTE4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0 },
|
||||
{ 0, 0, D3DDECLTYPE_UBYTE4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 1 },
|
||||
{ 0, 0, D3DDECLTYPE_UBYTE4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_BLENDINDICES, 0 },
|
||||
|
@ -1041,7 +1042,7 @@ namespace bgfx
|
|||
{
|
||||
kind = "user";
|
||||
data = info->m_data;
|
||||
m_constantBuffer->writeUniformRef( (ConstantType::Enum)(type|fragmentBit), regIndex, data, regCount);
|
||||
m_constantBuffer->writeUniformRef( (UniformType::Enum)(type|fragmentBit), regIndex, data, regCount);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1589,12 +1590,12 @@ namespace bgfx
|
|||
{
|
||||
uint32_t opcode = read();
|
||||
|
||||
if (ConstantType::End == opcode)
|
||||
if (UniformType::End == opcode)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
ConstantType::Enum type;
|
||||
UniformType::Enum type;
|
||||
uint16_t loc;
|
||||
uint16_t num;
|
||||
uint16_t copy;
|
||||
|
@ -1603,7 +1604,7 @@ namespace bgfx
|
|||
const char* data;
|
||||
if (copy)
|
||||
{
|
||||
data = read(g_constantTypeSize[type]*num);
|
||||
data = read(g_uniformTypeSize[type]*num);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1611,14 +1612,14 @@ namespace bgfx
|
|||
}
|
||||
|
||||
#define CASE_IMPLEMENT_UNIFORM(_uniform, _glsuffix, _dxsuffix, _type) \
|
||||
case ConstantType::_uniform: \
|
||||
case UniformType::_uniform: \
|
||||
{ \
|
||||
_type* value = (_type*)data; \
|
||||
s_renderCtx.m_device->SetVertexShaderConstant##_dxsuffix(loc, value, num); \
|
||||
} \
|
||||
break; \
|
||||
\
|
||||
case ConstantType::_uniform|BGFX_UNIFORM_FRAGMENTBIT: \
|
||||
case UniformType::_uniform|BGFX_UNIFORM_FRAGMENTBIT: \
|
||||
{ \
|
||||
_type* value = (_type*)data; \
|
||||
s_renderCtx.m_device->SetPixelShaderConstant##_dxsuffix(loc, value, num); \
|
||||
|
@ -1637,7 +1638,7 @@ namespace bgfx
|
|||
CASE_IMPLEMENT_UNIFORM(Uniform3x3fv, Matrix3fv, F, float);
|
||||
CASE_IMPLEMENT_UNIFORM(Uniform4x4fv, Matrix4fv, F, float);
|
||||
|
||||
case ConstantType::End:
|
||||
case UniformType::End:
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -1843,13 +1844,13 @@ namespace bgfx
|
|||
s_renderCtx.m_renderTargets[_handle.idx].destroy();
|
||||
}
|
||||
|
||||
void Context::rendererCreateUniform(UniformHandle _handle, ConstantType::Enum _type, uint16_t _num, const char* _name)
|
||||
void Context::rendererCreateUniform(UniformHandle _handle, UniformType::Enum _type, uint16_t _num, const char* _name)
|
||||
{
|
||||
uint32_t size = BX_ALIGN_16(g_constantTypeSize[_type]*_num);
|
||||
uint32_t size = BX_ALIGN_16(g_uniformTypeSize[_type]*_num);
|
||||
void* data = g_realloc(NULL, size);
|
||||
memset(data, 0, size);
|
||||
s_renderCtx.m_uniforms[_handle.idx] = data;
|
||||
s_renderCtx.m_uniformReg.reg(_name, s_renderCtx.m_uniforms[_handle.idx]);
|
||||
s_renderCtx.m_uniformReg.add(_name, s_renderCtx.m_uniforms[_handle.idx]);
|
||||
}
|
||||
|
||||
void Context::rendererDestroyUniform(UniformHandle _handle)
|
||||
|
|
|
@ -453,7 +453,6 @@ namespace bgfx
|
|||
|
||||
void saveScreenShot(Memory* _mem)
|
||||
{
|
||||
#if BGFX_CONFIG_RENDERER_OPENGL
|
||||
void* data = g_realloc(NULL, m_resolution.m_width*m_resolution.m_height*4);
|
||||
glReadPixels(0, 0, m_resolution.m_width, m_resolution.m_height, GL_RGBA, GL_UNSIGNED_BYTE, data);
|
||||
|
||||
|
@ -468,7 +467,6 @@ namespace bgfx
|
|||
|
||||
saveTga( (const char*)_mem->data, m_resolution.m_width, m_resolution.m_height, m_resolution.m_width*4, data, false, true);
|
||||
g_free(data);
|
||||
#endif // BGFX_CONFIG_RENDERER_OPENGL
|
||||
}
|
||||
|
||||
void init()
|
||||
|
@ -666,7 +664,8 @@ namespace bgfx
|
|||
{
|
||||
"a_position",
|
||||
"a_normal",
|
||||
"a_color",
|
||||
"a_tangent",
|
||||
"a_color0",
|
||||
"a_color1",
|
||||
"a_indices",
|
||||
"a_weight",
|
||||
|
@ -825,30 +824,30 @@ namespace bgfx
|
|||
return "UNKNOWN GLENUM!";
|
||||
}
|
||||
|
||||
ConstantType::Enum convertGlType(GLenum _type)
|
||||
UniformType::Enum convertGlType(GLenum _type)
|
||||
{
|
||||
switch (_type)
|
||||
{
|
||||
case GL_FLOAT:
|
||||
return ConstantType::Uniform1fv;
|
||||
return UniformType::Uniform1fv;
|
||||
|
||||
case GL_FLOAT_VEC2:
|
||||
return ConstantType::Uniform2fv;
|
||||
return UniformType::Uniform2fv;
|
||||
|
||||
case GL_FLOAT_VEC3:
|
||||
return ConstantType::Uniform3fv;
|
||||
return UniformType::Uniform3fv;
|
||||
|
||||
case GL_FLOAT_VEC4:
|
||||
return ConstantType::Uniform4fv;
|
||||
return UniformType::Uniform4fv;
|
||||
|
||||
case GL_FLOAT_MAT2:
|
||||
break;
|
||||
|
||||
case GL_FLOAT_MAT3:
|
||||
return ConstantType::Uniform3x3fv;
|
||||
return UniformType::Uniform3x3fv;
|
||||
|
||||
case GL_FLOAT_MAT4:
|
||||
return ConstantType::Uniform4x4fv;
|
||||
return UniformType::Uniform4x4fv;
|
||||
|
||||
// case GL_FLOAT_MAT2x3:
|
||||
// case GL_FLOAT_MAT2x4:
|
||||
|
@ -864,10 +863,10 @@ namespace bgfx
|
|||
// case GL_SAMPLER_3D:
|
||||
// case GL_SAMPLER_1D_SHADOW:
|
||||
// case GL_SAMPLER_2D_SHADOW:
|
||||
return ConstantType::Uniform1iv;
|
||||
return UniformType::Uniform1iv;
|
||||
};
|
||||
|
||||
return ConstantType::End;
|
||||
return UniformType::End;
|
||||
}
|
||||
|
||||
void Program::create(const Shader& _vsh, const Shader& _fsh)
|
||||
|
@ -1032,7 +1031,7 @@ namespace bgfx
|
|||
if (NULL != info)
|
||||
{
|
||||
data = info->m_data;
|
||||
ConstantType::Enum type = convertGlType(gltype);
|
||||
UniformType::Enum type = convertGlType(gltype);
|
||||
m_constantBuffer->writeUniformRef(type, loc, data, num);
|
||||
BX_TRACE("store %s %p", name, data);
|
||||
}
|
||||
|
@ -1643,12 +1642,12 @@ namespace bgfx
|
|||
{
|
||||
uint32_t opcode = read();
|
||||
|
||||
if (ConstantType::End == opcode)
|
||||
if (UniformType::End == opcode)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
ConstantType::Enum type;
|
||||
UniformType::Enum type;
|
||||
uint16_t loc;
|
||||
uint16_t num;
|
||||
uint16_t copy;
|
||||
|
@ -1657,7 +1656,7 @@ namespace bgfx
|
|||
const char* data;
|
||||
if (copy)
|
||||
{
|
||||
data = read(g_constantTypeSize[type]*num);
|
||||
data = read(g_uniformTypeSize[type]*num);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1665,7 +1664,7 @@ namespace bgfx
|
|||
}
|
||||
|
||||
#define CASE_IMPLEMENT_UNIFORM(_uniform, _glsuffix, _dxsuffix, _type) \
|
||||
case ConstantType::_uniform: \
|
||||
case UniformType::_uniform: \
|
||||
{ \
|
||||
_type* value = (_type*)data; \
|
||||
GL_CHECK(glUniform##_glsuffix(loc, num, value) ); \
|
||||
|
@ -1673,7 +1672,7 @@ namespace bgfx
|
|||
break;
|
||||
|
||||
#define CASE_IMPLEMENT_UNIFORM_T(_uniform, _glsuffix, _dxsuffix, _type) \
|
||||
case ConstantType::_uniform: \
|
||||
case UniformType::_uniform: \
|
||||
{ \
|
||||
_type* value = (_type*)data; \
|
||||
GL_CHECK(glUniform##_glsuffix(loc, num, GL_FALSE, value) ); \
|
||||
|
@ -1700,7 +1699,7 @@ namespace bgfx
|
|||
CASE_IMPLEMENT_UNIFORM_T(Uniform3x3fv, Matrix3fv, F, float);
|
||||
CASE_IMPLEMENT_UNIFORM_T(Uniform4x4fv, Matrix4fv, F, float);
|
||||
|
||||
case ConstantType::End:
|
||||
case UniformType::End:
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -2004,13 +2003,13 @@ namespace bgfx
|
|||
s_renderCtx.m_renderTargets[_handle.idx].destroy();
|
||||
}
|
||||
|
||||
void Context::rendererCreateUniform(UniformHandle _handle, ConstantType::Enum _type, uint16_t _num, const char* _name)
|
||||
void Context::rendererCreateUniform(UniformHandle _handle, UniformType::Enum _type, uint16_t _num, const char* _name)
|
||||
{
|
||||
uint32_t size = g_constantTypeSize[_type]*_num;
|
||||
uint32_t size = g_uniformTypeSize[_type]*_num;
|
||||
void* data = g_realloc(NULL, size);
|
||||
memset(data, 0, size);
|
||||
s_renderCtx.m_uniforms[_handle.idx] = data;
|
||||
s_renderCtx.m_uniformReg.reg(_name, s_renderCtx.m_uniforms[_handle.idx]);
|
||||
s_renderCtx.m_uniformReg.add(_name, s_renderCtx.m_uniforms[_handle.idx]);
|
||||
}
|
||||
|
||||
void Context::rendererDestroyUniform(UniformHandle _handle)
|
||||
|
|
|
@ -140,7 +140,7 @@ namespace bgfx
|
|||
{
|
||||
}
|
||||
|
||||
void Context::rendererCreateUniform(UniformHandle /*_handle*/, ConstantType::Enum /*_type*/, uint16_t /*_num*/, const char* /*_name*/)
|
||||
void Context::rendererCreateUniform(UniformHandle /*_handle*/, UniformType::Enum /*_type*/, uint16_t /*_num*/, const char* /*_name*/)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,6 @@ vec3 v_normal : TEXCOORD1 = vec3(0.0, 1.0, 0.0);
|
|||
|
||||
vec3 a_position : POSITION;
|
||||
vec3 a_normal : NORMAL0;
|
||||
vec4 a_color : COLOR0;
|
||||
vec4 a_color0 : COLOR0;
|
||||
vec4 a_color1 : COLOR1;
|
||||
vec2 a_texcoord0 : TEXCOORD0;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
$input a_position, a_color
|
||||
$input a_position, a_color0
|
||||
$output v_color0
|
||||
|
||||
/*
|
||||
|
@ -11,5 +11,5 @@ $output v_color0
|
|||
void main()
|
||||
{
|
||||
gl_Position = vec4(a_position, 1.0);
|
||||
v_color0 = a_color;
|
||||
v_color0 = a_color0;
|
||||
}
|
||||
|
|
|
@ -1,44 +1,44 @@
|
|||
static const uint8_t vs_clear_dx11[649] =
|
||||
static const uint8_t vs_clear_dx11[650] =
|
||||
{
|
||||
0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x00, 0x74, 0x02, 0x44, 0x58, 0x42, 0x43, 0x9f, 0x90, 0x55, 0x9a, 0x15, 0xd7, 0x4d, 0x46, // ..t.DXBC..U...MF
|
||||
0x12, 0x19, 0x32, 0x30, 0xa7, 0xfd, 0x7a, 0x83, 0x01, 0x00, 0x00, 0x00, 0x74, 0x02, 0x00, 0x00, // ..20..z.....t...
|
||||
0x05, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, // ....4...........
|
||||
0x50, 0x01, 0x00, 0x00, 0xd8, 0x01, 0x00, 0x00, 0x52, 0x44, 0x45, 0x46, 0x70, 0x00, 0x00, 0x00, // P.......RDEFp...
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, // ............<...
|
||||
0x00, 0x05, 0xfe, 0xff, 0x00, 0x91, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x52, 0x44, 0x31, 0x31, // ........<...RD11
|
||||
0x3c, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, // <....... ...(...
|
||||
0x24, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4d, 0x69, 0x63, 0x72, // $...........Micr
|
||||
0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, // osoft (R) HLSL S
|
||||
0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, // hader Compiler 9
|
||||
0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0xab, 0xab, 0xab, // .29.952.3111....
|
||||
0x49, 0x53, 0x47, 0x4e, 0x48, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, // ISGNH...........
|
||||
0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // 8...............
|
||||
0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........A.......
|
||||
0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, // ................
|
||||
0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0xab, // POSITION.COLOR..
|
||||
0x4f, 0x53, 0x47, 0x4e, 0x4c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, // OSGNL...........
|
||||
0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, // 8...............
|
||||
0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........D.......
|
||||
0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, // ................
|
||||
0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, // SV_POSITION.COLO
|
||||
0x52, 0x00, 0xab, 0xab, 0x53, 0x48, 0x45, 0x58, 0x80, 0x00, 0x00, 0x00, 0x50, 0x00, 0x01, 0x00, // R...SHEX....P...
|
||||
0x20, 0x00, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, 0x5f, 0x00, 0x00, 0x03, 0x72, 0x10, 0x10, 0x00, // ...j..._...r...
|
||||
0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ...._...........
|
||||
0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // g.... ..........
|
||||
0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, // e.... ......6...
|
||||
0x72, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, // r ......F.......
|
||||
0x36, 0x00, 0x00, 0x05, 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, // 6.... .......@..
|
||||
0x00, 0x00, 0x80, 0x3f, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, // ...?6.... ......
|
||||
0x46, 0x1e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x53, 0x54, 0x41, 0x54, // F.......>...STAT
|
||||
0x94, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x00, 0x00, 0x74, 0x02, 0x44, 0x58, 0x42, 0x43, 0x9f, 0x90, 0x55, 0x9a, 0x15, 0xd7, 0x4d, // ...t.DXBC..U...M
|
||||
0x46, 0x12, 0x19, 0x32, 0x30, 0xa7, 0xfd, 0x7a, 0x83, 0x01, 0x00, 0x00, 0x00, 0x74, 0x02, 0x00, // F..20..z.....t..
|
||||
0x00, 0x05, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, // .....4..........
|
||||
0x00, 0x50, 0x01, 0x00, 0x00, 0xd8, 0x01, 0x00, 0x00, 0x52, 0x44, 0x45, 0x46, 0x70, 0x00, 0x00, // .P.......RDEFp..
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, // .............<..
|
||||
0x00, 0x00, 0x05, 0xfe, 0xff, 0x00, 0x91, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x52, 0x44, 0x31, // .........<...RD1
|
||||
0x31, 0x3c, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, // 1<....... ...(..
|
||||
0x00, 0x24, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4d, 0x69, 0x63, // .$...........Mic
|
||||
0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, // rosoft (R) HLSL
|
||||
0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, // Shader Compiler
|
||||
0x39, 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0xab, 0xab, // 9.29.952.3111...
|
||||
0xab, 0x49, 0x53, 0x47, 0x4e, 0x48, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // .ISGNH..........
|
||||
0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // .8..............
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .........A......
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, // ................
|
||||
0x00, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, // .POSITION.COLOR.
|
||||
0xab, 0x4f, 0x53, 0x47, 0x4e, 0x4c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, // .OSGNL..........
|
||||
0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, // .8..............
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .........D......
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, // ................
|
||||
0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, // .SV_POSITION.COL
|
||||
0x4f, 0x52, 0x00, 0xab, 0xab, 0x53, 0x48, 0x45, 0x58, 0x80, 0x00, 0x00, 0x00, 0x50, 0x00, 0x01, // OR...SHEX....P..
|
||||
0x00, 0x20, 0x00, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, 0x5f, 0x00, 0x00, 0x03, 0x72, 0x10, 0x10, // . ...j..._...r..
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, // ....._..........
|
||||
0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, // .g.... .........
|
||||
0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, // .e.... ......6..
|
||||
0x05, 0x72, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x00, 0x00, 0x00, // .r ......F......
|
||||
0x00, 0x36, 0x00, 0x00, 0x05, 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, // .6.... .......@.
|
||||
0x00, 0x00, 0x00, 0x80, 0x3f, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, // ....?6.... .....
|
||||
0x00, 0x46, 0x1e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x53, 0x54, 0x41, // .F.......>...STA
|
||||
0x54, 0x94, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // T...............
|
||||
0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // .........
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ..........
|
||||
};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
$input a_position, a_color, a_color1, a_texcoord0
|
||||
$input a_position, a_color0, a_color1, a_texcoord0
|
||||
$output v_color0, v_color1, v_texcoord0
|
||||
|
||||
/*
|
||||
|
@ -12,6 +12,6 @@ void main()
|
|||
{
|
||||
gl_Position = mul(u_modelViewProj, vec4(a_position, 1.0) );
|
||||
v_texcoord0 = a_texcoord0;
|
||||
v_color0 = a_color;
|
||||
v_color0 = a_color0;
|
||||
v_color1 = a_color1;
|
||||
}
|
||||
|
|
|
@ -1,96 +1,96 @@
|
|||
static const uint8_t vs_debugfont_dx11[1475] =
|
||||
static const uint8_t vs_debugfont_dx11[1476] =
|
||||
{
|
||||
0xff, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // ................
|
||||
0xc0, 0x01, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, // ...u_modelViewPr
|
||||
0x6f, 0x6a, 0x09, 0x00, 0x00, 0x01, 0x40, 0x00, 0x98, 0x05, 0x44, 0x58, 0x42, 0x43, 0x46, 0xbf, // oj....@...DXBCF.
|
||||
0xfc, 0xa7, 0xce, 0x2a, 0xea, 0x90, 0xbc, 0x31, 0x32, 0x0a, 0x66, 0x1f, 0xa2, 0x34, 0x01, 0x00, // ...*...12.f..4..
|
||||
0x00, 0x00, 0x98, 0x05, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x88, 0x02, // ..........4.....
|
||||
0x00, 0x00, 0x10, 0x03, 0x00, 0x00, 0x9c, 0x03, 0x00, 0x00, 0xfc, 0x04, 0x00, 0x00, 0x52, 0x44, // ..............RD
|
||||
0x45, 0x46, 0x4c, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x01, 0x00, // EFL.......h.....
|
||||
0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x05, 0xfe, 0xff, 0x00, 0x91, 0x00, 0x00, 0x18, 0x02, // ..<.............
|
||||
0x00, 0x00, 0x52, 0x44, 0x31, 0x31, 0x3c, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x20, 0x00, // ..RD11<....... .
|
||||
0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, // ..(...$.........
|
||||
0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x00, 0x24, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x73, 0x00, 0xab, 0xab, 0xab, 0x5c, 0x00, // ..$Globals......
|
||||
0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x98, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, // ..............@.
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, // ................
|
||||
0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x01, // ................
|
||||
0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0x01, // ..@...@.........
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, // ................
|
||||
0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xd7, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x40, 0x00, // ..............@.
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, // ................
|
||||
0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xdf, 0x01, // ................
|
||||
0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0x01, // ......@.........
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, // ................
|
||||
0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xeb, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x40, 0x00, // ..............@.
|
||||
0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xa8, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, // ................
|
||||
0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x01, // ................
|
||||
0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0x01, // ..@...@.........
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, // ................
|
||||
0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x02, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x40, 0x00, // ..............@.
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, // ................
|
||||
0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, // ..............u_
|
||||
0x76, 0x69, 0x65, 0x77, 0x00, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x78, 0x34, 0x00, 0x03, 0x00, // view.float4x4...
|
||||
0x03, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9f, 0x01, // ................
|
||||
0x00, 0x00, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x00, 0x75, 0x5f, 0x6d, // ..u_viewProj.u_m
|
||||
0x6f, 0x64, 0x65, 0x6c, 0x00, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, // odel.u_modelView
|
||||
0x00, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, // .u_modelViewProj
|
||||
0x00, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, // .u_modelViewProj
|
||||
0x58, 0x00, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x58, 0x00, 0x4d, 0x69, // X.u_viewProjX.Mi
|
||||
0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, // crosoft (R) HLSL
|
||||
0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, // Shader Compiler
|
||||
0x20, 0x39, 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0xab, // 9.29.952.3111..
|
||||
0xab, 0xab, 0x49, 0x53, 0x47, 0x4e, 0x80, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, // ..ISGN..........
|
||||
0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, // ..h.............
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, 0x71, 0x00, 0x00, 0x00, 0x00, 0x00, // ..........q.....
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x0f, // ................
|
||||
0x00, 0x00, 0x71, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, // ..q.............
|
||||
0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, // ..........w.....
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x03, // ................
|
||||
0x00, 0x00, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, // ..POSITION.COLOR
|
||||
0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0x4f, 0x53, 0x47, 0x4e, 0x84, 0x00, // .TEXCOORD.OSGN..
|
||||
0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, // ..........h.....
|
||||
0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, // ................
|
||||
0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, // ..t.............
|
||||
0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x01, 0x00, // ..........t.....
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0f, 0x00, // ................
|
||||
0x00, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, // ..z.............
|
||||
0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x0c, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, // ..........SV_POS
|
||||
0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, // ITION.COLOR.TEXC
|
||||
0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x53, 0x48, 0x45, 0x58, 0x58, 0x01, 0x00, 0x00, 0x50, 0x00, // OORD..SHEXX...P.
|
||||
0x01, 0x00, 0x56, 0x00, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, // ..V...j...Y...F.
|
||||
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x72, 0x10, // ........._...r.
|
||||
0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, // ......_.........
|
||||
0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x5f, 0x00, // .._..........._.
|
||||
0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, // ..2.......g....
|
||||
0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, // ..........e....
|
||||
0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x02, 0x00, // ......e.... ....
|
||||
0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0x32, 0x20, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x68, 0x00, // ..e...2 ......h.
|
||||
0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, // ......8.........
|
||||
0x00, 0x00, 0x56, 0x15, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, // ..V.......F. ...
|
||||
0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, // ......2.........
|
||||
0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x06, 0x10, // ..F. ...........
|
||||
0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, // ......F.......2.
|
||||
0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, // ..........F. ...
|
||||
0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0xa6, 0x1a, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, // ..............F.
|
||||
0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, // ........... ....
|
||||
0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, // ..F.......F. ...
|
||||
0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, // ......6.... ....
|
||||
0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, // ..F.......6....
|
||||
0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x36, 0x00, // ......F.......6.
|
||||
0x00, 0x05, 0x32, 0x20, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x03, 0x00, // ..2 ......F.....
|
||||
0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x53, 0x54, 0x41, 0x54, 0x94, 0x00, 0x00, 0x00, 0x08, 0x00, // ..>...STAT......
|
||||
0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x02, 0x00, // ................
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // ................
|
||||
0x00, 0xc0, 0x01, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, // ....u_modelViewP
|
||||
0x72, 0x6f, 0x6a, 0x09, 0x00, 0x00, 0x01, 0x04, 0x00, 0x98, 0x05, 0x44, 0x58, 0x42, 0x43, 0x46, // roj........DXBCF
|
||||
0xbf, 0xfc, 0xa7, 0xce, 0x2a, 0xea, 0x90, 0xbc, 0x31, 0x32, 0x0a, 0x66, 0x1f, 0xa2, 0x34, 0x01, // ....*...12.f..4.
|
||||
0x00, 0x00, 0x00, 0x98, 0x05, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x88, // ...........4....
|
||||
0x02, 0x00, 0x00, 0x10, 0x03, 0x00, 0x00, 0x9c, 0x03, 0x00, 0x00, 0xfc, 0x04, 0x00, 0x00, 0x52, // ...............R
|
||||
0x44, 0x45, 0x46, 0x4c, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x01, // DEFL.......h....
|
||||
0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x05, 0xfe, 0xff, 0x00, 0x91, 0x00, 0x00, 0x18, // ...<............
|
||||
0x02, 0x00, 0x00, 0x52, 0x44, 0x31, 0x31, 0x3c, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x20, // ...RD11<.......
|
||||
0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, // ...(...$........
|
||||
0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x00, 0x00, 0x24, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x73, 0x00, 0xab, 0xab, 0xab, 0x5c, // ...$Globals.....
|
||||
0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x98, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, // ...............@
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, // ................
|
||||
0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xcc, // ................
|
||||
0x01, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, // ...@...@........
|
||||
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, // ................
|
||||
0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xd7, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x40, // ...............@
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, // ................
|
||||
0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xdf, // ................
|
||||
0x01, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, // .......@........
|
||||
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, // ................
|
||||
0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xeb, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x40, // ...............@
|
||||
0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xa8, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, // ................
|
||||
0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xfb, // ................
|
||||
0x01, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, // ...@...@........
|
||||
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, // ................
|
||||
0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x02, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x40, // ...............@
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, // ................
|
||||
0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x75, // ...............u
|
||||
0x5f, 0x76, 0x69, 0x65, 0x77, 0x00, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x78, 0x34, 0x00, 0x03, // _view.float4x4..
|
||||
0x00, 0x03, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9f, // ................
|
||||
0x01, 0x00, 0x00, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x00, 0x75, 0x5f, // ...u_viewProj.u_
|
||||
0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x00, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, // model.u_modelVie
|
||||
0x77, 0x00, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, // w.u_modelViewPro
|
||||
0x6a, 0x00, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, // j.u_modelViewPro
|
||||
0x6a, 0x58, 0x00, 0x75, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x58, 0x00, 0x4d, // jX.u_viewProjX.M
|
||||
0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, // icrosoft (R) HLS
|
||||
0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, // L Shader Compile
|
||||
0x72, 0x20, 0x39, 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, // r 9.29.952.3111.
|
||||
0xab, 0xab, 0xab, 0x49, 0x53, 0x47, 0x4e, 0x80, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, // ...ISGN.........
|
||||
0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // ...h............
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, 0x71, 0x00, 0x00, 0x00, 0x00, // ...........q....
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, // ................
|
||||
0x0f, 0x00, 0x00, 0x71, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // ...q............
|
||||
0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x00, // ...........w....
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, // ................
|
||||
0x03, 0x00, 0x00, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, // ...POSITION.COLO
|
||||
0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0x4f, 0x53, 0x47, 0x4e, 0x84, // R.TEXCOORD.OSGN.
|
||||
0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x00, // ...........h....
|
||||
0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, // ................
|
||||
0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // ...t............
|
||||
0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x01, // ...........t....
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0f, // ................
|
||||
0x00, 0x00, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, // ...z............
|
||||
0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x0c, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, // ...........SV_PO
|
||||
0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0x54, 0x45, 0x58, // SITION.COLOR.TEX
|
||||
0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x53, 0x48, 0x45, 0x58, 0x58, 0x01, 0x00, 0x00, 0x50, // COORD..SHEXX...P
|
||||
0x00, 0x01, 0x00, 0x56, 0x00, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01, 0x59, 0x00, 0x00, 0x04, 0x46, // ...V...j...Y...F
|
||||
0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x72, // . ........._...r
|
||||
0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x01, // ......._........
|
||||
0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x5f, // ..._..........._
|
||||
0x00, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, // ...2.......g....
|
||||
0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, // ..........e....
|
||||
0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x02, // ......e.... ...
|
||||
0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0x32, 0x20, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x68, // ...e...2 ......h
|
||||
0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x00, // .......8........
|
||||
0x00, 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, // ...V.......F. ..
|
||||
0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, // .......2........
|
||||
0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x06, // ...F. ..........
|
||||
0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, // .......F.......2
|
||||
0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, // ...........F. ..
|
||||
0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0xa6, 0x1a, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, // ...............F
|
||||
0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xf2, 0x20, 0x10, 0x00, 0x00, // ............ ...
|
||||
0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, // ...F.......F. ..
|
||||
0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00, 0x01, // .......6.... ...
|
||||
0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0xf2, // ...F.......6....
|
||||
0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x36, // ......F.......6
|
||||
0x00, 0x00, 0x05, 0x32, 0x20, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x03, // ...2 ......F....
|
||||
0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x53, 0x54, 0x41, 0x54, 0x94, 0x00, 0x00, 0x00, 0x08, // ...>...STAT.....
|
||||
0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x02, // ................
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ................
|
||||
0x00, 0x00, 0x00, // ...
|
||||
0x00, 0x00, 0x00, 0x00, // ....
|
||||
};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
static const uint8_t vs_debugfont_glsl[464] =
|
||||
static const uint8_t vs_debugfont_glsl[466] =
|
||||
{
|
||||
0x23, 0x69, 0x66, 0x64, 0x65, 0x66, 0x20, 0x47, 0x4c, 0x5f, 0x45, 0x53, 0x0a, 0x70, 0x72, 0x65, // #ifdef GL_ES.pre
|
||||
0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x66, 0x6c, 0x6f, // cision highp flo
|
||||
|
@ -14,19 +14,20 @@ static const uint8_t vs_debugfont_glsl[464] =
|
|||
0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, // oord0;.attribute
|
||||
0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x31, 0x3b, 0x0a, // vec4 a_color1;.
|
||||
0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x61, // attribute vec4 a
|
||||
0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, // _color;.attribut
|
||||
0x65, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, // e vec3 a_positio
|
||||
0x6e, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, // n;.void main ().
|
||||
0x7b, 0x0a, 0x20, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // {. vec4 tmpvar_
|
||||
0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x77, 0x20, // 1;. tmpvar_1.w
|
||||
0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // = 1.0;. tmpvar_
|
||||
0x31, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, // 1.xyz = a_positi
|
||||
0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, // on;. gl_Positio
|
||||
0x6e, 0x20, 0x3d, 0x20, 0x28, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, // n = (u_modelView
|
||||
0x50, 0x72, 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x29, // Proj * tmpvar_1)
|
||||
0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x20, // ;. v_texcoord0
|
||||
0x3d, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, 0x20, // = a_texcoord0;.
|
||||
0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x63, 0x6f, // v_color0 = a_co
|
||||
0x6c, 0x6f, 0x72, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x31, 0x20, // lor;. v_color1
|
||||
0x3d, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x31, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // = a_color1;.}...
|
||||
0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, // _color0;.attribu
|
||||
0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, // te vec3 a_positi
|
||||
0x6f, 0x6e, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, // on;.void main ()
|
||||
0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // .{. vec4 tmpvar
|
||||
0x5f, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x77, // _1;. tmpvar_1.w
|
||||
0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // = 1.0;. tmpvar
|
||||
0x5f, 0x31, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, // _1.xyz = a_posit
|
||||
0x69, 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, // ion;. gl_Positi
|
||||
0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x28, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, // on = (u_modelVie
|
||||
0x77, 0x50, 0x72, 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // wProj * tmpvar_1
|
||||
0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, // );. v_texcoord0
|
||||
0x20, 0x3d, 0x20, 0x61, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x30, 0x3b, 0x0a, // = a_texcoord0;.
|
||||
0x20, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x63, // v_color0 = a_c
|
||||
0x6f, 0x6c, 0x6f, 0x72, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, // olor0;. v_color
|
||||
0x31, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x31, 0x3b, 0x0a, 0x7d, 0x0a, // 1 = a_color1;.}.
|
||||
0x0a, 0x00, // ..
|
||||
};
|
||||
|
|
Binary file not shown.
3693
tools/shaderc.cpp
3693
tools/shaderc.cpp
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue