From d26100734623f37063206b9b144c2a29fd71d414 Mon Sep 17 00:00:00 2001 From: quou Date: Wed, 1 Jan 2025 18:43:31 +1100 Subject: material system --- Makefile | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 8f7bbce..600bdda 100644 --- a/Makefile +++ b/Makefile @@ -3,9 +3,15 @@ target = c2 data_dir = data shaders = $(data_dir)/triangle.csh $(data_dir)/ui.csh $(data_dir)/surface.csh -textures = $(data_dir)/22.tex $(data_dir)/kita.tex +textures = \ + $(data_dir)/22.tex \ + $(data_dir)/kita.tex \ + $(data_dir)/brick_albedo.tex \ + $(data_dir)/brick_ao.tex \ + $(data_dir)/brick_normal.tex models = $(data_dir)/monkey.mdl -packed_files = $(shaders) $(textures) $(models) +materials = $(data_dir)/bricks.mat $(data_dir)/plastic.mat +packed_files = $(shaders) $(textures) $(models) $(materials) tools = qstd cfg sc objects = app.o c2.o video.o pipeline.o asset.o ui.o maths.o model.o includes = -Iqstd @@ -35,6 +41,9 @@ convtexture: convtexture.c | qstd convmodel: convmodel.c | qstd $(CC) $(cflags) convmodel.c $(lflags) -Lqstd -lqstd -o convmodel +convmaterial: convmaterial.c | qstd cfg + $(CC) $(cflags) convmaterial.c $(lflags) -Lqstd -lqstd -Lcfg -lcfg -o convmaterial + pack: $(packed_files) packer ./packer pack $(data_dir) $(notdir $(packed_files)) @@ -53,9 +62,24 @@ data/22.tex: intermediate/22.bmp | $(data_dir) convtexture data/kita.tex: intermediate/kita.bmp | $(data_dir) convtexture ./convtexture intermediate/kita.bmp $(data_dir)/kita.tex bc1 +data/brick_albedo.tex: intermediate/brick_albedo.bmp | $(data_dir) convtexture + ./convtexture intermediate/brick_albedo.bmp $(data_dir)/brick_albedo.tex bc1 + +data/brick_ao.tex: intermediate/brick_ao.bmp | $(data_dir) convtexture + ./convtexture intermediate/brick_ao.bmp $(data_dir)/brick_ao.tex bc4 + +data/brick_normal.tex: intermediate/brick_normal.bmp | $(data_dir) convtexture + ./convtexture intermediate/brick_normal.bmp $(data_dir)/brick_normal.tex bc5 + data/monkey.mdl: intermediate/monkey.glb $(shaders) | $(data_dir) convmodel ./convmodel $(data_dir) intermediate/monkey.glb $(data_dir)/monkey.mdl +data/bricks.mat: intermediate/bricks.mat | $(data_dir) convmaterial + ./convmaterial intermediate/bricks.mat $(data_dir)/bricks.mat + +data/plastic.mat: intermediate/plastic.mat | $(data_dir) convmaterial + ./convmaterial intermediate/plastic.mat $(data_dir)/plastic.mat + app.o: $(CXX) -c $(cflags) app.cpp -o app.o -- cgit v1.2.3-54-g00ecf