summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/examples/09-hdr
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/bgfx/examples/09-hdr')
-rw-r--r--3rdparty/bgfx/examples/09-hdr/common.sh4
-rw-r--r--3rdparty/bgfx/examples/09-hdr/fs_hdr_blur.sc4
-rw-r--r--3rdparty/bgfx/examples/09-hdr/fs_hdr_bright.sc8
-rw-r--r--3rdparty/bgfx/examples/09-hdr/fs_hdr_lum.sc4
-rw-r--r--3rdparty/bgfx/examples/09-hdr/fs_hdr_lumavg.sc4
-rw-r--r--3rdparty/bgfx/examples/09-hdr/fs_hdr_mesh.sc4
-rw-r--r--3rdparty/bgfx/examples/09-hdr/fs_hdr_skybox.sc4
-rw-r--r--3rdparty/bgfx/examples/09-hdr/fs_hdr_tonemap.sc6
-rw-r--r--3rdparty/bgfx/examples/09-hdr/hdr.cpp38
-rw-r--r--3rdparty/bgfx/examples/09-hdr/makefile4
-rw-r--r--3rdparty/bgfx/examples/09-hdr/vs_hdr_blur.sc4
-rw-r--r--3rdparty/bgfx/examples/09-hdr/vs_hdr_bright.sc4
-rw-r--r--3rdparty/bgfx/examples/09-hdr/vs_hdr_lum.sc4
-rw-r--r--3rdparty/bgfx/examples/09-hdr/vs_hdr_lumavg.sc4
-rw-r--r--3rdparty/bgfx/examples/09-hdr/vs_hdr_mesh.sc4
-rw-r--r--3rdparty/bgfx/examples/09-hdr/vs_hdr_skybox.sc4
-rw-r--r--3rdparty/bgfx/examples/09-hdr/vs_hdr_tonemap.sc4
17 files changed, 58 insertions, 50 deletions
diff --git a/3rdparty/bgfx/examples/09-hdr/common.sh b/3rdparty/bgfx/examples/09-hdr/common.sh
index c2fb179dbf3..056d9d60830 100644
--- a/3rdparty/bgfx/examples/09-hdr/common.sh
+++ b/3rdparty/bgfx/examples/09-hdr/common.sh
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2018 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/09-hdr/fs_hdr_blur.sc b/3rdparty/bgfx/examples/09-hdr/fs_hdr_blur.sc
index e4ceb061faa..d6130d77da7 100644
--- a/3rdparty/bgfx/examples/09-hdr/fs_hdr_blur.sc
+++ b/3rdparty/bgfx/examples/09-hdr/fs_hdr_blur.sc
@@ -1,8 +1,8 @@
$input v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4
/*
- * Copyright 2011-2018 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.sh"
diff --git a/3rdparty/bgfx/examples/09-hdr/fs_hdr_bright.sc b/3rdparty/bgfx/examples/09-hdr/fs_hdr_bright.sc
index 3c969b30c1c..321fac73aef 100644
--- a/3rdparty/bgfx/examples/09-hdr/fs_hdr_bright.sc
+++ b/3rdparty/bgfx/examples/09-hdr/fs_hdr_bright.sc
@@ -1,8 +1,8 @@
$input v_texcoord0
/*
- * Copyright 2011-2018 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.sh"
@@ -29,10 +29,10 @@ void main()
float middleGray = u_tonemap.x;
float whiteSqr = u_tonemap.y;
- float treshold = u_tonemap.z;
+ float threshold = u_tonemap.z;
float offset = u_tonemap.w;
- rgb = max(vec3_splat(0.0), rgb - treshold) * middleGray / (lum + 0.0001);
+ rgb = max(vec3_splat(0.0), rgb - threshold) * middleGray / (lum + 0.0001);
rgb = reinhard2(rgb, whiteSqr);
gl_FragColor = toGamma(vec4(rgb, 1.0) );
diff --git a/3rdparty/bgfx/examples/09-hdr/fs_hdr_lum.sc b/3rdparty/bgfx/examples/09-hdr/fs_hdr_lum.sc
index 488a04b0104..392ab748316 100644
--- a/3rdparty/bgfx/examples/09-hdr/fs_hdr_lum.sc
+++ b/3rdparty/bgfx/examples/09-hdr/fs_hdr_lum.sc
@@ -1,8 +1,8 @@
$input v_texcoord0
/*
- * Copyright 2011-2018 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.sh"
diff --git a/3rdparty/bgfx/examples/09-hdr/fs_hdr_lumavg.sc b/3rdparty/bgfx/examples/09-hdr/fs_hdr_lumavg.sc
index eb35f1f3caa..4c682a98c4b 100644
--- a/3rdparty/bgfx/examples/09-hdr/fs_hdr_lumavg.sc
+++ b/3rdparty/bgfx/examples/09-hdr/fs_hdr_lumavg.sc
@@ -1,8 +1,8 @@
$input v_texcoord0
/*
- * Copyright 2011-2018 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.sh"
diff --git a/3rdparty/bgfx/examples/09-hdr/fs_hdr_mesh.sc b/3rdparty/bgfx/examples/09-hdr/fs_hdr_mesh.sc
index 1e64fd1ff9d..760a0928d15 100644
--- a/3rdparty/bgfx/examples/09-hdr/fs_hdr_mesh.sc
+++ b/3rdparty/bgfx/examples/09-hdr/fs_hdr_mesh.sc
@@ -1,8 +1,8 @@
$input v_pos, v_view, v_normal
/*
- * Copyright 2011-2018 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.sh"
diff --git a/3rdparty/bgfx/examples/09-hdr/fs_hdr_skybox.sc b/3rdparty/bgfx/examples/09-hdr/fs_hdr_skybox.sc
index 63e6d58e5d1..c2880f57c74 100644
--- a/3rdparty/bgfx/examples/09-hdr/fs_hdr_skybox.sc
+++ b/3rdparty/bgfx/examples/09-hdr/fs_hdr_skybox.sc
@@ -1,8 +1,8 @@
$input v_texcoord0
/*
- * Copyright 2011-2018 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.sh"
diff --git a/3rdparty/bgfx/examples/09-hdr/fs_hdr_tonemap.sc b/3rdparty/bgfx/examples/09-hdr/fs_hdr_tonemap.sc
index e17ebfedfa6..44f3df9b429 100644
--- a/3rdparty/bgfx/examples/09-hdr/fs_hdr_tonemap.sc
+++ b/3rdparty/bgfx/examples/09-hdr/fs_hdr_tonemap.sc
@@ -1,8 +1,8 @@
$input v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4
/*
- * Copyright 2011-2018 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.sh"
@@ -20,7 +20,7 @@ void main()
float middleGray = u_tonemap.x;
float whiteSqr = u_tonemap.y;
- float treshold = u_tonemap.z;
+ float threshold = u_tonemap.z;
float offset = u_tonemap.w;
float lp = Yxy.x * middleGray / (lum + 0.0001);
diff --git a/3rdparty/bgfx/examples/09-hdr/hdr.cpp b/3rdparty/bgfx/examples/09-hdr/hdr.cpp
index fb3a266dacb..e76fbd61259 100644
--- a/3rdparty/bgfx/examples/09-hdr/hdr.cpp
+++ b/3rdparty/bgfx/examples/09-hdr/hdr.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2018 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.h"
@@ -24,7 +24,7 @@ struct PosColorTexCoord0Vertex
static void init()
{
- ms_decl
+ ms_layout
.begin()
.add(bgfx::Attrib::Position, 3, bgfx::AttribType::Float)
.add(bgfx::Attrib::Color0, 4, bgfx::AttribType::Uint8, true)
@@ -32,17 +32,17 @@ struct PosColorTexCoord0Vertex
.end();
}
- static bgfx::VertexDecl ms_decl;
+ static bgfx::VertexLayout ms_layout;
};
-bgfx::VertexDecl PosColorTexCoord0Vertex::ms_decl;
+bgfx::VertexLayout PosColorTexCoord0Vertex::ms_layout;
void screenSpaceQuad(float _textureWidth, float _textureHeight, bool _originBottomLeft = false, float _width = 1.0f, float _height = 1.0f)
{
- if (3 == bgfx::getAvailTransientVertexBuffer(3, PosColorTexCoord0Vertex::ms_decl) )
+ if (3 == bgfx::getAvailTransientVertexBuffer(3, PosColorTexCoord0Vertex::ms_layout) )
{
bgfx::TransientVertexBuffer vb;
- bgfx::allocTransientVertexBuffer(&vb, 3, PosColorTexCoord0Vertex::ms_decl);
+ bgfx::allocTransientVertexBuffer(&vb, 3, PosColorTexCoord0Vertex::ms_layout);
PosColorTexCoord0Vertex* vertex = (PosColorTexCoord0Vertex*)vb.data;
const float zz = 0.0f;
@@ -140,8 +140,8 @@ void setOffsets4x4Lum(bgfx::UniformHandle _handle, uint32_t _width, uint32_t _he
class ExampleHDR : public entry::AppI
{
public:
- ExampleHDR(const char* _name, const char* _description)
- : entry::AppI(_name, _description)
+ ExampleHDR(const char* _name, const char* _description, const char* _url)
+ : entry::AppI(_name, _description, _url)
{
}
@@ -157,6 +157,9 @@ public:
bgfx::Init init;
init.type = args.m_type;
init.vendorId = args.m_pciId;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
+ init.platformData.type = entry::getNativeWindowHandleType(entry::kDefaultWindowHandle);
init.resolution.width = m_width;
init.resolution.height = m_height;
init.resolution.reset = m_reset;
@@ -183,10 +186,10 @@ public:
m_meshProgram = loadProgram("vs_hdr_mesh", "fs_hdr_mesh");
m_tonemapProgram = loadProgram("vs_hdr_tonemap", "fs_hdr_tonemap");
- s_texCube = bgfx::createUniform("s_texCube", bgfx::UniformType::Int1);
- s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Int1);
- s_texLum = bgfx::createUniform("s_texLum", bgfx::UniformType::Int1);
- s_texBlur = bgfx::createUniform("s_texBlur", bgfx::UniformType::Int1);
+ s_texCube = bgfx::createUniform("s_texCube", bgfx::UniformType::Sampler);
+ s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Sampler);
+ s_texLum = bgfx::createUniform("s_texLum", bgfx::UniformType::Sampler);
+ s_texBlur = bgfx::createUniform("s_texBlur", bgfx::UniformType::Sampler);
u_mtx = bgfx::createUniform("u_mtx", bgfx::UniformType::Mat4);
u_tonemap = bgfx::createUniform("u_tonemap", bgfx::UniformType::Vec4);
u_offset = bgfx::createUniform("u_offset", bgfx::UniformType::Vec4, 16);
@@ -207,7 +210,7 @@ public:
m_lumBgra8 = 0;
if ( (BGFX_CAPS_TEXTURE_BLIT|BGFX_CAPS_TEXTURE_READ_BACK) == (bgfx::getCaps()->supported & (BGFX_CAPS_TEXTURE_BLIT|BGFX_CAPS_TEXTURE_READ_BACK) ) )
{
- m_rb = bgfx::createTexture2D(1, 1, false, 1, bgfx::TextureFormat::BGRA8, BGFX_TEXTURE_READ_BACK);
+ m_rb = bgfx::createTexture2D(1, 1, false, 1, bgfx::TextureFormat::BGRA8, BGFX_TEXTURE_BLIT_DST|BGFX_TEXTURE_READ_BACK);
}
else
{
@@ -629,4 +632,9 @@ public:
} // namespace
-ENTRY_IMPLEMENT_MAIN(ExampleHDR, "09-hdr", "Using multiple views with frame buffers, and view order remapping.");
+ENTRY_IMPLEMENT_MAIN(
+ ExampleHDR
+ , "09-hdr"
+ , "Using multiple views with frame buffers, and view order remapping."
+ , "https://bkaradzic.github.io/bgfx/examples.html#hdr"
+ );
diff --git a/3rdparty/bgfx/examples/09-hdr/makefile b/3rdparty/bgfx/examples/09-hdr/makefile
index 171709170a4..19c81e43692 100644
--- a/3rdparty/bgfx/examples/09-hdr/makefile
+++ b/3rdparty/bgfx/examples/09-hdr/makefile
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2018 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
BGFX_DIR=../..
diff --git a/3rdparty/bgfx/examples/09-hdr/vs_hdr_blur.sc b/3rdparty/bgfx/examples/09-hdr/vs_hdr_blur.sc
index 51b17c14b5b..e4dad0170c4 100644
--- a/3rdparty/bgfx/examples/09-hdr/vs_hdr_blur.sc
+++ b/3rdparty/bgfx/examples/09-hdr/vs_hdr_blur.sc
@@ -2,8 +2,8 @@ $input a_position, a_texcoord0
$output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4
/*
- * Copyright 2011-2018 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/09-hdr/vs_hdr_bright.sc b/3rdparty/bgfx/examples/09-hdr/vs_hdr_bright.sc
index 8c3b7a822b6..545369275d5 100644
--- a/3rdparty/bgfx/examples/09-hdr/vs_hdr_bright.sc
+++ b/3rdparty/bgfx/examples/09-hdr/vs_hdr_bright.sc
@@ -2,8 +2,8 @@ $input a_position, a_texcoord0
$output v_texcoord0
/*
- * Copyright 2011-2018 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/09-hdr/vs_hdr_lum.sc b/3rdparty/bgfx/examples/09-hdr/vs_hdr_lum.sc
index 8c3b7a822b6..545369275d5 100644
--- a/3rdparty/bgfx/examples/09-hdr/vs_hdr_lum.sc
+++ b/3rdparty/bgfx/examples/09-hdr/vs_hdr_lum.sc
@@ -2,8 +2,8 @@ $input a_position, a_texcoord0
$output v_texcoord0
/*
- * Copyright 2011-2018 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/09-hdr/vs_hdr_lumavg.sc b/3rdparty/bgfx/examples/09-hdr/vs_hdr_lumavg.sc
index 8c3b7a822b6..545369275d5 100644
--- a/3rdparty/bgfx/examples/09-hdr/vs_hdr_lumavg.sc
+++ b/3rdparty/bgfx/examples/09-hdr/vs_hdr_lumavg.sc
@@ -2,8 +2,8 @@ $input a_position, a_texcoord0
$output v_texcoord0
/*
- * Copyright 2011-2018 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/09-hdr/vs_hdr_mesh.sc b/3rdparty/bgfx/examples/09-hdr/vs_hdr_mesh.sc
index 01648dc32b5..a10d55992c7 100644
--- a/3rdparty/bgfx/examples/09-hdr/vs_hdr_mesh.sc
+++ b/3rdparty/bgfx/examples/09-hdr/vs_hdr_mesh.sc
@@ -2,8 +2,8 @@ $input a_position, a_normal
$output v_pos, v_view, v_normal
/*
- * Copyright 2011-2018 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/09-hdr/vs_hdr_skybox.sc b/3rdparty/bgfx/examples/09-hdr/vs_hdr_skybox.sc
index 8c3b7a822b6..545369275d5 100644
--- a/3rdparty/bgfx/examples/09-hdr/vs_hdr_skybox.sc
+++ b/3rdparty/bgfx/examples/09-hdr/vs_hdr_skybox.sc
@@ -2,8 +2,8 @@ $input a_position, a_texcoord0
$output v_texcoord0
/*
- * Copyright 2011-2018 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/09-hdr/vs_hdr_tonemap.sc b/3rdparty/bgfx/examples/09-hdr/vs_hdr_tonemap.sc
index 13604778439..e7fea0c3e8c 100644
--- a/3rdparty/bgfx/examples/09-hdr/vs_hdr_tonemap.sc
+++ b/3rdparty/bgfx/examples/09-hdr/vs_hdr_tonemap.sc
@@ -2,8 +2,8 @@ $input a_position, a_texcoord0
$output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4
/*
- * Copyright 2011-2018 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"