--- ray/test/renders/Makefile 2018/12/25 18:21:30 1.13 +++ ray/test/renders/Makefile 2021/03/02 17:51:56 1.35 @@ -1,33 +1,104 @@ -# RCSid $Id: Makefile,v 1.13 2018/12/25 18:21:30 greg Exp $ +# RCSid $Id: Makefile,v 1.35 2021/03/02 17:51:56 greg Exp $ # # Render and primitive type testing # +# Number of processes to use on tests that run multi-core +ifeq ($(OS),Windows_NT) # is Windows + NPROC := 1 +else + NPROC := 2 +endif + # Image reduction for comparisons RDU_PFILT = pfilt -1 -r 1 -x 128 -y 128 -pa 1 # Image comparison command -IMG_CMP = radcompare -rms 0.07 -max 1.5 +IMG_CMP = radcompare -rel 0.007 -rms 0.1 -max 1.5 # Default target is to test everything -all: test-xform \ -test-mixtex-def test-mixtex-fish test-mixtex-plan tex-mixtex-rplan \ -test-trans2-def test-trans2-fish test-dielectric-def \ -test-dielectric-fish test-glass-def test-glass-fish test-glass-up \ +all: test-xform test-oconv test-rad test-rfluxmtx test-rpiece \ +test-rpict test-mkpmap \ +test-trans2-def test-trans2-fish test-trans2-win \ +test-mixtex-def test-mixtex-fish test-mixtex-plan test-mixtex-rplan \ test-tfunc-def test-tfunc-fish test-inst-def test-inst-fish \ -test-mesh-def test-mesh-cyl test-mirror-fish test-mist-def \ -test-trans-def test-trans-fish test-patterns-def test-patterns-plan +test-mesh-def test-mesh-cyl test-mesh-cyl2 test-mist-def \ +test-dielectric-def test-dielectric-fish test-trans-def \ +test-glass-def test-glass-fish test-glass-up \ +test-trans-fish test-patterns-def test-patterns-plan \ +test-rtrace test-mirror-fish test-obj2mesh \ +test-prism1-fish test-prism2-fish clean: rm -f *.oct *.amb *_ill.dat blinds_ill?.dat *_*.hdr *.unf \ -*.[cg]pm{,.leaf} combined.rad +*.[cg]pm{,.leaf} inst_rad.txt combined.rad rfmirror.mtx -# Special test of xform +###### +# More-or-less evenly divided batches for NPROC=1 (redundancies removed) -test-xform: combined_scene.rad - xform -f combined_scene.rad | grep -v '^[ ]*#' > combined.rad - radcompare -max 0.04 ref/combined.rad combined.rad +batch1: test-mixtex-def test-mixtex-fish test-mixtex-plan test-mixtex-rplan \ +test-xform test-oconv test-rad test-obj2mesh +batch2: test-rfluxmtx test-mist-def test-glass-def test-glass-fish test-glass-up + +batch3: test-inst-def test-inst-fish test-trans2-def test-trans2-fish test-trans2-win \ +test-dielectric-def test-dielectric-fish + +batch4: test-rtrace test-prism1-fish test-prism2-fish test-mirror-fish \ +test-mesh-def test-mesh-cyl test-mesh-cyl2 test-tfunc-def test-tfunc-fish \ +test-trans-def test-trans-fish test-patterns-def test-patterns-plan + +### Test Aliases ### + +test-rpict: test-mirror-fish + +test-rpiece test-mkpmap: test-mixtex-def + +### Special test of xform ### + +test-xform: combined.rad + radcompare "-c#" -max 0.04 ref/combined.rad combined.rad + +combined.rad: combined_scene.rad + xform -f combined_scene.rad > combined.rad + +### Special test of rad ### + +test-rad: inst.oct + rad -n -s -e inst.rif > inst_rad.txt + radcompare ref/inst_rad.txt inst_rad.txt + +### Special tests of oconv and obj2mesh ### + +test-oconv: inst.oct + radcompare ref/inst.oct inst.oct + +test-obj2mesh: cab.obj + obj2mesh -w cab.obj | radcompare ref/cab.rtm - + +### Special test of rtrace ### + +test-rtrace: ref/mirror_fish.hdr rtmirror_fish.hdr + $(RDU_PFILT) rtmirror_fish.hdr | $(IMG_CMP) -h ref/mirror_fish.hdr - + +rtmirror_fish.hdr: mirror.oct + rad -v 0 mirror.rif OPT=mirror.opt + vwrays -ff -vf fish.vf -x 2048 -y 1991 | rtrace -n $(NPROC) @mirror.opt \ +-ffc -x 2048 -y 1991 mirror.oct | pfilt -1 -e +3 -r .6 -x /2 -y /2 \ +> rtmirror_fish.hdr + rm -f mirror.opt + +### Special test for rfluxmtx (and rcontrib) ### + +test-rfluxmtx: ref/rfmirror.mtx rfmirror.mtx + radcompare -max .4 -rms .05 -rel 1e-4 ref/rfmirror.mtx rfmirror.mtx + +rfmirror.mtx: mirror.rad dummysky.rad basic.mat diorama_walls.rad \ +closed_end.rad front_cap.rad glass_pane.rad antimatter_portal.rad + rfluxmtx -n $(NPROC) -ab 2 -lw 1e-4 mirror.rad dummysky.rad \ +basic.mat diorama_walls.rad closed_end.rad front_cap.rad \ +glass_pane.rad antimatter_portal.rad > rfmirror.mtx + ### Octree for dielectric ### dielectric.oct: dielectric.rif @@ -207,11 +278,6 @@ mirror_fish.hdr: mirror.oct ### End mirror-fish tests -### Octree for mist ### - -mist.oct: mist.rif - rad -v 0 mist.rif - ### Reference and test for mist view def ### test-mist-def: ref/mist_def.hdr mist_def.hdr @@ -221,8 +287,8 @@ ref/mist_def.hdr: make mist_def.hdr $(RDU_PFILT) mist_def.hdr > ref/mist_def.hdr -mist_def.hdr: mist.oct - rad -v def mist.rif +mist_def.hdr: mist.rif + rad -N $(NPROC) mist.rif ### End mist-def tests @@ -266,7 +332,7 @@ prism2_fish.hdr: prism2.oct ### Octree for tfunc ### -tfunc.oct: tfunc.rif +tfunc1.oct: tfunc.rif rad -v 0 tfunc.rif ### Reference and test for tfunc view def ### @@ -278,7 +344,7 @@ ref/tfunc_def.hdr: make tfunc_def.hdr $(RDU_PFILT) tfunc_def.hdr > ref/tfunc_def.hdr -tfunc_def.hdr: tfunc.oct +tfunc_def.hdr: tfunc1.oct rad -v def tfunc.rif ### End tfunc-def tests @@ -292,7 +358,7 @@ ref/tfunc_fish.hdr: make tfunc_fish.hdr $(RDU_PFILT) tfunc_fish.hdr > ref/tfunc_fish.hdr -tfunc_fish.hdr: tfunc.oct +tfunc_fish.hdr: tfunc1.oct rad -v fish tfunc.rif ### End tfunc-fish tests @@ -332,7 +398,7 @@ trans_fish.hdr: trans.oct ### Octree for trans2 ### -trans2.oct: trans2.rif +trans21.oct: trans2.rif rad -v 0 trans2.rif ### Reference and test for trans2 view def ### @@ -344,7 +410,7 @@ ref/trans2_def.hdr: make trans2_def.hdr $(RDU_PFILT) trans2_def.hdr > ref/trans2_def.hdr -trans2_def.hdr: trans2.oct +trans2_def.hdr: trans21.oct rad -v def trans2.rif ### End trans2-def tests @@ -358,7 +424,7 @@ ref/trans2_fish.hdr: make trans2_fish.hdr $(RDU_PFILT) trans2_fish.hdr > ref/trans2_fish.hdr -trans2_fish.hdr: trans2.oct +trans2_fish.hdr: trans21.oct rad -v fish trans2.rif ### End trans2-fish tests @@ -372,7 +438,7 @@ ref/trans2_win.hdr: make trans2_win.hdr $(RDU_PFILT) trans2_win.hdr > ref/trans2_win.hdr -trans2_win.hdr: trans2.oct +trans2_win.hdr: trans21.oct rad -v win trans2.rif ### End trans2-win tests @@ -413,7 +479,7 @@ patterns_plan.hdr: patterns.oct ### Octree for mixtex ### mixtex.oct: mixtex.rif - rad -v 0 mixtex.rif + rad -v 0 -N $(NPROC) mixtex.rif ### Reference and test for mixtex view def ### @@ -425,7 +491,7 @@ ref/mixtex_def.hdr: $(RDU_PFILT) mixtex_def.hdr > ref/mixtex_def.hdr mixtex_def.hdr: mixtex.oct - rad -v def mixtex.rif + rad -v def -N $(NPROC) mixtex.rif ### End mixtex-def tests