From 861a63bf2eb09386d804bb397cac0e60c7229265 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Mon, 29 Feb 2016 19:58:17 -0800 Subject: [PATCH] Updated makefiles. --- examples/01-cubes/makefile | 3 ++- examples/02-metaballs/makefile | 15 ++++++++++--- examples/03-raymarch/makefile | 3 ++- examples/04-mesh/makefile | 3 ++- examples/05-instancing/makefile | 3 ++- examples/06-bump/makefile | 3 ++- examples/07-callback/makefile | 3 ++- examples/08-update/makefile | 3 ++- examples/09-hdr/makefile | 3 ++- examples/12-lod/makefile | 3 ++- examples/13-stencil/makefile | 3 ++- examples/14-shadowvolumes/makefile | 16 ++------------ examples/15-shadowmaps-simple/makefile | 3 ++- examples/16-shadowmaps/makefile | 14 ++---------- examples/17-drawstress/makefile | 15 ++++++++++--- examples/18-ibl/makefile | 3 ++- examples/19-oit/makefile | 3 ++- examples/23-vectordisplay/makefile | 3 ++- examples/24-nbody/makefile | 3 ++- examples/27-terrain/makefile | 3 ++- examples/28-wireframe/fs_wf_mesh.sc | 2 +- examples/28-wireframe/makefile | 1 + examples/makefile | 22 ------------------- examples/runtime/shaders/dx11/fs_wf_mesh.bin | Bin 1555 -> 1555 bytes examples/runtime/shaders/dx9/fs_wf_mesh.bin | Bin 996 -> 1020 bytes src/bgfx_shader.sh | 7 ++++++ 26 files changed, 69 insertions(+), 71 deletions(-) diff --git a/examples/01-cubes/makefile b/examples/01-cubes/makefile index 011773e02..e6278cb66 100644 --- a/examples/01-cubes/makefile +++ b/examples/01-cubes/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2015 Branimir Karadzic. All rights reserved. +# Copyright 2011-2016 Branimir Karadzic. All rights reserved. # License: http://www.opensource.org/licenses/BSD-2-Clause # @@ -15,3 +15,4 @@ rebuild: @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 + @make -s --no-print-directory TARGET=5 clean all diff --git a/examples/02-metaballs/makefile b/examples/02-metaballs/makefile index 2d351e1d2..e6278cb66 100644 --- a/examples/02-metaballs/makefile +++ b/examples/02-metaballs/makefile @@ -1,9 +1,18 @@ # -# Copyright 2011-2015 Branimir Karadzic. All rights reserved. +# Copyright 2011-2016 Branimir Karadzic. All rights reserved. # License: http://www.opensource.org/licenses/BSD-2-Clause # -include ../../scripts/shader-embeded.mk +BGFX_DIR=../.. +RUNTIME_DIR=$(BGFX_DIR)/examples/runtime +BUILD_DIR=../../.build + +include $(BGFX_DIR)/scripts/shader.mk rebuild: - @make -s --no-print-directory clean all + @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 + @make -s --no-print-directory TARGET=5 clean all diff --git a/examples/03-raymarch/makefile b/examples/03-raymarch/makefile index 011773e02..e6278cb66 100644 --- a/examples/03-raymarch/makefile +++ b/examples/03-raymarch/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2015 Branimir Karadzic. All rights reserved. +# Copyright 2011-2016 Branimir Karadzic. All rights reserved. # License: http://www.opensource.org/licenses/BSD-2-Clause # @@ -15,3 +15,4 @@ rebuild: @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 + @make -s --no-print-directory TARGET=5 clean all diff --git a/examples/04-mesh/makefile b/examples/04-mesh/makefile index 011773e02..e6278cb66 100644 --- a/examples/04-mesh/makefile +++ b/examples/04-mesh/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2015 Branimir Karadzic. All rights reserved. +# Copyright 2011-2016 Branimir Karadzic. All rights reserved. # License: http://www.opensource.org/licenses/BSD-2-Clause # @@ -15,3 +15,4 @@ rebuild: @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 + @make -s --no-print-directory TARGET=5 clean all diff --git a/examples/05-instancing/makefile b/examples/05-instancing/makefile index 011773e02..e6278cb66 100644 --- a/examples/05-instancing/makefile +++ b/examples/05-instancing/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2015 Branimir Karadzic. All rights reserved. +# Copyright 2011-2016 Branimir Karadzic. All rights reserved. # License: http://www.opensource.org/licenses/BSD-2-Clause # @@ -15,3 +15,4 @@ rebuild: @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 + @make -s --no-print-directory TARGET=5 clean all diff --git a/examples/06-bump/makefile b/examples/06-bump/makefile index 011773e02..e6278cb66 100644 --- a/examples/06-bump/makefile +++ b/examples/06-bump/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2015 Branimir Karadzic. All rights reserved. +# Copyright 2011-2016 Branimir Karadzic. All rights reserved. # License: http://www.opensource.org/licenses/BSD-2-Clause # @@ -15,3 +15,4 @@ rebuild: @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 + @make -s --no-print-directory TARGET=5 clean all diff --git a/examples/07-callback/makefile b/examples/07-callback/makefile index 011773e02..e6278cb66 100644 --- a/examples/07-callback/makefile +++ b/examples/07-callback/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2015 Branimir Karadzic. All rights reserved. +# Copyright 2011-2016 Branimir Karadzic. All rights reserved. # License: http://www.opensource.org/licenses/BSD-2-Clause # @@ -15,3 +15,4 @@ rebuild: @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 + @make -s --no-print-directory TARGET=5 clean all diff --git a/examples/08-update/makefile b/examples/08-update/makefile index 011773e02..e6278cb66 100644 --- a/examples/08-update/makefile +++ b/examples/08-update/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2015 Branimir Karadzic. All rights reserved. +# Copyright 2011-2016 Branimir Karadzic. All rights reserved. # License: http://www.opensource.org/licenses/BSD-2-Clause # @@ -15,3 +15,4 @@ rebuild: @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 + @make -s --no-print-directory TARGET=5 clean all diff --git a/examples/09-hdr/makefile b/examples/09-hdr/makefile index 011773e02..e6278cb66 100644 --- a/examples/09-hdr/makefile +++ b/examples/09-hdr/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2015 Branimir Karadzic. All rights reserved. +# Copyright 2011-2016 Branimir Karadzic. All rights reserved. # License: http://www.opensource.org/licenses/BSD-2-Clause # @@ -15,3 +15,4 @@ rebuild: @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 + @make -s --no-print-directory TARGET=5 clean all diff --git a/examples/12-lod/makefile b/examples/12-lod/makefile index 536534d37..e6278cb66 100644 --- a/examples/12-lod/makefile +++ b/examples/12-lod/makefile @@ -1,5 +1,5 @@ # -# Copyright 2013 Milos Tosic. All rights reserved. +# Copyright 2011-2016 Branimir Karadzic. All rights reserved. # License: http://www.opensource.org/licenses/BSD-2-Clause # @@ -15,3 +15,4 @@ rebuild: @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 + @make -s --no-print-directory TARGET=5 clean all diff --git a/examples/13-stencil/makefile b/examples/13-stencil/makefile index 420d008a7..e6278cb66 100644 --- a/examples/13-stencil/makefile +++ b/examples/13-stencil/makefile @@ -1,5 +1,5 @@ # -# Copyright 2013-2014 Dario Manesku. All rights reserved. +# Copyright 2011-2016 Branimir Karadzic. All rights reserved. # License: http://www.opensource.org/licenses/BSD-2-Clause # @@ -15,3 +15,4 @@ rebuild: @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 + @make -s --no-print-directory TARGET=5 clean all diff --git a/examples/14-shadowvolumes/makefile b/examples/14-shadowvolumes/makefile index f101bb914..e6278cb66 100644 --- a/examples/14-shadowvolumes/makefile +++ b/examples/14-shadowvolumes/makefile @@ -1,5 +1,5 @@ # -# Copyright 2013-2014 Dario Manesku. All rights reserved. +# Copyright 2011-2016 Branimir Karadzic. All rights reserved. # License: http://www.opensource.org/licenses/BSD-2-Clause # @@ -9,22 +9,10 @@ BUILD_DIR=../../.build include $(BGFX_DIR)/scripts/shader.mk -GEOMETRY_SRC= \ - bunny_patched \ - bunny_decimated \ - platform \ - cube - -GEOMETRY_BIN=$(addprefix $(RUNTIME_DIR)/meshes/, $(addsuffix .bin, $(basename $(GEOMETRY_SRC)))) - -geometry: $(GEOMETRY_BIN) - -$(RUNTIME_DIR)/meshes/%.bin : %.obj - $(SILENT) $(GEOMETRYC) -f $(<) -o $(@) --packnormal 1 - 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 + @make -s --no-print-directory TARGET=5 clean all diff --git a/examples/15-shadowmaps-simple/makefile b/examples/15-shadowmaps-simple/makefile index 420d008a7..e6278cb66 100644 --- a/examples/15-shadowmaps-simple/makefile +++ b/examples/15-shadowmaps-simple/makefile @@ -1,5 +1,5 @@ # -# Copyright 2013-2014 Dario Manesku. All rights reserved. +# Copyright 2011-2016 Branimir Karadzic. All rights reserved. # License: http://www.opensource.org/licenses/BSD-2-Clause # @@ -15,3 +15,4 @@ rebuild: @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 + @make -s --no-print-directory TARGET=5 clean all diff --git a/examples/16-shadowmaps/makefile b/examples/16-shadowmaps/makefile index 547cea69a..e6278cb66 100644 --- a/examples/16-shadowmaps/makefile +++ b/examples/16-shadowmaps/makefile @@ -1,5 +1,5 @@ # -# Copyright 2013-2014 Dario Manesku. All rights reserved. +# Copyright 2011-2016 Branimir Karadzic. All rights reserved. # License: http://www.opensource.org/licenses/BSD-2-Clause # @@ -9,20 +9,10 @@ BUILD_DIR=../../.build include $(BGFX_DIR)/scripts/shader.mk -GEOMETRY_SRC= \ - tree \ - hollowcube - -GEOMETRY_BIN=$(addprefix $(RUNTIME_DIR)/meshes/, $(addsuffix .bin, $(basename $(GEOMETRY_SRC)))) - -geometry: $(GEOMETRY_BIN) - -$(RUNTIME_DIR)/meshes/%.bin : %.obj - $(SILENT) $(GEOMETRYC) -f $(<) -o $(@) --packnormal 1 - 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 + @make -s --no-print-directory TARGET=5 clean all diff --git a/examples/17-drawstress/makefile b/examples/17-drawstress/makefile index 2d351e1d2..e6278cb66 100644 --- a/examples/17-drawstress/makefile +++ b/examples/17-drawstress/makefile @@ -1,9 +1,18 @@ # -# Copyright 2011-2015 Branimir Karadzic. All rights reserved. +# Copyright 2011-2016 Branimir Karadzic. All rights reserved. # License: http://www.opensource.org/licenses/BSD-2-Clause # -include ../../scripts/shader-embeded.mk +BGFX_DIR=../.. +RUNTIME_DIR=$(BGFX_DIR)/examples/runtime +BUILD_DIR=../../.build + +include $(BGFX_DIR)/scripts/shader.mk rebuild: - @make -s --no-print-directory clean all + @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 + @make -s --no-print-directory TARGET=5 clean all diff --git a/examples/18-ibl/makefile b/examples/18-ibl/makefile index 65275428b..e6278cb66 100644 --- a/examples/18-ibl/makefile +++ b/examples/18-ibl/makefile @@ -1,5 +1,5 @@ # -# Copyright 2014 Dario Manesku. All rights reserved. +# Copyright 2011-2016 Branimir Karadzic. All rights reserved. # License: http://www.opensource.org/licenses/BSD-2-Clause # @@ -15,3 +15,4 @@ rebuild: @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 + @make -s --no-print-directory TARGET=5 clean all diff --git a/examples/19-oit/makefile b/examples/19-oit/makefile index 011773e02..e6278cb66 100644 --- a/examples/19-oit/makefile +++ b/examples/19-oit/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2015 Branimir Karadzic. All rights reserved. +# Copyright 2011-2016 Branimir Karadzic. All rights reserved. # License: http://www.opensource.org/licenses/BSD-2-Clause # @@ -15,3 +15,4 @@ rebuild: @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 + @make -s --no-print-directory TARGET=5 clean all diff --git a/examples/23-vectordisplay/makefile b/examples/23-vectordisplay/makefile index 011773e02..e6278cb66 100644 --- a/examples/23-vectordisplay/makefile +++ b/examples/23-vectordisplay/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2015 Branimir Karadzic. All rights reserved. +# Copyright 2011-2016 Branimir Karadzic. All rights reserved. # License: http://www.opensource.org/licenses/BSD-2-Clause # @@ -15,3 +15,4 @@ rebuild: @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 + @make -s --no-print-directory TARGET=5 clean all diff --git a/examples/24-nbody/makefile b/examples/24-nbody/makefile index 011773e02..e6278cb66 100644 --- a/examples/24-nbody/makefile +++ b/examples/24-nbody/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2015 Branimir Karadzic. All rights reserved. +# Copyright 2011-2016 Branimir Karadzic. All rights reserved. # License: http://www.opensource.org/licenses/BSD-2-Clause # @@ -15,3 +15,4 @@ rebuild: @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 + @make -s --no-print-directory TARGET=5 clean all diff --git a/examples/27-terrain/makefile b/examples/27-terrain/makefile index 011773e02..e6278cb66 100644 --- a/examples/27-terrain/makefile +++ b/examples/27-terrain/makefile @@ -1,5 +1,5 @@ # -# Copyright 2011-2015 Branimir Karadzic. All rights reserved. +# Copyright 2011-2016 Branimir Karadzic. All rights reserved. # License: http://www.opensource.org/licenses/BSD-2-Clause # @@ -15,3 +15,4 @@ rebuild: @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 + @make -s --no-print-directory TARGET=5 clean all diff --git a/examples/28-wireframe/fs_wf_mesh.sc b/examples/28-wireframe/fs_wf_mesh.sc index 7363d2d9e..4a68b1472 100644 --- a/examples/28-wireframe/fs_wf_mesh.sc +++ b/examples/28-wireframe/fs_wf_mesh.sc @@ -66,7 +66,7 @@ void main() float thickness = u_wfThickness; vec3 fw = abs(dFdx(v_bc)) + abs(dFdy(v_bc)); - vec3 val = smoothstep(vec3_splat(0.0), vec3_splat(fw*thickness), v_bc); + vec3 val = smoothstep(vec3_splat(0.0), fw*thickness, v_bc); float edge = min(min(val.x, val.y), val.z); // Gets to 0.0 when close to edges. vec3 edgeCol = mix(col, wfColor, wfOpacity); diff --git a/examples/28-wireframe/makefile b/examples/28-wireframe/makefile index 4f81fb5bf..e6278cb66 100644 --- a/examples/28-wireframe/makefile +++ b/examples/28-wireframe/makefile @@ -15,3 +15,4 @@ rebuild: @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 + @make -s --no-print-directory TARGET=5 clean all diff --git a/examples/makefile b/examples/makefile index b49427c18..6c929fd9f 100644 --- a/examples/makefile +++ b/examples/makefile @@ -34,25 +34,3 @@ rebuild: @make -s --no-print-directory rebuild -C common/font @make -s --no-print-directory rebuild -C common/imgui @make -s --no-print-directory rebuild -C common/nanovg - -metal: - @make -s --no-print-directory TARGET=5 -C 01-cubes - @make -s --no-print-directory TARGET=5 -C 03-raymarch - @make -s --no-print-directory TARGET=5 -C 04-mesh - @make -s --no-print-directory TARGET=5 -C 05-instancing - @make -s --no-print-directory TARGET=5 -C 06-bump - @make -s --no-print-directory TARGET=5 -C 07-callback - @make -s --no-print-directory TARGET=5 -C 08-update - @make -s --no-print-directory TARGET=5 -C 09-hdr - @make -s --no-print-directory TARGET=5 -C 12-lod - @make -s --no-print-directory TARGET=5 -C 13-stencil - @make -s --no-print-directory TARGET=5 -C 14-shadowvolumes - @make -s --no-print-directory TARGET=5 -C 15-shadowmaps-simple - @make -s --no-print-directory TARGET=5 -C 16-shadowmaps - @make -s --no-print-directory TARGET=5 -C 18-ibl - @make -s --no-print-directory TARGET=5 -C 19-oit - @make -s --no-print-directory TARGET=5 -C 21-deferred - @make -s --no-print-directory TARGET=5 -C 23-vectordisplay - @make -s --no-print-directory TARGET=5 -C 24-nbody - @make -s --no-print-directory TARGET=5 -C 27-terrain - @make -s --no-print-directory TARGET=5 -C 28-wireframe diff --git a/examples/runtime/shaders/dx11/fs_wf_mesh.bin b/examples/runtime/shaders/dx11/fs_wf_mesh.bin index a769f051b8faa20d72899a7ae5eee2edc3c28dd3..76647c0b804d7f4832e2b880f6623026f304a93f 100644 GIT binary patch delta 193 zcmbQtGnr?CJpay_HuK|o%2W^B-sk@D@U)G3nvC^D3<3-w;3g!{;0UA{ftZJZffX*! z1d->4ih<;TYQgG&Oim0JA}AEf^R$kko+X!&()`Ol&Lw8&Meu delta 193 zcmbQtGnr?CJU`cR#)K13%KpCIQoY%IW6MT8O~!g51_1^T;1UpMa0JqfK+MCyzzP?K z%5ww7ln`pc>VQf)k<>Lb0tG-oia`L*wqRi3KvDydZ%_c!ObiTc417Slg(lx&losQH U8gHS%z+MDpvoUPuWnyCi0LyR{4gdfE diff --git a/examples/runtime/shaders/dx9/fs_wf_mesh.bin b/examples/runtime/shaders/dx9/fs_wf_mesh.bin index fb7f05dfd9788c685a5a4c89eb08620a63b61759..06e389eb117ed79b5a85d34e3a32bbf2bf01b4be 100644 GIT binary patch delta 145 zcmaFD{)c^nB;$jPQi~bu*&7%bo=l8kU|?ck0J9sSfow(ydje3987kh*$nd0_6~S*{ zVhCNp23E@mG=rf5!e#=pL!oRIAbV8 3 +# if BGFX_SHADER_LANGUAGE_HLSL > 4 +# define dFdxCoarse(_x) ddx_coarse(_x) +# define dFdxFine(_x) ddx_fine(_x) +# define dFdyCoarse(_y) ddy_coarse(-_y) +# define dFdyFine(_y) ddy_fine(-_y) +# endif // BGFX_SHADER_LANGUAGE_HLSL > 4 + struct BgfxSampler2D { SamplerState m_sampler;