From d74fa3c7777216c9d811eef3f9e92c8fbef8e03e Mon Sep 17 00:00:00 2001 From: Lubos Lenco Date: Sun, 7 Feb 2016 23:03:52 +0100 Subject: [PATCH] Export logic nodes to separate folder --- .../env_map => Assets}/env_map.json | 0 Assets/material_resource.json | 2 +- Sources/Shaders/env_map.frag.glsl | 17 +- Sources/Shaders/env_map.vert.glsl | 27 +-- blender/armory.py | 12 +- blender/nodes_logic.py | 9 +- blender/nodes_pipeline.py | 1 + blender/project.py | 7 +- blender/write_data.py | 13 +- compiled/ShaderResources/forward/forward.json | 91 --------- .../forward/forward_AlphaTest.json | 91 --------- .../forward/forward_AlphaTest_Billboard.json | 91 --------- ...orward_AlphaTest_Billboard_Instancing.json | 91 --------- ...st_Billboard_Instancing_NormalMapping.json | 98 ---------- ...ard_Instancing_NormalMapping_Skinning.json | 111 ----------- ...cing_NormalMapping_Skinning_Texturing.json | 118 ------------ ...ormalMapping_Skinning_Texturing_VCols.json | 122 ------------ ...stancing_NormalMapping_Skinning_VCols.json | 115 ----------- ...rd_Instancing_NormalMapping_Texturing.json | 105 ---------- ...tancing_NormalMapping_Texturing_VCols.json | 109 ----------- ...lboard_Instancing_NormalMapping_VCols.json | 102 ---------- ...phaTest_Billboard_Instancing_Skinning.json | 104 ---------- ...llboard_Instancing_Skinning_Texturing.json | 111 ----------- ...d_Instancing_Skinning_Texturing_VCols.json | 115 ----------- ...t_Billboard_Instancing_Skinning_VCols.json | 108 ----------- ...haTest_Billboard_Instancing_Texturing.json | 98 ---------- ..._Billboard_Instancing_Texturing_VCols.json | 102 ---------- ..._AlphaTest_Billboard_Instancing_VCols.json | 95 --------- ...ard_AlphaTest_Billboard_NormalMapping.json | 98 ---------- ...Test_Billboard_NormalMapping_Skinning.json | 111 ----------- ...oard_NormalMapping_Skinning_Texturing.json | 118 ------------ ...ormalMapping_Skinning_Texturing_VCols.json | 122 ------------ ...illboard_NormalMapping_Skinning_VCols.json | 115 ----------- ...est_Billboard_NormalMapping_Texturing.json | 105 ---------- ...llboard_NormalMapping_Texturing_VCols.json | 109 ----------- ...phaTest_Billboard_NormalMapping_VCols.json | 102 ---------- .../forward_AlphaTest_Billboard_Skinning.json | 104 ---------- ...lphaTest_Billboard_Skinning_Texturing.json | 111 ----------- ...st_Billboard_Skinning_Texturing_VCols.json | 115 ----------- ...rd_AlphaTest_Billboard_Skinning_VCols.json | 108 ----------- ...forward_AlphaTest_Billboard_Texturing.json | 98 ---------- ...d_AlphaTest_Billboard_Texturing_VCols.json | 102 ---------- .../forward_AlphaTest_Billboard_VCols.json | 95 --------- .../forward/forward_AlphaTest_Instancing.json | 91 --------- ...rd_AlphaTest_Instancing_NormalMapping.json | 98 ---------- ...est_Instancing_NormalMapping_Skinning.json | 111 ----------- ...cing_NormalMapping_Skinning_Texturing.json | 118 ------------ ...ormalMapping_Skinning_Texturing_VCols.json | 122 ------------ ...stancing_NormalMapping_Skinning_VCols.json | 115 ----------- ...st_Instancing_NormalMapping_Texturing.json | 105 ---------- ...tancing_NormalMapping_Texturing_VCols.json | 109 ----------- ...haTest_Instancing_NormalMapping_VCols.json | 102 ---------- ...forward_AlphaTest_Instancing_Skinning.json | 104 ---------- ...phaTest_Instancing_Skinning_Texturing.json | 111 ----------- ...t_Instancing_Skinning_Texturing_VCols.json | 115 ----------- ...d_AlphaTest_Instancing_Skinning_VCols.json | 108 ----------- ...orward_AlphaTest_Instancing_Texturing.json | 98 ---------- ..._AlphaTest_Instancing_Texturing_VCols.json | 102 ---------- .../forward_AlphaTest_Instancing_VCols.json | 95 --------- .../forward_AlphaTest_NormalMapping.json | 98 ---------- ...ward_AlphaTest_NormalMapping_Skinning.json | 111 ----------- ...Test_NormalMapping_Skinning_Texturing.json | 118 ------------ ...ormalMapping_Skinning_Texturing_VCols.json | 122 ------------ ...lphaTest_NormalMapping_Skinning_VCols.json | 115 ----------- ...ard_AlphaTest_NormalMapping_Texturing.json | 105 ---------- ...phaTest_NormalMapping_Texturing_VCols.json | 109 ----------- ...forward_AlphaTest_NormalMapping_VCols.json | 102 ---------- .../forward/forward_AlphaTest_Skinning.json | 104 ---------- .../forward_AlphaTest_Skinning_Texturing.json | 111 ----------- ...rd_AlphaTest_Skinning_Texturing_VCols.json | 115 ----------- .../forward_AlphaTest_Skinning_VCols.json | 108 ----------- .../forward/forward_AlphaTest_Texturing.json | 98 ---------- .../forward_AlphaTest_Texturing_VCols.json | 102 ---------- .../forward/forward_AlphaTest_VCols.json | 95 --------- .../forward/forward_Billboard.json | 91 --------- .../forward/forward_Billboard_Instancing.json | 91 --------- ...rd_Billboard_Instancing_NormalMapping.json | 98 ---------- ...ard_Instancing_NormalMapping_Skinning.json | 111 ----------- ...cing_NormalMapping_Skinning_Texturing.json | 118 ------------ ...ormalMapping_Skinning_Texturing_VCols.json | 122 ------------ ...stancing_NormalMapping_Skinning_VCols.json | 115 ----------- ...rd_Instancing_NormalMapping_Texturing.json | 105 ---------- ...tancing_NormalMapping_Texturing_VCols.json | 109 ----------- ...lboard_Instancing_NormalMapping_VCols.json | 102 ---------- ...forward_Billboard_Instancing_Skinning.json | 104 ---------- ...llboard_Instancing_Skinning_Texturing.json | 111 ----------- ...d_Instancing_Skinning_Texturing_VCols.json | 115 ----------- ...d_Billboard_Instancing_Skinning_VCols.json | 108 ----------- ...orward_Billboard_Instancing_Texturing.json | 98 ---------- ..._Billboard_Instancing_Texturing_VCols.json | 102 ---------- .../forward_Billboard_Instancing_VCols.json | 95 --------- .../forward_Billboard_NormalMapping.json | 98 ---------- ...ward_Billboard_NormalMapping_Skinning.json | 111 ----------- ...oard_NormalMapping_Skinning_Texturing.json | 118 ------------ ...ormalMapping_Skinning_Texturing_VCols.json | 122 ------------ ...illboard_NormalMapping_Skinning_VCols.json | 115 ----------- ...ard_Billboard_NormalMapping_Texturing.json | 105 ---------- ...llboard_NormalMapping_Texturing_VCols.json | 109 ----------- ...forward_Billboard_NormalMapping_VCols.json | 102 ---------- .../forward/forward_Billboard_Skinning.json | 104 ---------- .../forward_Billboard_Skinning_Texturing.json | 111 ----------- ...rd_Billboard_Skinning_Texturing_VCols.json | 115 ----------- .../forward_Billboard_Skinning_VCols.json | 108 ----------- .../forward/forward_Billboard_Texturing.json | 98 ---------- .../forward_Billboard_Texturing_VCols.json | 102 ---------- .../forward/forward_Billboard_VCols.json | 95 --------- .../forward/forward_Instancing.json | 91 --------- .../forward_Instancing_NormalMapping.json | 98 ---------- ...ard_Instancing_NormalMapping_Skinning.json | 111 ----------- ...cing_NormalMapping_Skinning_Texturing.json | 118 ------------ ...ormalMapping_Skinning_Texturing_VCols.json | 122 ------------ ...stancing_NormalMapping_Skinning_VCols.json | 115 ----------- ...rd_Instancing_NormalMapping_Texturing.json | 105 ---------- ...tancing_NormalMapping_Texturing_VCols.json | 109 ----------- ...orward_Instancing_NormalMapping_VCols.json | 102 ---------- .../forward/forward_Instancing_Skinning.json | 104 ---------- ...forward_Instancing_Skinning_Texturing.json | 111 ----------- ...d_Instancing_Skinning_Texturing_VCols.json | 115 ----------- .../forward_Instancing_Skinning_VCols.json | 108 ----------- .../forward/forward_Instancing_Texturing.json | 98 ---------- .../forward_Instancing_Texturing_VCols.json | 102 ---------- .../forward/forward_Instancing_VCols.json | 95 --------- .../forward/forward_NormalMapping.json | 98 ---------- .../forward_NormalMapping_Skinning.json | 111 ----------- ...ward_NormalMapping_Skinning_Texturing.json | 118 ------------ ...ormalMapping_Skinning_Texturing_VCols.json | 122 ------------ .../forward_NormalMapping_Skinning_VCols.json | 115 ----------- .../forward_NormalMapping_Texturing.json | 105 ---------- ...forward_NormalMapping_Texturing_VCols.json | 109 ----------- .../forward/forward_NormalMapping_VCols.json | 102 ---------- .../forward/forward_Skinning.json | 104 ---------- .../forward/forward_Skinning_Texturing.json | 111 ----------- .../forward_Skinning_Texturing_VCols.json | 115 ----------- .../forward/forward_Skinning_VCols.json | 108 ----------- .../forward/forward_Texturing.json | 98 ---------- .../forward/forward_Texturing_VCols.json | 102 ---------- .../forward/forward_VCols.json | 95 --------- compiled/Shaders/env_map/env_map.frag.glsl | 24 --- compiled/Shaders/env_map/env_map.vert.glsl | 73 ------- compiled/Shaders/forward/forward.frag.glsl | 145 -------------- compiled/Shaders/forward/forward.vert.glsl | 150 --------------- .../forward/forward_AlphaTest.frag.glsl | 146 -------------- .../forward/forward_AlphaTest.vert.glsl | 151 --------------- .../forward_AlphaTest_Billboard.frag.glsl | 147 -------------- .../forward_AlphaTest_Billboard.vert.glsl | 152 --------------- ...d_AlphaTest_Billboard_Instancing.frag.glsl | 148 -------------- ...d_AlphaTest_Billboard_Instancing.vert.glsl | 153 --------------- ...llboard_Instancing_NormalMapping.frag.glsl | 149 -------------- ...llboard_Instancing_NormalMapping.vert.glsl | 154 --------------- ...nstancing_NormalMapping_Skinning.frag.glsl | 150 --------------- ...nstancing_NormalMapping_Skinning.vert.glsl | 155 --------------- ...NormalMapping_Skinning_Texturing.frag.glsl | 151 --------------- ...NormalMapping_Skinning_Texturing.vert.glsl | 156 --------------- ...Mapping_Skinning_Texturing_VCols.frag.glsl | 152 --------------- ...Mapping_Skinning_Texturing_VCols.vert.glsl | 157 --------------- ...ing_NormalMapping_Skinning_VCols.frag.glsl | 151 --------------- ...ing_NormalMapping_Skinning_VCols.vert.glsl | 156 --------------- ...stancing_NormalMapping_Texturing.frag.glsl | 150 --------------- ...stancing_NormalMapping_Texturing.vert.glsl | 155 --------------- ...ng_NormalMapping_Texturing_VCols.frag.glsl | 151 --------------- ...ng_NormalMapping_Texturing_VCols.vert.glsl | 156 --------------- ...d_Instancing_NormalMapping_VCols.frag.glsl | 150 --------------- ...d_Instancing_NormalMapping_VCols.vert.glsl | 155 --------------- ...st_Billboard_Instancing_Skinning.frag.glsl | 149 -------------- ...st_Billboard_Instancing_Skinning.vert.glsl | 154 --------------- ...rd_Instancing_Skinning_Texturing.frag.glsl | 150 --------------- ...rd_Instancing_Skinning_Texturing.vert.glsl | 155 --------------- ...tancing_Skinning_Texturing_VCols.frag.glsl | 151 --------------- ...tancing_Skinning_Texturing_VCols.vert.glsl | 156 --------------- ...lboard_Instancing_Skinning_VCols.frag.glsl | 150 --------------- ...lboard_Instancing_Skinning_VCols.vert.glsl | 155 --------------- ...t_Billboard_Instancing_Texturing.frag.glsl | 149 -------------- ...t_Billboard_Instancing_Texturing.vert.glsl | 154 --------------- ...board_Instancing_Texturing_VCols.frag.glsl | 150 --------------- ...board_Instancing_Texturing_VCols.vert.glsl | 155 --------------- ...aTest_Billboard_Instancing_VCols.frag.glsl | 149 -------------- ...aTest_Billboard_Instancing_VCols.vert.glsl | 154 --------------- ...lphaTest_Billboard_NormalMapping.frag.glsl | 148 -------------- ...lphaTest_Billboard_NormalMapping.vert.glsl | 153 --------------- ...Billboard_NormalMapping_Skinning.frag.glsl | 149 -------------- ...Billboard_NormalMapping_Skinning.vert.glsl | 154 --------------- ...NormalMapping_Skinning_Texturing.frag.glsl | 150 --------------- ...NormalMapping_Skinning_Texturing.vert.glsl | 155 --------------- ...Mapping_Skinning_Texturing_VCols.frag.glsl | 151 --------------- ...Mapping_Skinning_Texturing_VCols.vert.glsl | 156 --------------- ...ard_NormalMapping_Skinning_VCols.frag.glsl | 150 --------------- ...ard_NormalMapping_Skinning_VCols.vert.glsl | 155 --------------- ...illboard_NormalMapping_Texturing.frag.glsl | 149 -------------- ...illboard_NormalMapping_Texturing.vert.glsl | 154 --------------- ...rd_NormalMapping_Texturing_VCols.frag.glsl | 150 --------------- ...rd_NormalMapping_Texturing_VCols.vert.glsl | 155 --------------- ...st_Billboard_NormalMapping_VCols.frag.glsl | 149 -------------- ...st_Billboard_NormalMapping_VCols.vert.glsl | 154 --------------- ...ard_AlphaTest_Billboard_Skinning.frag.glsl | 148 -------------- ...ard_AlphaTest_Billboard_Skinning.vert.glsl | 153 --------------- ...est_Billboard_Skinning_Texturing.frag.glsl | 149 -------------- ...est_Billboard_Skinning_Texturing.vert.glsl | 154 --------------- ...llboard_Skinning_Texturing_VCols.frag.glsl | 150 --------------- ...llboard_Skinning_Texturing_VCols.vert.glsl | 155 --------------- ...phaTest_Billboard_Skinning_VCols.frag.glsl | 149 -------------- ...phaTest_Billboard_Skinning_VCols.vert.glsl | 154 --------------- ...rd_AlphaTest_Billboard_Texturing.frag.glsl | 148 -------------- ...rd_AlphaTest_Billboard_Texturing.vert.glsl | 153 --------------- ...haTest_Billboard_Texturing_VCols.frag.glsl | 149 -------------- ...haTest_Billboard_Texturing_VCols.vert.glsl | 154 --------------- ...orward_AlphaTest_Billboard_VCols.frag.glsl | 148 -------------- ...orward_AlphaTest_Billboard_VCols.vert.glsl | 153 --------------- .../forward_AlphaTest_Instancing.frag.glsl | 147 -------------- .../forward_AlphaTest_Instancing.vert.glsl | 152 --------------- ...phaTest_Instancing_NormalMapping.frag.glsl | 148 -------------- ...phaTest_Instancing_NormalMapping.vert.glsl | 153 --------------- ...nstancing_NormalMapping_Skinning.frag.glsl | 149 -------------- ...nstancing_NormalMapping_Skinning.vert.glsl | 154 --------------- ...NormalMapping_Skinning_Texturing.frag.glsl | 150 --------------- ...NormalMapping_Skinning_Texturing.vert.glsl | 155 --------------- ...Mapping_Skinning_Texturing_VCols.frag.glsl | 151 --------------- ...Mapping_Skinning_Texturing_VCols.vert.glsl | 156 --------------- ...ing_NormalMapping_Skinning_VCols.frag.glsl | 150 --------------- ...ing_NormalMapping_Skinning_VCols.vert.glsl | 155 --------------- ...stancing_NormalMapping_Texturing.frag.glsl | 149 -------------- ...stancing_NormalMapping_Texturing.vert.glsl | 154 --------------- ...ng_NormalMapping_Texturing_VCols.frag.glsl | 150 --------------- ...ng_NormalMapping_Texturing_VCols.vert.glsl | 155 --------------- ...t_Instancing_NormalMapping_VCols.frag.glsl | 149 -------------- ...t_Instancing_NormalMapping_VCols.vert.glsl | 154 --------------- ...rd_AlphaTest_Instancing_Skinning.frag.glsl | 148 -------------- ...rd_AlphaTest_Instancing_Skinning.vert.glsl | 153 --------------- ...st_Instancing_Skinning_Texturing.frag.glsl | 149 -------------- ...st_Instancing_Skinning_Texturing.vert.glsl | 154 --------------- ...tancing_Skinning_Texturing_VCols.frag.glsl | 150 --------------- ...tancing_Skinning_Texturing_VCols.vert.glsl | 155 --------------- ...haTest_Instancing_Skinning_VCols.frag.glsl | 149 -------------- ...haTest_Instancing_Skinning_VCols.vert.glsl | 154 --------------- ...d_AlphaTest_Instancing_Texturing.frag.glsl | 148 -------------- ...d_AlphaTest_Instancing_Texturing.vert.glsl | 153 --------------- ...aTest_Instancing_Texturing_VCols.frag.glsl | 149 -------------- ...aTest_Instancing_Texturing_VCols.vert.glsl | 154 --------------- ...rward_AlphaTest_Instancing_VCols.frag.glsl | 148 -------------- ...rward_AlphaTest_Instancing_VCols.vert.glsl | 153 --------------- .../forward_AlphaTest_NormalMapping.frag.glsl | 147 -------------- .../forward_AlphaTest_NormalMapping.vert.glsl | 152 --------------- ...AlphaTest_NormalMapping_Skinning.frag.glsl | 148 -------------- ...AlphaTest_NormalMapping_Skinning.vert.glsl | 153 --------------- ...NormalMapping_Skinning_Texturing.frag.glsl | 149 -------------- ...NormalMapping_Skinning_Texturing.vert.glsl | 154 --------------- ...Mapping_Skinning_Texturing_VCols.frag.glsl | 150 --------------- ...Mapping_Skinning_Texturing_VCols.vert.glsl | 155 --------------- ...est_NormalMapping_Skinning_VCols.frag.glsl | 149 -------------- ...est_NormalMapping_Skinning_VCols.vert.glsl | 154 --------------- ...lphaTest_NormalMapping_Texturing.frag.glsl | 148 -------------- ...lphaTest_NormalMapping_Texturing.vert.glsl | 153 --------------- ...st_NormalMapping_Texturing_VCols.frag.glsl | 149 -------------- ...st_NormalMapping_Texturing_VCols.vert.glsl | 154 --------------- ...rd_AlphaTest_NormalMapping_VCols.frag.glsl | 148 -------------- ...rd_AlphaTest_NormalMapping_VCols.vert.glsl | 153 --------------- .../forward_AlphaTest_Skinning.frag.glsl | 147 -------------- .../forward_AlphaTest_Skinning.vert.glsl | 152 --------------- ...ard_AlphaTest_Skinning_Texturing.frag.glsl | 148 -------------- ...ard_AlphaTest_Skinning_Texturing.vert.glsl | 153 --------------- ...phaTest_Skinning_Texturing_VCols.frag.glsl | 149 -------------- ...phaTest_Skinning_Texturing_VCols.vert.glsl | 154 --------------- ...forward_AlphaTest_Skinning_VCols.frag.glsl | 148 -------------- ...forward_AlphaTest_Skinning_VCols.vert.glsl | 153 --------------- .../forward_AlphaTest_Texturing.frag.glsl | 147 -------------- .../forward_AlphaTest_Texturing.vert.glsl | 152 --------------- ...orward_AlphaTest_Texturing_VCols.frag.glsl | 148 -------------- ...orward_AlphaTest_Texturing_VCols.vert.glsl | 153 --------------- .../forward/forward_AlphaTest_VCols.frag.glsl | 147 -------------- .../forward/forward_AlphaTest_VCols.vert.glsl | 152 --------------- .../forward/forward_Billboard.frag.glsl | 146 -------------- .../forward/forward_Billboard.vert.glsl | 151 --------------- .../forward_Billboard_Instancing.frag.glsl | 147 -------------- .../forward_Billboard_Instancing.vert.glsl | 152 --------------- ...llboard_Instancing_NormalMapping.frag.glsl | 148 -------------- ...llboard_Instancing_NormalMapping.vert.glsl | 153 --------------- ...nstancing_NormalMapping_Skinning.frag.glsl | 149 -------------- ...nstancing_NormalMapping_Skinning.vert.glsl | 154 --------------- ...NormalMapping_Skinning_Texturing.frag.glsl | 150 --------------- ...NormalMapping_Skinning_Texturing.vert.glsl | 155 --------------- ...Mapping_Skinning_Texturing_VCols.frag.glsl | 151 --------------- ...Mapping_Skinning_Texturing_VCols.vert.glsl | 156 --------------- ...ing_NormalMapping_Skinning_VCols.frag.glsl | 150 --------------- ...ing_NormalMapping_Skinning_VCols.vert.glsl | 155 --------------- ...stancing_NormalMapping_Texturing.frag.glsl | 149 -------------- ...stancing_NormalMapping_Texturing.vert.glsl | 154 --------------- ...ng_NormalMapping_Texturing_VCols.frag.glsl | 150 --------------- ...ng_NormalMapping_Texturing_VCols.vert.glsl | 155 --------------- ...d_Instancing_NormalMapping_VCols.frag.glsl | 149 -------------- ...d_Instancing_NormalMapping_VCols.vert.glsl | 154 --------------- ...rd_Billboard_Instancing_Skinning.frag.glsl | 148 -------------- ...rd_Billboard_Instancing_Skinning.vert.glsl | 153 --------------- ...rd_Instancing_Skinning_Texturing.frag.glsl | 149 -------------- ...rd_Instancing_Skinning_Texturing.vert.glsl | 154 --------------- ...tancing_Skinning_Texturing_VCols.frag.glsl | 150 --------------- ...tancing_Skinning_Texturing_VCols.vert.glsl | 155 --------------- ...lboard_Instancing_Skinning_VCols.frag.glsl | 149 -------------- ...lboard_Instancing_Skinning_VCols.vert.glsl | 154 --------------- ...d_Billboard_Instancing_Texturing.frag.glsl | 148 -------------- ...d_Billboard_Instancing_Texturing.vert.glsl | 153 --------------- ...board_Instancing_Texturing_VCols.frag.glsl | 149 -------------- ...board_Instancing_Texturing_VCols.vert.glsl | 154 --------------- ...rward_Billboard_Instancing_VCols.frag.glsl | 148 -------------- ...rward_Billboard_Instancing_VCols.vert.glsl | 153 --------------- .../forward_Billboard_NormalMapping.frag.glsl | 147 -------------- .../forward_Billboard_NormalMapping.vert.glsl | 152 --------------- ...Billboard_NormalMapping_Skinning.frag.glsl | 148 -------------- ...Billboard_NormalMapping_Skinning.vert.glsl | 153 --------------- ...NormalMapping_Skinning_Texturing.frag.glsl | 149 -------------- ...NormalMapping_Skinning_Texturing.vert.glsl | 154 --------------- ...Mapping_Skinning_Texturing_VCols.frag.glsl | 150 --------------- ...Mapping_Skinning_Texturing_VCols.vert.glsl | 155 --------------- ...ard_NormalMapping_Skinning_VCols.frag.glsl | 149 -------------- ...ard_NormalMapping_Skinning_VCols.vert.glsl | 154 --------------- ...illboard_NormalMapping_Texturing.frag.glsl | 148 -------------- ...illboard_NormalMapping_Texturing.vert.glsl | 153 --------------- ...rd_NormalMapping_Texturing_VCols.frag.glsl | 149 -------------- ...rd_NormalMapping_Texturing_VCols.vert.glsl | 154 --------------- ...rd_Billboard_NormalMapping_VCols.frag.glsl | 148 -------------- ...rd_Billboard_NormalMapping_VCols.vert.glsl | 153 --------------- .../forward_Billboard_Skinning.frag.glsl | 147 -------------- .../forward_Billboard_Skinning.vert.glsl | 152 --------------- ...ard_Billboard_Skinning_Texturing.frag.glsl | 148 -------------- ...ard_Billboard_Skinning_Texturing.vert.glsl | 153 --------------- ...llboard_Skinning_Texturing_VCols.frag.glsl | 149 -------------- ...llboard_Skinning_Texturing_VCols.vert.glsl | 154 --------------- ...forward_Billboard_Skinning_VCols.frag.glsl | 148 -------------- ...forward_Billboard_Skinning_VCols.vert.glsl | 153 --------------- .../forward_Billboard_Texturing.frag.glsl | 147 -------------- .../forward_Billboard_Texturing.vert.glsl | 152 --------------- ...orward_Billboard_Texturing_VCols.frag.glsl | 148 -------------- ...orward_Billboard_Texturing_VCols.vert.glsl | 153 --------------- .../forward/forward_Billboard_VCols.frag.glsl | 147 -------------- .../forward/forward_Billboard_VCols.vert.glsl | 152 --------------- .../forward/forward_Instancing.frag.glsl | 146 -------------- .../forward/forward_Instancing.vert.glsl | 151 --------------- ...forward_Instancing_NormalMapping.frag.glsl | 147 -------------- ...forward_Instancing_NormalMapping.vert.glsl | 152 --------------- ...nstancing_NormalMapping_Skinning.frag.glsl | 148 -------------- ...nstancing_NormalMapping_Skinning.vert.glsl | 153 --------------- ...NormalMapping_Skinning_Texturing.frag.glsl | 149 -------------- ...NormalMapping_Skinning_Texturing.vert.glsl | 154 --------------- ...Mapping_Skinning_Texturing_VCols.frag.glsl | 150 --------------- ...Mapping_Skinning_Texturing_VCols.vert.glsl | 155 --------------- ...ing_NormalMapping_Skinning_VCols.frag.glsl | 149 -------------- ...ing_NormalMapping_Skinning_VCols.vert.glsl | 154 --------------- ...stancing_NormalMapping_Texturing.frag.glsl | 148 -------------- ...stancing_NormalMapping_Texturing.vert.glsl | 153 --------------- ...ng_NormalMapping_Texturing_VCols.frag.glsl | 149 -------------- ...ng_NormalMapping_Texturing_VCols.vert.glsl | 154 --------------- ...d_Instancing_NormalMapping_VCols.frag.glsl | 148 -------------- ...d_Instancing_NormalMapping_VCols.vert.glsl | 153 --------------- .../forward_Instancing_Skinning.frag.glsl | 147 -------------- .../forward_Instancing_Skinning.vert.glsl | 152 --------------- ...rd_Instancing_Skinning_Texturing.frag.glsl | 148 -------------- ...rd_Instancing_Skinning_Texturing.vert.glsl | 153 --------------- ...tancing_Skinning_Texturing_VCols.frag.glsl | 149 -------------- ...tancing_Skinning_Texturing_VCols.vert.glsl | 154 --------------- ...orward_Instancing_Skinning_VCols.frag.glsl | 148 -------------- ...orward_Instancing_Skinning_VCols.vert.glsl | 153 --------------- .../forward_Instancing_Texturing.frag.glsl | 147 -------------- .../forward_Instancing_Texturing.vert.glsl | 152 --------------- ...rward_Instancing_Texturing_VCols.frag.glsl | 148 -------------- ...rward_Instancing_Texturing_VCols.vert.glsl | 153 --------------- .../forward_Instancing_VCols.frag.glsl | 147 -------------- .../forward_Instancing_VCols.vert.glsl | 152 --------------- .../forward/forward_NormalMapping.frag.glsl | 146 -------------- .../forward/forward_NormalMapping.vert.glsl | 151 --------------- .../forward_NormalMapping_Skinning.frag.glsl | 147 -------------- .../forward_NormalMapping_Skinning.vert.glsl | 152 --------------- ...NormalMapping_Skinning_Texturing.frag.glsl | 148 -------------- ...NormalMapping_Skinning_Texturing.vert.glsl | 153 --------------- ...Mapping_Skinning_Texturing_VCols.frag.glsl | 149 -------------- ...Mapping_Skinning_Texturing_VCols.vert.glsl | 154 --------------- ...ard_NormalMapping_Skinning_VCols.frag.glsl | 148 -------------- ...ard_NormalMapping_Skinning_VCols.vert.glsl | 153 --------------- .../forward_NormalMapping_Texturing.frag.glsl | 147 -------------- .../forward_NormalMapping_Texturing.vert.glsl | 152 --------------- ...rd_NormalMapping_Texturing_VCols.frag.glsl | 148 -------------- ...rd_NormalMapping_Texturing_VCols.vert.glsl | 153 --------------- .../forward_NormalMapping_VCols.frag.glsl | 147 -------------- .../forward_NormalMapping_VCols.vert.glsl | 152 --------------- .../forward/forward_Skinning.frag.glsl | 146 -------------- .../forward/forward_Skinning.vert.glsl | 151 --------------- .../forward_Skinning_Texturing.frag.glsl | 147 -------------- .../forward_Skinning_Texturing.vert.glsl | 152 --------------- ...forward_Skinning_Texturing_VCols.frag.glsl | 148 -------------- ...forward_Skinning_Texturing_VCols.vert.glsl | 153 --------------- .../forward/forward_Skinning_VCols.frag.glsl | 147 -------------- .../forward/forward_Skinning_VCols.vert.glsl | 152 --------------- .../forward/forward_Texturing.frag.glsl | 146 -------------- .../forward/forward_Texturing.vert.glsl | 151 --------------- .../forward/forward_Texturing_VCols.frag.glsl | 147 -------------- .../forward/forward_Texturing_VCols.vert.glsl | 152 --------------- .../Shaders/forward/forward_VCols.frag.glsl | 146 -------------- .../Shaders/forward/forward_VCols.vert.glsl | 151 --------------- raw/forward/forward.frag.glsl | 181 +++++++++++++----- raw/forward/forward.shader.json | 33 ++++ raw/forward/forward.shader_withshadow.json | 99 ---------- raw/forward/forward.vert.glsl | 7 +- ...adow_map.frag.glsl => shadowmap.frag.glsl} | 0 ...adow_map.vert.glsl => shadowmap.vert.glsl} | 6 +- raw/make_resources.py | 4 +- raw/make_variants.py | 10 +- {Assets => raw}/pipeline_resource.json | 0 404 files changed, 239 insertions(+), 52574 deletions(-) rename {compiled/ShaderResources/env_map => Assets}/env_map.json (100%) delete mode 100644 compiled/ShaderResources/forward/forward.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Billboard.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning_Texturing.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning_Texturing_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Texturing.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Texturing_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_Skinning.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_Skinning_Texturing.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_Skinning_Texturing_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_Skinning_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_Texturing.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_Texturing_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Billboard_NormalMapping.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Billboard_NormalMapping_Skinning.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Billboard_NormalMapping_Skinning_Texturing.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Billboard_NormalMapping_Skinning_Texturing_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Billboard_NormalMapping_Skinning_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Billboard_NormalMapping_Texturing.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Billboard_NormalMapping_Texturing_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Billboard_NormalMapping_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Skinning.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Skinning_Texturing.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Skinning_Texturing_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Skinning_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Texturing.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Texturing_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Billboard_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Instancing.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Instancing_NormalMapping.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Instancing_NormalMapping_Skinning.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Instancing_NormalMapping_Skinning_Texturing.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Instancing_NormalMapping_Skinning_Texturing_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Instancing_NormalMapping_Skinning_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Instancing_NormalMapping_Texturing.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Instancing_NormalMapping_Texturing_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Instancing_NormalMapping_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Instancing_Skinning.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Instancing_Skinning_Texturing.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Instancing_Skinning_Texturing_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Instancing_Skinning_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Instancing_Texturing.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Instancing_Texturing_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Instancing_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_NormalMapping.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_NormalMapping_Skinning.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_NormalMapping_Skinning_Texturing.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_NormalMapping_Skinning_Texturing_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_NormalMapping_Skinning_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_NormalMapping_Texturing.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_NormalMapping_Texturing_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_NormalMapping_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Skinning.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Skinning_Texturing.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Skinning_Texturing_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Skinning_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Texturing.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_Texturing_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_AlphaTest_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_Billboard.json delete mode 100644 compiled/ShaderResources/forward/forward_Billboard_Instancing.json delete mode 100644 compiled/ShaderResources/forward/forward_Billboard_Instancing_NormalMapping.json delete mode 100644 compiled/ShaderResources/forward/forward_Billboard_Instancing_NormalMapping_Skinning.json delete mode 100644 compiled/ShaderResources/forward/forward_Billboard_Instancing_NormalMapping_Skinning_Texturing.json delete mode 100644 compiled/ShaderResources/forward/forward_Billboard_Instancing_NormalMapping_Skinning_Texturing_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_Billboard_Instancing_NormalMapping_Skinning_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_Billboard_Instancing_NormalMapping_Texturing.json delete mode 100644 compiled/ShaderResources/forward/forward_Billboard_Instancing_NormalMapping_Texturing_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_Billboard_Instancing_NormalMapping_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_Billboard_Instancing_Skinning.json delete mode 100644 compiled/ShaderResources/forward/forward_Billboard_Instancing_Skinning_Texturing.json delete mode 100644 compiled/ShaderResources/forward/forward_Billboard_Instancing_Skinning_Texturing_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_Billboard_Instancing_Skinning_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_Billboard_Instancing_Texturing.json delete mode 100644 compiled/ShaderResources/forward/forward_Billboard_Instancing_Texturing_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_Billboard_Instancing_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_Billboard_NormalMapping.json delete mode 100644 compiled/ShaderResources/forward/forward_Billboard_NormalMapping_Skinning.json delete mode 100644 compiled/ShaderResources/forward/forward_Billboard_NormalMapping_Skinning_Texturing.json delete mode 100644 compiled/ShaderResources/forward/forward_Billboard_NormalMapping_Skinning_Texturing_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_Billboard_NormalMapping_Skinning_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_Billboard_NormalMapping_Texturing.json delete mode 100644 compiled/ShaderResources/forward/forward_Billboard_NormalMapping_Texturing_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_Billboard_NormalMapping_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_Billboard_Skinning.json delete mode 100644 compiled/ShaderResources/forward/forward_Billboard_Skinning_Texturing.json delete mode 100644 compiled/ShaderResources/forward/forward_Billboard_Skinning_Texturing_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_Billboard_Skinning_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_Billboard_Texturing.json delete mode 100644 compiled/ShaderResources/forward/forward_Billboard_Texturing_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_Billboard_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_Instancing.json delete mode 100644 compiled/ShaderResources/forward/forward_Instancing_NormalMapping.json delete mode 100644 compiled/ShaderResources/forward/forward_Instancing_NormalMapping_Skinning.json delete mode 100644 compiled/ShaderResources/forward/forward_Instancing_NormalMapping_Skinning_Texturing.json delete mode 100644 compiled/ShaderResources/forward/forward_Instancing_NormalMapping_Skinning_Texturing_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_Instancing_NormalMapping_Skinning_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_Instancing_NormalMapping_Texturing.json delete mode 100644 compiled/ShaderResources/forward/forward_Instancing_NormalMapping_Texturing_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_Instancing_NormalMapping_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_Instancing_Skinning.json delete mode 100644 compiled/ShaderResources/forward/forward_Instancing_Skinning_Texturing.json delete mode 100644 compiled/ShaderResources/forward/forward_Instancing_Skinning_Texturing_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_Instancing_Skinning_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_Instancing_Texturing.json delete mode 100644 compiled/ShaderResources/forward/forward_Instancing_Texturing_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_Instancing_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_NormalMapping.json delete mode 100644 compiled/ShaderResources/forward/forward_NormalMapping_Skinning.json delete mode 100644 compiled/ShaderResources/forward/forward_NormalMapping_Skinning_Texturing.json delete mode 100644 compiled/ShaderResources/forward/forward_NormalMapping_Skinning_Texturing_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_NormalMapping_Skinning_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_NormalMapping_Texturing.json delete mode 100644 compiled/ShaderResources/forward/forward_NormalMapping_Texturing_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_NormalMapping_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_Skinning.json delete mode 100644 compiled/ShaderResources/forward/forward_Skinning_Texturing.json delete mode 100644 compiled/ShaderResources/forward/forward_Skinning_Texturing_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_Skinning_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_Texturing.json delete mode 100644 compiled/ShaderResources/forward/forward_Texturing_VCols.json delete mode 100644 compiled/ShaderResources/forward/forward_VCols.json delete mode 100644 compiled/Shaders/env_map/env_map.frag.glsl delete mode 100644 compiled/Shaders/env_map/env_map.vert.glsl delete mode 100644 compiled/Shaders/forward/forward.frag.glsl delete mode 100644 compiled/Shaders/forward/forward.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning_Texturing.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning_Texturing.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning_Texturing_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning_Texturing_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Texturing.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Texturing.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Texturing_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Texturing_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_Skinning.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_Skinning.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_Skinning_Texturing.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_Skinning_Texturing.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_Skinning_Texturing_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_Skinning_Texturing_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_Skinning_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_Skinning_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_Texturing.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_Texturing.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_Texturing_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_Texturing_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_Skinning.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_Skinning.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_Skinning_Texturing.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_Skinning_Texturing.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_Skinning_Texturing_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_Skinning_Texturing_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_Skinning_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_Skinning_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_Texturing.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_Texturing.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_Texturing_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_Texturing_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_Skinning.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_Skinning.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_Skinning_Texturing.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_Skinning_Texturing.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_Skinning_Texturing_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_Skinning_Texturing_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_Skinning_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_Skinning_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_Texturing.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_Texturing.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_Texturing_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_Texturing_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Billboard_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Instancing.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Instancing.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_Skinning.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_Skinning.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_Skinning_Texturing.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_Skinning_Texturing.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_Skinning_Texturing_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_Skinning_Texturing_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_Skinning_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_Skinning_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_Texturing.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_Texturing.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_Texturing_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_Texturing_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Instancing_Skinning.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Instancing_Skinning.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Instancing_Skinning_Texturing.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Instancing_Skinning_Texturing.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Instancing_Skinning_Texturing_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Instancing_Skinning_Texturing_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Instancing_Skinning_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Instancing_Skinning_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Instancing_Texturing.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Instancing_Texturing.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Instancing_Texturing_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Instancing_Texturing_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Instancing_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Instancing_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_NormalMapping.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_NormalMapping.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_NormalMapping_Skinning.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_NormalMapping_Skinning.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_NormalMapping_Skinning_Texturing.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_NormalMapping_Skinning_Texturing.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_NormalMapping_Skinning_Texturing_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_NormalMapping_Skinning_Texturing_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_NormalMapping_Skinning_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_NormalMapping_Skinning_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_NormalMapping_Texturing.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_NormalMapping_Texturing.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_NormalMapping_Texturing_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_NormalMapping_Texturing_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_NormalMapping_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_NormalMapping_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Skinning.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Skinning.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Skinning_Texturing.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Skinning_Texturing.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Skinning_Texturing_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Skinning_Texturing_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Skinning_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Skinning_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Texturing.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Texturing.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Texturing_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_Texturing_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_AlphaTest_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_Instancing.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_Instancing.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_Skinning.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_Skinning.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_Skinning_Texturing.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_Skinning_Texturing.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_Skinning_Texturing_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_Skinning_Texturing_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_Skinning_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_Skinning_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_Texturing.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_Texturing.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_Texturing_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_Texturing_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_Instancing_Skinning.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_Instancing_Skinning.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_Instancing_Skinning_Texturing.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_Instancing_Skinning_Texturing.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_Instancing_Skinning_Texturing_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_Instancing_Skinning_Texturing_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_Instancing_Skinning_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_Instancing_Skinning_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_Instancing_Texturing.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_Instancing_Texturing.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_Instancing_Texturing_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_Instancing_Texturing_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_Instancing_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_Instancing_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_NormalMapping.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_NormalMapping.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_NormalMapping_Skinning.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_NormalMapping_Skinning.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_NormalMapping_Skinning_Texturing.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_NormalMapping_Skinning_Texturing.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_NormalMapping_Skinning_Texturing_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_NormalMapping_Skinning_Texturing_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_NormalMapping_Skinning_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_NormalMapping_Skinning_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_NormalMapping_Texturing.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_NormalMapping_Texturing.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_NormalMapping_Texturing_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_NormalMapping_Texturing_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_NormalMapping_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_NormalMapping_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_Skinning.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_Skinning.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_Skinning_Texturing.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_Skinning_Texturing.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_Skinning_Texturing_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_Skinning_Texturing_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_Skinning_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_Skinning_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_Texturing.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_Texturing.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_Texturing_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_Texturing_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Billboard_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Instancing.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Instancing.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Instancing_NormalMapping.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Instancing_NormalMapping.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Instancing_NormalMapping_Skinning.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Instancing_NormalMapping_Skinning.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Instancing_NormalMapping_Skinning_Texturing.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Instancing_NormalMapping_Skinning_Texturing.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Instancing_NormalMapping_Skinning_Texturing_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Instancing_NormalMapping_Skinning_Texturing_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Instancing_NormalMapping_Skinning_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Instancing_NormalMapping_Skinning_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Instancing_NormalMapping_Texturing.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Instancing_NormalMapping_Texturing.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Instancing_NormalMapping_Texturing_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Instancing_NormalMapping_Texturing_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Instancing_NormalMapping_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Instancing_NormalMapping_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Instancing_Skinning.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Instancing_Skinning.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Instancing_Skinning_Texturing.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Instancing_Skinning_Texturing.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Instancing_Skinning_Texturing_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Instancing_Skinning_Texturing_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Instancing_Skinning_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Instancing_Skinning_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Instancing_Texturing.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Instancing_Texturing.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Instancing_Texturing_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Instancing_Texturing_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Instancing_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Instancing_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_NormalMapping.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_NormalMapping.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_NormalMapping_Skinning.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_NormalMapping_Skinning.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_NormalMapping_Skinning_Texturing.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_NormalMapping_Skinning_Texturing.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_NormalMapping_Skinning_Texturing_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_NormalMapping_Skinning_Texturing_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_NormalMapping_Skinning_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_NormalMapping_Skinning_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_NormalMapping_Texturing.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_NormalMapping_Texturing.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_NormalMapping_Texturing_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_NormalMapping_Texturing_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_NormalMapping_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_NormalMapping_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Skinning.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Skinning.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Skinning_Texturing.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Skinning_Texturing.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Skinning_Texturing_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Skinning_Texturing_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Skinning_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Skinning_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Texturing.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Texturing.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_Texturing_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_Texturing_VCols.vert.glsl delete mode 100644 compiled/Shaders/forward/forward_VCols.frag.glsl delete mode 100644 compiled/Shaders/forward/forward_VCols.vert.glsl delete mode 100755 raw/forward/forward.shader_withshadow.json rename raw/forward/{shadow_map.frag.glsl => shadowmap.frag.glsl} (100%) rename raw/forward/{shadow_map.vert.glsl => shadowmap.vert.glsl} (79%) rename {Assets => raw}/pipeline_resource.json (100%) diff --git a/compiled/ShaderResources/env_map/env_map.json b/Assets/env_map.json similarity index 100% rename from compiled/ShaderResources/env_map/env_map.json rename to Assets/env_map.json diff --git a/Assets/material_resource.json b/Assets/material_resource.json index 66a56c63..a22fb838 100644 --- a/Assets/material_resource.json +++ b/Assets/material_resource.json @@ -2,7 +2,7 @@ "material_resources": [ { "id": "material1", - "shader": "env_map_resource/env_map", + "shader": "env_map/env_map", "cast_shadow": true, "contexts": [ { diff --git a/Sources/Shaders/env_map.frag.glsl b/Sources/Shaders/env_map.frag.glsl index 44730b75..d669e9ee 100644 --- a/Sources/Shaders/env_map.frag.glsl +++ b/Sources/Shaders/env_map.frag.glsl @@ -1,3 +1,5 @@ +#version 450 + #ifdef GL_ES precision mediump float; #endif @@ -7,16 +9,15 @@ precision mediump float; uniform sampler2D envmap; -varying vec3 wcNormal; +in vec3 normal; -vec2 envMapEquirect(vec3 wcNormal, float flipEnvMap) { - float phi = acos(wcNormal.z); - float theta = atan(flipEnvMap * wcNormal.x, wcNormal.y) + PI; - return vec2(theta / TwoPI, phi / PI); +vec2 envMapEquirect(vec3 normal) { + float phi = acos(normal.z); + float theta = atan(normal.x, normal.y) + PI; + return vec2(theta / TwoPI, phi / PI); } void main() { - - vec3 N = normalize(wcNormal); - gl_FragColor = texture2D(envmap, envMapEquirect(N, -1.0)); + vec3 n = normalize(normal); + gl_FragColor = texture(envmap, envMapEquirect(n)); } diff --git a/Sources/Shaders/env_map.vert.glsl b/Sources/Shaders/env_map.vert.glsl index 6a24562c..51fe19d8 100644 --- a/Sources/Shaders/env_map.vert.glsl +++ b/Sources/Shaders/env_map.vert.glsl @@ -1,3 +1,5 @@ +#version 450 + #ifdef GL_ES precision highp float; #endif @@ -5,11 +7,17 @@ precision highp float; uniform mat4 V; uniform mat4 P; -attribute vec2 pos; +in vec2 pos; -varying vec3 wcNormal; +out vec3 normal; -mat4 inverse(mat4 m) { +mat3 transpose_(mat3 m) { + return mat3(m[0][0], m[1][0], m[2][0], + m[0][1], m[1][1], m[2][1], + m[0][2], m[1][2], m[2][2]); +} + +mat4 inverse_(mat4 m) { float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3], a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3], @@ -50,22 +58,15 @@ mat4 inverse(mat4 m) { a20 * b03 - a21 * b01 + a22 * b00) / det; } -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} - void main() { - mat4 invP = inverse(P); - mat3 invMV = transpose(mat3(V)); + mat4 invP = inverse_(P); + mat3 invMV = transpose_(mat3(V)); vec4 p = vec4(pos.xy, 0.0, 1.0); - vec3 unprojected = (invP * p).xyz; - wcNormal = invMV * unprojected; + normal = invMV * unprojected; gl_Position = vec4(pos.xy, 0.0, 1.0); } diff --git a/blender/armory.py b/blender/armory.py index 437e85ff..4fa4ba52 100644 --- a/blender/armory.py +++ b/blender/armory.py @@ -2003,7 +2003,7 @@ class ArmoryExporter(bpy.types.Operator, ExportHelper): if t.enabled_prop == False: continue x = Object() - if t.type_prop == 'Nodes': + if t.type_prop == 'Nodes' and t.nodes_name_prop != '': x.type = 'Script' x.class_name = t.nodes_name_prop.replace('.', '_') elif t.type_prop == 'Scene Instance': @@ -2109,6 +2109,16 @@ class ArmoryExporter(bpy.types.Operator, ExportHelper): c.bind_constants.append(const) c.bind_textures = [] + + tex = Object() # TODO: parse from world nodes + tex.id = 'senvmap' + tex.name = 'envmap_irradiance' + c.bind_textures.append(tex) + + tex = Object() # TODO: parse from world nodes + tex.id = 'senvmaplod' + tex.name = 'envmap_lod1' + c.bind_textures.append(tex) # Parse nodes out_node = None diff --git a/blender/nodes_logic.py b/blender/nodes_logic.py index d28e1f93..4bc9ec92 100755 --- a/blender/nodes_logic.py +++ b/blender/nodes_logic.py @@ -226,8 +226,9 @@ def buildNodeTrees(): os.chdir(fp) # Make sure package dir exists - if not os.path.exists('Sources/' + bpy.data.worlds[0].CGProjectPackage.replace(".", "/")): - os.makedirs('Sources/' + bpy.data.worlds[0].CGProjectPackage.replace(".", "/")) + nodes_path = 'Sources/' + bpy.data.worlds[0].CGProjectPackage.replace(".", "/") + "/node" + if not os.path.exists(nodes_path): + os.makedirs(nodes_path) # Export node scripts for node_group in bpy.data.node_groups: @@ -237,12 +238,12 @@ def buildNodeTrees(): def buildNodeTree(node_group): rn = getRootNode(node_group) - path = 'Sources/' + bpy.data.worlds[0].CGProjectPackage.replace(".", "/") + "/" + path = 'Sources/' + bpy.data.worlds[0].CGProjectPackage.replace(".", "/") + "/node/" node_group_name = node_group.name.replace('.', '_') with open(path + node_group_name + '.hx', 'w') as f: - f.write('package ' + bpy.data.worlds[0].CGProjectPackage + ';\n\n') + f.write('package ' + bpy.data.worlds[0].CGProjectPackage + '.node;\n\n') f.write('import cycles.node.*;\n\n') f.write('class ' + node_group_name + ' extends cycles.trait.NodeExecutor {\n\n') f.write('\tpublic function new() { super(); requestAdd(add); }\n\n') diff --git a/blender/nodes_pipeline.py b/blender/nodes_pipeline.py index eafbd882..d48e2648 100755 --- a/blender/nodes_pipeline.py +++ b/blender/nodes_pipeline.py @@ -331,6 +331,7 @@ def buildNode(res, node, node_group): if targetNode.bl_idname == 'TargetNodeType': targetId = targetNode.inputs[0].default_value stage.params.append(targetId) + stage.params.append(node.inputs[2].default_value) elif node.bl_idname == 'DrawQuadNodeType': stage.command = 'draw_quad' diff --git a/blender/project.py b/blender/project.py index cdade409..9488cd52 100755 --- a/blender/project.py +++ b/blender/project.py @@ -226,10 +226,9 @@ def cleanProject(self): shutil.rmtree('Assets/generated') # Remove compiled nodes - path = 'Sources/' + bpy.data.worlds[0].CGProjectPackage.replace(".", "/") + "/" - for node_group in bpy.data.node_groups: - node_group_name = node_group.name.replace('.', '_') - os.remove(path + node_group_name + '.hx') + nodes_path = "Sources/" + bpy.data.worlds[0].CGProjectPackage.replace(".", "/") + "/node/" + if os.path.isdir(nodes_path): + shutil.rmtree(nodes_path) self.report({'INFO'}, "Done") diff --git a/blender/write_data.py b/blender/write_data.py index 6776a699..09ba56e2 100644 --- a/blender/write_data.py +++ b/blender/write_data.py @@ -23,9 +23,16 @@ project.addAssets('Libraries/cyclesgame/Assets/**'); for ref in shader_references: # ArmoryExporter.pipeline_pass instead of split base_name = ref.split('_', 1)[0] + "/" - f.write("project.addAssets('Libraries/cyclesgame/compiled/ShaderResources/" + base_name + "" + ref + ".json');\n") - f.write("project.addShaders('Libraries/cyclesgame/compiled/Shaders/" + base_name + "" + ref + ".frag.glsl');\n") - f.write("project.addShaders('Libraries/cyclesgame/compiled/Shaders/" + base_name + "" + ref + ".vert.glsl');\n") + f.write("project.addAssets('compiled/ShaderResources/" + base_name + "" + ref + ".json');\n") + f.write("project.addShaders('compiled/Shaders/" + base_name + "" + ref + ".frag.glsl');\n") + f.write("project.addShaders('compiled/Shaders/" + base_name + "" + ref + ".vert.glsl');\n") + # TODO: properly include all shader contexts + defsarr = ref.split('_', 1) # Get shader defs and append to shadowmap shader name + defs = '' + if len(defsarr) > 1: + defs = '_' + defsarr[1] + f.write("project.addShaders('compiled/Shaders/" + base_name + "" + 'shadowmap' + defs + ".frag.glsl');\n") + f.write("project.addShaders('compiled/Shaders/" + base_name + "" + 'shadowmap' + defs + ".vert.glsl');\n") if bpy.data.worlds[0]['CGPhysics'] != 0: f.write("\nproject.addDefine('WITH_PHYSICS')\n") diff --git a/compiled/ShaderResources/forward/forward.json b/compiled/ShaderResources/forward/forward.json deleted file mode 100644 index b0aa50b8..00000000 --- a/compiled/ShaderResources/forward/forward.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward.vert" - } - ], - "id": "forward", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest.json b/compiled/ShaderResources/forward/forward_AlphaTest.json deleted file mode 100644 index 9372f591..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_AlphaTest.vert" - } - ], - "id": "forward_AlphaTest", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard.json b/compiled/ShaderResources/forward/forward_AlphaTest_Billboard.json deleted file mode 100644 index cd689d39..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Billboard.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_AlphaTest_Billboard.vert" - } - ], - "id": "forward_AlphaTest_Billboard", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing.json b/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing.json deleted file mode 100644 index 8c182457..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Billboard_Instancing.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_AlphaTest_Billboard_Instancing.vert" - } - ], - "id": "forward_AlphaTest_Billboard_Instancing", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping.json b/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping.json deleted file mode 100644 index 57853127..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Billboard_Instancing_NormalMapping.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_AlphaTest_Billboard_Instancing_NormalMapping.vert" - } - ], - "id": "forward_AlphaTest_Billboard_Instancing_NormalMapping", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tan", - "size": 3 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning.json b/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning.json deleted file mode 100644 index 0b2f1ccc..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning.json +++ /dev/null @@ -1,111 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning.vert" - } - ], - "id": "forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tan", - "size": 3 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning_Texturing.json b/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning_Texturing.json deleted file mode 100644 index 53a219db..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning_Texturing.json +++ /dev/null @@ -1,118 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning_Texturing.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning_Texturing.vert" - } - ], - "id": "forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning_Texturing", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "tan", - "size": 3 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning_Texturing_VCols.json b/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning_Texturing_VCols.json deleted file mode 100644 index cdf90507..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning_Texturing_VCols.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning_Texturing_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning_Texturing_VCols.vert" - } - ], - "id": "forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning_Texturing_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "col", - "size": 4 - }, - { - "name": "tan", - "size": 3 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning_VCols.json b/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning_VCols.json deleted file mode 100644 index 9b2aed07..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning_VCols.json +++ /dev/null @@ -1,115 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning_VCols.vert" - } - ], - "id": "forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "col", - "size": 4 - }, - { - "name": "tan", - "size": 3 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Texturing.json b/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Texturing.json deleted file mode 100644 index 5e4a8af5..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Texturing.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Billboard_Instancing_NormalMapping_Texturing.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_AlphaTest_Billboard_Instancing_NormalMapping_Texturing.vert" - } - ], - "id": "forward_AlphaTest_Billboard_Instancing_NormalMapping_Texturing", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "tan", - "size": 3 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Texturing_VCols.json b/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Texturing_VCols.json deleted file mode 100644 index 99138473..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Texturing_VCols.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Billboard_Instancing_NormalMapping_Texturing_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_AlphaTest_Billboard_Instancing_NormalMapping_Texturing_VCols.vert" - } - ], - "id": "forward_AlphaTest_Billboard_Instancing_NormalMapping_Texturing_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "col", - "size": 4 - }, - { - "name": "tan", - "size": 3 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_VCols.json b/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_VCols.json deleted file mode 100644 index b2dc1f7e..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_VCols.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Billboard_Instancing_NormalMapping_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_AlphaTest_Billboard_Instancing_NormalMapping_VCols.vert" - } - ], - "id": "forward_AlphaTest_Billboard_Instancing_NormalMapping_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "col", - "size": 4 - }, - { - "name": "tan", - "size": 3 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_Skinning.json b/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_Skinning.json deleted file mode 100644 index 6fc69721..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_Skinning.json +++ /dev/null @@ -1,104 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Billboard_Instancing_Skinning.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_AlphaTest_Billboard_Instancing_Skinning.vert" - } - ], - "id": "forward_AlphaTest_Billboard_Instancing_Skinning", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_Skinning_Texturing.json b/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_Skinning_Texturing.json deleted file mode 100644 index 1f3264a6..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_Skinning_Texturing.json +++ /dev/null @@ -1,111 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Billboard_Instancing_Skinning_Texturing.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_AlphaTest_Billboard_Instancing_Skinning_Texturing.vert" - } - ], - "id": "forward_AlphaTest_Billboard_Instancing_Skinning_Texturing", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_Skinning_Texturing_VCols.json b/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_Skinning_Texturing_VCols.json deleted file mode 100644 index 1b3ddac6..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_Skinning_Texturing_VCols.json +++ /dev/null @@ -1,115 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Billboard_Instancing_Skinning_Texturing_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_AlphaTest_Billboard_Instancing_Skinning_Texturing_VCols.vert" - } - ], - "id": "forward_AlphaTest_Billboard_Instancing_Skinning_Texturing_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "col", - "size": 4 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_Skinning_VCols.json b/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_Skinning_VCols.json deleted file mode 100644 index 92ba8526..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_Skinning_VCols.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Billboard_Instancing_Skinning_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_AlphaTest_Billboard_Instancing_Skinning_VCols.vert" - } - ], - "id": "forward_AlphaTest_Billboard_Instancing_Skinning_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "col", - "size": 4 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_Texturing.json b/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_Texturing.json deleted file mode 100644 index c077f9c8..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_Texturing.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Billboard_Instancing_Texturing.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_AlphaTest_Billboard_Instancing_Texturing.vert" - } - ], - "id": "forward_AlphaTest_Billboard_Instancing_Texturing", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_Texturing_VCols.json b/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_Texturing_VCols.json deleted file mode 100644 index fa70cbce..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_Texturing_VCols.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Billboard_Instancing_Texturing_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_AlphaTest_Billboard_Instancing_Texturing_VCols.vert" - } - ], - "id": "forward_AlphaTest_Billboard_Instancing_Texturing_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "col", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_VCols.json b/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_VCols.json deleted file mode 100644 index 1f5a37b6..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Instancing_VCols.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Billboard_Instancing_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_AlphaTest_Billboard_Instancing_VCols.vert" - } - ], - "id": "forward_AlphaTest_Billboard_Instancing_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "col", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_NormalMapping.json b/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_NormalMapping.json deleted file mode 100644 index aca66368..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_NormalMapping.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Billboard_NormalMapping.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_AlphaTest_Billboard_NormalMapping.vert" - } - ], - "id": "forward_AlphaTest_Billboard_NormalMapping", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tan", - "size": 3 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_NormalMapping_Skinning.json b/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_NormalMapping_Skinning.json deleted file mode 100644 index da5b536d..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_NormalMapping_Skinning.json +++ /dev/null @@ -1,111 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Billboard_NormalMapping_Skinning.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_AlphaTest_Billboard_NormalMapping_Skinning.vert" - } - ], - "id": "forward_AlphaTest_Billboard_NormalMapping_Skinning", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tan", - "size": 3 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_NormalMapping_Skinning_Texturing.json b/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_NormalMapping_Skinning_Texturing.json deleted file mode 100644 index 8efe6820..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_NormalMapping_Skinning_Texturing.json +++ /dev/null @@ -1,118 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Billboard_NormalMapping_Skinning_Texturing.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_AlphaTest_Billboard_NormalMapping_Skinning_Texturing.vert" - } - ], - "id": "forward_AlphaTest_Billboard_NormalMapping_Skinning_Texturing", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "tan", - "size": 3 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_NormalMapping_Skinning_Texturing_VCols.json b/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_NormalMapping_Skinning_Texturing_VCols.json deleted file mode 100644 index 1b6ac43c..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_NormalMapping_Skinning_Texturing_VCols.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Billboard_NormalMapping_Skinning_Texturing_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_AlphaTest_Billboard_NormalMapping_Skinning_Texturing_VCols.vert" - } - ], - "id": "forward_AlphaTest_Billboard_NormalMapping_Skinning_Texturing_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "col", - "size": 4 - }, - { - "name": "tan", - "size": 3 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_NormalMapping_Skinning_VCols.json b/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_NormalMapping_Skinning_VCols.json deleted file mode 100644 index 017a255f..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_NormalMapping_Skinning_VCols.json +++ /dev/null @@ -1,115 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Billboard_NormalMapping_Skinning_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_AlphaTest_Billboard_NormalMapping_Skinning_VCols.vert" - } - ], - "id": "forward_AlphaTest_Billboard_NormalMapping_Skinning_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "col", - "size": 4 - }, - { - "name": "tan", - "size": 3 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_NormalMapping_Texturing.json b/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_NormalMapping_Texturing.json deleted file mode 100644 index f263a021..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_NormalMapping_Texturing.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Billboard_NormalMapping_Texturing.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_AlphaTest_Billboard_NormalMapping_Texturing.vert" - } - ], - "id": "forward_AlphaTest_Billboard_NormalMapping_Texturing", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "tan", - "size": 3 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_NormalMapping_Texturing_VCols.json b/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_NormalMapping_Texturing_VCols.json deleted file mode 100644 index 71d979b8..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_NormalMapping_Texturing_VCols.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Billboard_NormalMapping_Texturing_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_AlphaTest_Billboard_NormalMapping_Texturing_VCols.vert" - } - ], - "id": "forward_AlphaTest_Billboard_NormalMapping_Texturing_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "col", - "size": 4 - }, - { - "name": "tan", - "size": 3 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_NormalMapping_VCols.json b/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_NormalMapping_VCols.json deleted file mode 100644 index 7c88f572..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_NormalMapping_VCols.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Billboard_NormalMapping_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_AlphaTest_Billboard_NormalMapping_VCols.vert" - } - ], - "id": "forward_AlphaTest_Billboard_NormalMapping_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "col", - "size": 4 - }, - { - "name": "tan", - "size": 3 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Skinning.json b/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Skinning.json deleted file mode 100644 index 6558aac3..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Skinning.json +++ /dev/null @@ -1,104 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Billboard_Skinning.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_AlphaTest_Billboard_Skinning.vert" - } - ], - "id": "forward_AlphaTest_Billboard_Skinning", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Skinning_Texturing.json b/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Skinning_Texturing.json deleted file mode 100644 index 67fb6f0b..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Skinning_Texturing.json +++ /dev/null @@ -1,111 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Billboard_Skinning_Texturing.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_AlphaTest_Billboard_Skinning_Texturing.vert" - } - ], - "id": "forward_AlphaTest_Billboard_Skinning_Texturing", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Skinning_Texturing_VCols.json b/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Skinning_Texturing_VCols.json deleted file mode 100644 index e966589b..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Skinning_Texturing_VCols.json +++ /dev/null @@ -1,115 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Billboard_Skinning_Texturing_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_AlphaTest_Billboard_Skinning_Texturing_VCols.vert" - } - ], - "id": "forward_AlphaTest_Billboard_Skinning_Texturing_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "col", - "size": 4 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Skinning_VCols.json b/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Skinning_VCols.json deleted file mode 100644 index 9dacda1d..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Skinning_VCols.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Billboard_Skinning_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_AlphaTest_Billboard_Skinning_VCols.vert" - } - ], - "id": "forward_AlphaTest_Billboard_Skinning_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "col", - "size": 4 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Texturing.json b/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Texturing.json deleted file mode 100644 index 6a471849..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Texturing.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Billboard_Texturing.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_AlphaTest_Billboard_Texturing.vert" - } - ], - "id": "forward_AlphaTest_Billboard_Texturing", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Texturing_VCols.json b/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Texturing_VCols.json deleted file mode 100644 index b33e4ed3..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_Texturing_VCols.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Billboard_Texturing_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_AlphaTest_Billboard_Texturing_VCols.vert" - } - ], - "id": "forward_AlphaTest_Billboard_Texturing_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "col", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_VCols.json b/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_VCols.json deleted file mode 100644 index a001826a..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Billboard_VCols.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Billboard_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_AlphaTest_Billboard_VCols.vert" - } - ], - "id": "forward_AlphaTest_Billboard_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "col", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Instancing.json b/compiled/ShaderResources/forward/forward_AlphaTest_Instancing.json deleted file mode 100644 index 3302a7ab..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Instancing.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Instancing.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_AlphaTest_Instancing.vert" - } - ], - "id": "forward_AlphaTest_Instancing", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Instancing_NormalMapping.json b/compiled/ShaderResources/forward/forward_AlphaTest_Instancing_NormalMapping.json deleted file mode 100644 index c5db7e0a..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Instancing_NormalMapping.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Instancing_NormalMapping.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_AlphaTest_Instancing_NormalMapping.vert" - } - ], - "id": "forward_AlphaTest_Instancing_NormalMapping", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tan", - "size": 3 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Instancing_NormalMapping_Skinning.json b/compiled/ShaderResources/forward/forward_AlphaTest_Instancing_NormalMapping_Skinning.json deleted file mode 100644 index 2de15daa..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Instancing_NormalMapping_Skinning.json +++ /dev/null @@ -1,111 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Instancing_NormalMapping_Skinning.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_AlphaTest_Instancing_NormalMapping_Skinning.vert" - } - ], - "id": "forward_AlphaTest_Instancing_NormalMapping_Skinning", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tan", - "size": 3 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Instancing_NormalMapping_Skinning_Texturing.json b/compiled/ShaderResources/forward/forward_AlphaTest_Instancing_NormalMapping_Skinning_Texturing.json deleted file mode 100644 index ae3e1bd7..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Instancing_NormalMapping_Skinning_Texturing.json +++ /dev/null @@ -1,118 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Instancing_NormalMapping_Skinning_Texturing.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_AlphaTest_Instancing_NormalMapping_Skinning_Texturing.vert" - } - ], - "id": "forward_AlphaTest_Instancing_NormalMapping_Skinning_Texturing", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "tan", - "size": 3 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Instancing_NormalMapping_Skinning_Texturing_VCols.json b/compiled/ShaderResources/forward/forward_AlphaTest_Instancing_NormalMapping_Skinning_Texturing_VCols.json deleted file mode 100644 index 36901b21..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Instancing_NormalMapping_Skinning_Texturing_VCols.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Instancing_NormalMapping_Skinning_Texturing_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_AlphaTest_Instancing_NormalMapping_Skinning_Texturing_VCols.vert" - } - ], - "id": "forward_AlphaTest_Instancing_NormalMapping_Skinning_Texturing_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "col", - "size": 4 - }, - { - "name": "tan", - "size": 3 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Instancing_NormalMapping_Skinning_VCols.json b/compiled/ShaderResources/forward/forward_AlphaTest_Instancing_NormalMapping_Skinning_VCols.json deleted file mode 100644 index efa5644a..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Instancing_NormalMapping_Skinning_VCols.json +++ /dev/null @@ -1,115 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Instancing_NormalMapping_Skinning_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_AlphaTest_Instancing_NormalMapping_Skinning_VCols.vert" - } - ], - "id": "forward_AlphaTest_Instancing_NormalMapping_Skinning_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "col", - "size": 4 - }, - { - "name": "tan", - "size": 3 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Instancing_NormalMapping_Texturing.json b/compiled/ShaderResources/forward/forward_AlphaTest_Instancing_NormalMapping_Texturing.json deleted file mode 100644 index 8dc52542..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Instancing_NormalMapping_Texturing.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Instancing_NormalMapping_Texturing.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_AlphaTest_Instancing_NormalMapping_Texturing.vert" - } - ], - "id": "forward_AlphaTest_Instancing_NormalMapping_Texturing", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "tan", - "size": 3 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Instancing_NormalMapping_Texturing_VCols.json b/compiled/ShaderResources/forward/forward_AlphaTest_Instancing_NormalMapping_Texturing_VCols.json deleted file mode 100644 index db0f4a88..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Instancing_NormalMapping_Texturing_VCols.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Instancing_NormalMapping_Texturing_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_AlphaTest_Instancing_NormalMapping_Texturing_VCols.vert" - } - ], - "id": "forward_AlphaTest_Instancing_NormalMapping_Texturing_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "col", - "size": 4 - }, - { - "name": "tan", - "size": 3 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Instancing_NormalMapping_VCols.json b/compiled/ShaderResources/forward/forward_AlphaTest_Instancing_NormalMapping_VCols.json deleted file mode 100644 index 8cf827fd..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Instancing_NormalMapping_VCols.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Instancing_NormalMapping_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_AlphaTest_Instancing_NormalMapping_VCols.vert" - } - ], - "id": "forward_AlphaTest_Instancing_NormalMapping_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "col", - "size": 4 - }, - { - "name": "tan", - "size": 3 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Instancing_Skinning.json b/compiled/ShaderResources/forward/forward_AlphaTest_Instancing_Skinning.json deleted file mode 100644 index 3d432a86..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Instancing_Skinning.json +++ /dev/null @@ -1,104 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Instancing_Skinning.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_AlphaTest_Instancing_Skinning.vert" - } - ], - "id": "forward_AlphaTest_Instancing_Skinning", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Instancing_Skinning_Texturing.json b/compiled/ShaderResources/forward/forward_AlphaTest_Instancing_Skinning_Texturing.json deleted file mode 100644 index b29ae1c7..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Instancing_Skinning_Texturing.json +++ /dev/null @@ -1,111 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Instancing_Skinning_Texturing.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_AlphaTest_Instancing_Skinning_Texturing.vert" - } - ], - "id": "forward_AlphaTest_Instancing_Skinning_Texturing", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Instancing_Skinning_Texturing_VCols.json b/compiled/ShaderResources/forward/forward_AlphaTest_Instancing_Skinning_Texturing_VCols.json deleted file mode 100644 index b7889269..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Instancing_Skinning_Texturing_VCols.json +++ /dev/null @@ -1,115 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Instancing_Skinning_Texturing_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_AlphaTest_Instancing_Skinning_Texturing_VCols.vert" - } - ], - "id": "forward_AlphaTest_Instancing_Skinning_Texturing_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "col", - "size": 4 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Instancing_Skinning_VCols.json b/compiled/ShaderResources/forward/forward_AlphaTest_Instancing_Skinning_VCols.json deleted file mode 100644 index 0cd93c78..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Instancing_Skinning_VCols.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Instancing_Skinning_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_AlphaTest_Instancing_Skinning_VCols.vert" - } - ], - "id": "forward_AlphaTest_Instancing_Skinning_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "col", - "size": 4 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Instancing_Texturing.json b/compiled/ShaderResources/forward/forward_AlphaTest_Instancing_Texturing.json deleted file mode 100644 index 99365d34..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Instancing_Texturing.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Instancing_Texturing.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_AlphaTest_Instancing_Texturing.vert" - } - ], - "id": "forward_AlphaTest_Instancing_Texturing", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Instancing_Texturing_VCols.json b/compiled/ShaderResources/forward/forward_AlphaTest_Instancing_Texturing_VCols.json deleted file mode 100644 index 5df0719a..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Instancing_Texturing_VCols.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Instancing_Texturing_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_AlphaTest_Instancing_Texturing_VCols.vert" - } - ], - "id": "forward_AlphaTest_Instancing_Texturing_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "col", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Instancing_VCols.json b/compiled/ShaderResources/forward/forward_AlphaTest_Instancing_VCols.json deleted file mode 100644 index f18e5655..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Instancing_VCols.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Instancing_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_AlphaTest_Instancing_VCols.vert" - } - ], - "id": "forward_AlphaTest_Instancing_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "col", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_NormalMapping.json b/compiled/ShaderResources/forward/forward_AlphaTest_NormalMapping.json deleted file mode 100644 index 5aa1bcbc..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_NormalMapping.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_NormalMapping.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_AlphaTest_NormalMapping.vert" - } - ], - "id": "forward_AlphaTest_NormalMapping", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tan", - "size": 3 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_NormalMapping_Skinning.json b/compiled/ShaderResources/forward/forward_AlphaTest_NormalMapping_Skinning.json deleted file mode 100644 index 04bc7356..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_NormalMapping_Skinning.json +++ /dev/null @@ -1,111 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_NormalMapping_Skinning.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_AlphaTest_NormalMapping_Skinning.vert" - } - ], - "id": "forward_AlphaTest_NormalMapping_Skinning", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tan", - "size": 3 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_NormalMapping_Skinning_Texturing.json b/compiled/ShaderResources/forward/forward_AlphaTest_NormalMapping_Skinning_Texturing.json deleted file mode 100644 index d7ce757d..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_NormalMapping_Skinning_Texturing.json +++ /dev/null @@ -1,118 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_NormalMapping_Skinning_Texturing.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_AlphaTest_NormalMapping_Skinning_Texturing.vert" - } - ], - "id": "forward_AlphaTest_NormalMapping_Skinning_Texturing", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "tan", - "size": 3 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_NormalMapping_Skinning_Texturing_VCols.json b/compiled/ShaderResources/forward/forward_AlphaTest_NormalMapping_Skinning_Texturing_VCols.json deleted file mode 100644 index 2f2051f3..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_NormalMapping_Skinning_Texturing_VCols.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_NormalMapping_Skinning_Texturing_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_AlphaTest_NormalMapping_Skinning_Texturing_VCols.vert" - } - ], - "id": "forward_AlphaTest_NormalMapping_Skinning_Texturing_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "col", - "size": 4 - }, - { - "name": "tan", - "size": 3 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_NormalMapping_Skinning_VCols.json b/compiled/ShaderResources/forward/forward_AlphaTest_NormalMapping_Skinning_VCols.json deleted file mode 100644 index 42cf3f19..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_NormalMapping_Skinning_VCols.json +++ /dev/null @@ -1,115 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_NormalMapping_Skinning_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_AlphaTest_NormalMapping_Skinning_VCols.vert" - } - ], - "id": "forward_AlphaTest_NormalMapping_Skinning_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "col", - "size": 4 - }, - { - "name": "tan", - "size": 3 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_NormalMapping_Texturing.json b/compiled/ShaderResources/forward/forward_AlphaTest_NormalMapping_Texturing.json deleted file mode 100644 index ec80759d..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_NormalMapping_Texturing.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_NormalMapping_Texturing.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_AlphaTest_NormalMapping_Texturing.vert" - } - ], - "id": "forward_AlphaTest_NormalMapping_Texturing", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "tan", - "size": 3 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_NormalMapping_Texturing_VCols.json b/compiled/ShaderResources/forward/forward_AlphaTest_NormalMapping_Texturing_VCols.json deleted file mode 100644 index 4c69e2e2..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_NormalMapping_Texturing_VCols.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_NormalMapping_Texturing_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_AlphaTest_NormalMapping_Texturing_VCols.vert" - } - ], - "id": "forward_AlphaTest_NormalMapping_Texturing_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "col", - "size": 4 - }, - { - "name": "tan", - "size": 3 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_NormalMapping_VCols.json b/compiled/ShaderResources/forward/forward_AlphaTest_NormalMapping_VCols.json deleted file mode 100644 index 923739b9..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_NormalMapping_VCols.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_NormalMapping_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_AlphaTest_NormalMapping_VCols.vert" - } - ], - "id": "forward_AlphaTest_NormalMapping_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "col", - "size": 4 - }, - { - "name": "tan", - "size": 3 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Skinning.json b/compiled/ShaderResources/forward/forward_AlphaTest_Skinning.json deleted file mode 100644 index b81f34f1..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Skinning.json +++ /dev/null @@ -1,104 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Skinning.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_AlphaTest_Skinning.vert" - } - ], - "id": "forward_AlphaTest_Skinning", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Skinning_Texturing.json b/compiled/ShaderResources/forward/forward_AlphaTest_Skinning_Texturing.json deleted file mode 100644 index a2c5cf5c..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Skinning_Texturing.json +++ /dev/null @@ -1,111 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Skinning_Texturing.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_AlphaTest_Skinning_Texturing.vert" - } - ], - "id": "forward_AlphaTest_Skinning_Texturing", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Skinning_Texturing_VCols.json b/compiled/ShaderResources/forward/forward_AlphaTest_Skinning_Texturing_VCols.json deleted file mode 100644 index 762374e7..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Skinning_Texturing_VCols.json +++ /dev/null @@ -1,115 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Skinning_Texturing_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_AlphaTest_Skinning_Texturing_VCols.vert" - } - ], - "id": "forward_AlphaTest_Skinning_Texturing_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "col", - "size": 4 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Skinning_VCols.json b/compiled/ShaderResources/forward/forward_AlphaTest_Skinning_VCols.json deleted file mode 100644 index 47e8a0c4..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Skinning_VCols.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Skinning_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_AlphaTest_Skinning_VCols.vert" - } - ], - "id": "forward_AlphaTest_Skinning_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "col", - "size": 4 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Texturing.json b/compiled/ShaderResources/forward/forward_AlphaTest_Texturing.json deleted file mode 100644 index 16761588..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Texturing.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Texturing.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_AlphaTest_Texturing.vert" - } - ], - "id": "forward_AlphaTest_Texturing", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_Texturing_VCols.json b/compiled/ShaderResources/forward/forward_AlphaTest_Texturing_VCols.json deleted file mode 100644 index c4dbba7f..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_Texturing_VCols.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_Texturing_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_AlphaTest_Texturing_VCols.vert" - } - ], - "id": "forward_AlphaTest_Texturing_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "col", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_AlphaTest_VCols.json b/compiled/ShaderResources/forward/forward_AlphaTest_VCols.json deleted file mode 100644 index 61f34f9c..00000000 --- a/compiled/ShaderResources/forward/forward_AlphaTest_VCols.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_AlphaTest_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_AlphaTest_VCols.vert" - } - ], - "id": "forward_AlphaTest_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "col", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Billboard.json b/compiled/ShaderResources/forward/forward_Billboard.json deleted file mode 100644 index 71c1961e..00000000 --- a/compiled/ShaderResources/forward/forward_Billboard.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Billboard.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_Billboard.vert" - } - ], - "id": "forward_Billboard", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Billboard_Instancing.json b/compiled/ShaderResources/forward/forward_Billboard_Instancing.json deleted file mode 100644 index 6127c421..00000000 --- a/compiled/ShaderResources/forward/forward_Billboard_Instancing.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Billboard_Instancing.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_Billboard_Instancing.vert" - } - ], - "id": "forward_Billboard_Instancing", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Billboard_Instancing_NormalMapping.json b/compiled/ShaderResources/forward/forward_Billboard_Instancing_NormalMapping.json deleted file mode 100644 index 3cadaad4..00000000 --- a/compiled/ShaderResources/forward/forward_Billboard_Instancing_NormalMapping.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Billboard_Instancing_NormalMapping.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_Billboard_Instancing_NormalMapping.vert" - } - ], - "id": "forward_Billboard_Instancing_NormalMapping", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tan", - "size": 3 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Billboard_Instancing_NormalMapping_Skinning.json b/compiled/ShaderResources/forward/forward_Billboard_Instancing_NormalMapping_Skinning.json deleted file mode 100644 index 395e00ab..00000000 --- a/compiled/ShaderResources/forward/forward_Billboard_Instancing_NormalMapping_Skinning.json +++ /dev/null @@ -1,111 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Billboard_Instancing_NormalMapping_Skinning.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_Billboard_Instancing_NormalMapping_Skinning.vert" - } - ], - "id": "forward_Billboard_Instancing_NormalMapping_Skinning", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tan", - "size": 3 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Billboard_Instancing_NormalMapping_Skinning_Texturing.json b/compiled/ShaderResources/forward/forward_Billboard_Instancing_NormalMapping_Skinning_Texturing.json deleted file mode 100644 index 10b5baea..00000000 --- a/compiled/ShaderResources/forward/forward_Billboard_Instancing_NormalMapping_Skinning_Texturing.json +++ /dev/null @@ -1,118 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Billboard_Instancing_NormalMapping_Skinning_Texturing.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_Billboard_Instancing_NormalMapping_Skinning_Texturing.vert" - } - ], - "id": "forward_Billboard_Instancing_NormalMapping_Skinning_Texturing", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "tan", - "size": 3 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Billboard_Instancing_NormalMapping_Skinning_Texturing_VCols.json b/compiled/ShaderResources/forward/forward_Billboard_Instancing_NormalMapping_Skinning_Texturing_VCols.json deleted file mode 100644 index a07f3459..00000000 --- a/compiled/ShaderResources/forward/forward_Billboard_Instancing_NormalMapping_Skinning_Texturing_VCols.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Billboard_Instancing_NormalMapping_Skinning_Texturing_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_Billboard_Instancing_NormalMapping_Skinning_Texturing_VCols.vert" - } - ], - "id": "forward_Billboard_Instancing_NormalMapping_Skinning_Texturing_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "col", - "size": 4 - }, - { - "name": "tan", - "size": 3 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Billboard_Instancing_NormalMapping_Skinning_VCols.json b/compiled/ShaderResources/forward/forward_Billboard_Instancing_NormalMapping_Skinning_VCols.json deleted file mode 100644 index 351e96e8..00000000 --- a/compiled/ShaderResources/forward/forward_Billboard_Instancing_NormalMapping_Skinning_VCols.json +++ /dev/null @@ -1,115 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Billboard_Instancing_NormalMapping_Skinning_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_Billboard_Instancing_NormalMapping_Skinning_VCols.vert" - } - ], - "id": "forward_Billboard_Instancing_NormalMapping_Skinning_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "col", - "size": 4 - }, - { - "name": "tan", - "size": 3 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Billboard_Instancing_NormalMapping_Texturing.json b/compiled/ShaderResources/forward/forward_Billboard_Instancing_NormalMapping_Texturing.json deleted file mode 100644 index 957d0d1b..00000000 --- a/compiled/ShaderResources/forward/forward_Billboard_Instancing_NormalMapping_Texturing.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Billboard_Instancing_NormalMapping_Texturing.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_Billboard_Instancing_NormalMapping_Texturing.vert" - } - ], - "id": "forward_Billboard_Instancing_NormalMapping_Texturing", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "tan", - "size": 3 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Billboard_Instancing_NormalMapping_Texturing_VCols.json b/compiled/ShaderResources/forward/forward_Billboard_Instancing_NormalMapping_Texturing_VCols.json deleted file mode 100644 index 120680dc..00000000 --- a/compiled/ShaderResources/forward/forward_Billboard_Instancing_NormalMapping_Texturing_VCols.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Billboard_Instancing_NormalMapping_Texturing_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_Billboard_Instancing_NormalMapping_Texturing_VCols.vert" - } - ], - "id": "forward_Billboard_Instancing_NormalMapping_Texturing_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "col", - "size": 4 - }, - { - "name": "tan", - "size": 3 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Billboard_Instancing_NormalMapping_VCols.json b/compiled/ShaderResources/forward/forward_Billboard_Instancing_NormalMapping_VCols.json deleted file mode 100644 index ad2b94b3..00000000 --- a/compiled/ShaderResources/forward/forward_Billboard_Instancing_NormalMapping_VCols.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Billboard_Instancing_NormalMapping_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_Billboard_Instancing_NormalMapping_VCols.vert" - } - ], - "id": "forward_Billboard_Instancing_NormalMapping_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "col", - "size": 4 - }, - { - "name": "tan", - "size": 3 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Billboard_Instancing_Skinning.json b/compiled/ShaderResources/forward/forward_Billboard_Instancing_Skinning.json deleted file mode 100644 index aee8116c..00000000 --- a/compiled/ShaderResources/forward/forward_Billboard_Instancing_Skinning.json +++ /dev/null @@ -1,104 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Billboard_Instancing_Skinning.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_Billboard_Instancing_Skinning.vert" - } - ], - "id": "forward_Billboard_Instancing_Skinning", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Billboard_Instancing_Skinning_Texturing.json b/compiled/ShaderResources/forward/forward_Billboard_Instancing_Skinning_Texturing.json deleted file mode 100644 index c3c6487a..00000000 --- a/compiled/ShaderResources/forward/forward_Billboard_Instancing_Skinning_Texturing.json +++ /dev/null @@ -1,111 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Billboard_Instancing_Skinning_Texturing.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_Billboard_Instancing_Skinning_Texturing.vert" - } - ], - "id": "forward_Billboard_Instancing_Skinning_Texturing", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Billboard_Instancing_Skinning_Texturing_VCols.json b/compiled/ShaderResources/forward/forward_Billboard_Instancing_Skinning_Texturing_VCols.json deleted file mode 100644 index 78bafea4..00000000 --- a/compiled/ShaderResources/forward/forward_Billboard_Instancing_Skinning_Texturing_VCols.json +++ /dev/null @@ -1,115 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Billboard_Instancing_Skinning_Texturing_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_Billboard_Instancing_Skinning_Texturing_VCols.vert" - } - ], - "id": "forward_Billboard_Instancing_Skinning_Texturing_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "col", - "size": 4 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Billboard_Instancing_Skinning_VCols.json b/compiled/ShaderResources/forward/forward_Billboard_Instancing_Skinning_VCols.json deleted file mode 100644 index c5b88c74..00000000 --- a/compiled/ShaderResources/forward/forward_Billboard_Instancing_Skinning_VCols.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Billboard_Instancing_Skinning_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_Billboard_Instancing_Skinning_VCols.vert" - } - ], - "id": "forward_Billboard_Instancing_Skinning_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "col", - "size": 4 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Billboard_Instancing_Texturing.json b/compiled/ShaderResources/forward/forward_Billboard_Instancing_Texturing.json deleted file mode 100644 index 59cbd452..00000000 --- a/compiled/ShaderResources/forward/forward_Billboard_Instancing_Texturing.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Billboard_Instancing_Texturing.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_Billboard_Instancing_Texturing.vert" - } - ], - "id": "forward_Billboard_Instancing_Texturing", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Billboard_Instancing_Texturing_VCols.json b/compiled/ShaderResources/forward/forward_Billboard_Instancing_Texturing_VCols.json deleted file mode 100644 index 35b1227f..00000000 --- a/compiled/ShaderResources/forward/forward_Billboard_Instancing_Texturing_VCols.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Billboard_Instancing_Texturing_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_Billboard_Instancing_Texturing_VCols.vert" - } - ], - "id": "forward_Billboard_Instancing_Texturing_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "col", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Billboard_Instancing_VCols.json b/compiled/ShaderResources/forward/forward_Billboard_Instancing_VCols.json deleted file mode 100644 index c922ec67..00000000 --- a/compiled/ShaderResources/forward/forward_Billboard_Instancing_VCols.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Billboard_Instancing_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_Billboard_Instancing_VCols.vert" - } - ], - "id": "forward_Billboard_Instancing_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "col", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Billboard_NormalMapping.json b/compiled/ShaderResources/forward/forward_Billboard_NormalMapping.json deleted file mode 100644 index 4fc0aa34..00000000 --- a/compiled/ShaderResources/forward/forward_Billboard_NormalMapping.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Billboard_NormalMapping.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_Billboard_NormalMapping.vert" - } - ], - "id": "forward_Billboard_NormalMapping", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tan", - "size": 3 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Billboard_NormalMapping_Skinning.json b/compiled/ShaderResources/forward/forward_Billboard_NormalMapping_Skinning.json deleted file mode 100644 index 30af08bb..00000000 --- a/compiled/ShaderResources/forward/forward_Billboard_NormalMapping_Skinning.json +++ /dev/null @@ -1,111 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Billboard_NormalMapping_Skinning.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_Billboard_NormalMapping_Skinning.vert" - } - ], - "id": "forward_Billboard_NormalMapping_Skinning", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tan", - "size": 3 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Billboard_NormalMapping_Skinning_Texturing.json b/compiled/ShaderResources/forward/forward_Billboard_NormalMapping_Skinning_Texturing.json deleted file mode 100644 index ecddf5ee..00000000 --- a/compiled/ShaderResources/forward/forward_Billboard_NormalMapping_Skinning_Texturing.json +++ /dev/null @@ -1,118 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Billboard_NormalMapping_Skinning_Texturing.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_Billboard_NormalMapping_Skinning_Texturing.vert" - } - ], - "id": "forward_Billboard_NormalMapping_Skinning_Texturing", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "tan", - "size": 3 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Billboard_NormalMapping_Skinning_Texturing_VCols.json b/compiled/ShaderResources/forward/forward_Billboard_NormalMapping_Skinning_Texturing_VCols.json deleted file mode 100644 index ca1bef9b..00000000 --- a/compiled/ShaderResources/forward/forward_Billboard_NormalMapping_Skinning_Texturing_VCols.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Billboard_NormalMapping_Skinning_Texturing_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_Billboard_NormalMapping_Skinning_Texturing_VCols.vert" - } - ], - "id": "forward_Billboard_NormalMapping_Skinning_Texturing_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "col", - "size": 4 - }, - { - "name": "tan", - "size": 3 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Billboard_NormalMapping_Skinning_VCols.json b/compiled/ShaderResources/forward/forward_Billboard_NormalMapping_Skinning_VCols.json deleted file mode 100644 index a1c2e5c1..00000000 --- a/compiled/ShaderResources/forward/forward_Billboard_NormalMapping_Skinning_VCols.json +++ /dev/null @@ -1,115 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Billboard_NormalMapping_Skinning_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_Billboard_NormalMapping_Skinning_VCols.vert" - } - ], - "id": "forward_Billboard_NormalMapping_Skinning_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "col", - "size": 4 - }, - { - "name": "tan", - "size": 3 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Billboard_NormalMapping_Texturing.json b/compiled/ShaderResources/forward/forward_Billboard_NormalMapping_Texturing.json deleted file mode 100644 index a77cdb55..00000000 --- a/compiled/ShaderResources/forward/forward_Billboard_NormalMapping_Texturing.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Billboard_NormalMapping_Texturing.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_Billboard_NormalMapping_Texturing.vert" - } - ], - "id": "forward_Billboard_NormalMapping_Texturing", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "tan", - "size": 3 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Billboard_NormalMapping_Texturing_VCols.json b/compiled/ShaderResources/forward/forward_Billboard_NormalMapping_Texturing_VCols.json deleted file mode 100644 index 0c7dc433..00000000 --- a/compiled/ShaderResources/forward/forward_Billboard_NormalMapping_Texturing_VCols.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Billboard_NormalMapping_Texturing_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_Billboard_NormalMapping_Texturing_VCols.vert" - } - ], - "id": "forward_Billboard_NormalMapping_Texturing_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "col", - "size": 4 - }, - { - "name": "tan", - "size": 3 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Billboard_NormalMapping_VCols.json b/compiled/ShaderResources/forward/forward_Billboard_NormalMapping_VCols.json deleted file mode 100644 index 19c3df70..00000000 --- a/compiled/ShaderResources/forward/forward_Billboard_NormalMapping_VCols.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Billboard_NormalMapping_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_Billboard_NormalMapping_VCols.vert" - } - ], - "id": "forward_Billboard_NormalMapping_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "col", - "size": 4 - }, - { - "name": "tan", - "size": 3 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Billboard_Skinning.json b/compiled/ShaderResources/forward/forward_Billboard_Skinning.json deleted file mode 100644 index 6cd3dcac..00000000 --- a/compiled/ShaderResources/forward/forward_Billboard_Skinning.json +++ /dev/null @@ -1,104 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Billboard_Skinning.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_Billboard_Skinning.vert" - } - ], - "id": "forward_Billboard_Skinning", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Billboard_Skinning_Texturing.json b/compiled/ShaderResources/forward/forward_Billboard_Skinning_Texturing.json deleted file mode 100644 index 25f05646..00000000 --- a/compiled/ShaderResources/forward/forward_Billboard_Skinning_Texturing.json +++ /dev/null @@ -1,111 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Billboard_Skinning_Texturing.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_Billboard_Skinning_Texturing.vert" - } - ], - "id": "forward_Billboard_Skinning_Texturing", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Billboard_Skinning_Texturing_VCols.json b/compiled/ShaderResources/forward/forward_Billboard_Skinning_Texturing_VCols.json deleted file mode 100644 index 1d7450cf..00000000 --- a/compiled/ShaderResources/forward/forward_Billboard_Skinning_Texturing_VCols.json +++ /dev/null @@ -1,115 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Billboard_Skinning_Texturing_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_Billboard_Skinning_Texturing_VCols.vert" - } - ], - "id": "forward_Billboard_Skinning_Texturing_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "col", - "size": 4 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Billboard_Skinning_VCols.json b/compiled/ShaderResources/forward/forward_Billboard_Skinning_VCols.json deleted file mode 100644 index caab6d3a..00000000 --- a/compiled/ShaderResources/forward/forward_Billboard_Skinning_VCols.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Billboard_Skinning_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_Billboard_Skinning_VCols.vert" - } - ], - "id": "forward_Billboard_Skinning_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "col", - "size": 4 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Billboard_Texturing.json b/compiled/ShaderResources/forward/forward_Billboard_Texturing.json deleted file mode 100644 index 9dce4fb8..00000000 --- a/compiled/ShaderResources/forward/forward_Billboard_Texturing.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Billboard_Texturing.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_Billboard_Texturing.vert" - } - ], - "id": "forward_Billboard_Texturing", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Billboard_Texturing_VCols.json b/compiled/ShaderResources/forward/forward_Billboard_Texturing_VCols.json deleted file mode 100644 index cf799cf7..00000000 --- a/compiled/ShaderResources/forward/forward_Billboard_Texturing_VCols.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Billboard_Texturing_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_Billboard_Texturing_VCols.vert" - } - ], - "id": "forward_Billboard_Texturing_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "col", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Billboard_VCols.json b/compiled/ShaderResources/forward/forward_Billboard_VCols.json deleted file mode 100644 index b13d0e5a..00000000 --- a/compiled/ShaderResources/forward/forward_Billboard_VCols.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Billboard_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_Billboard_VCols.vert" - } - ], - "id": "forward_Billboard_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "col", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Instancing.json b/compiled/ShaderResources/forward/forward_Instancing.json deleted file mode 100644 index df5ad028..00000000 --- a/compiled/ShaderResources/forward/forward_Instancing.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Instancing.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_Instancing.vert" - } - ], - "id": "forward_Instancing", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Instancing_NormalMapping.json b/compiled/ShaderResources/forward/forward_Instancing_NormalMapping.json deleted file mode 100644 index 2a70fc54..00000000 --- a/compiled/ShaderResources/forward/forward_Instancing_NormalMapping.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Instancing_NormalMapping.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_Instancing_NormalMapping.vert" - } - ], - "id": "forward_Instancing_NormalMapping", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tan", - "size": 3 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Instancing_NormalMapping_Skinning.json b/compiled/ShaderResources/forward/forward_Instancing_NormalMapping_Skinning.json deleted file mode 100644 index beea2300..00000000 --- a/compiled/ShaderResources/forward/forward_Instancing_NormalMapping_Skinning.json +++ /dev/null @@ -1,111 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Instancing_NormalMapping_Skinning.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_Instancing_NormalMapping_Skinning.vert" - } - ], - "id": "forward_Instancing_NormalMapping_Skinning", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tan", - "size": 3 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Instancing_NormalMapping_Skinning_Texturing.json b/compiled/ShaderResources/forward/forward_Instancing_NormalMapping_Skinning_Texturing.json deleted file mode 100644 index 665eea69..00000000 --- a/compiled/ShaderResources/forward/forward_Instancing_NormalMapping_Skinning_Texturing.json +++ /dev/null @@ -1,118 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Instancing_NormalMapping_Skinning_Texturing.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_Instancing_NormalMapping_Skinning_Texturing.vert" - } - ], - "id": "forward_Instancing_NormalMapping_Skinning_Texturing", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "tan", - "size": 3 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Instancing_NormalMapping_Skinning_Texturing_VCols.json b/compiled/ShaderResources/forward/forward_Instancing_NormalMapping_Skinning_Texturing_VCols.json deleted file mode 100644 index 191aeb04..00000000 --- a/compiled/ShaderResources/forward/forward_Instancing_NormalMapping_Skinning_Texturing_VCols.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Instancing_NormalMapping_Skinning_Texturing_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_Instancing_NormalMapping_Skinning_Texturing_VCols.vert" - } - ], - "id": "forward_Instancing_NormalMapping_Skinning_Texturing_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "col", - "size": 4 - }, - { - "name": "tan", - "size": 3 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Instancing_NormalMapping_Skinning_VCols.json b/compiled/ShaderResources/forward/forward_Instancing_NormalMapping_Skinning_VCols.json deleted file mode 100644 index 7babe24f..00000000 --- a/compiled/ShaderResources/forward/forward_Instancing_NormalMapping_Skinning_VCols.json +++ /dev/null @@ -1,115 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Instancing_NormalMapping_Skinning_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_Instancing_NormalMapping_Skinning_VCols.vert" - } - ], - "id": "forward_Instancing_NormalMapping_Skinning_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "col", - "size": 4 - }, - { - "name": "tan", - "size": 3 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Instancing_NormalMapping_Texturing.json b/compiled/ShaderResources/forward/forward_Instancing_NormalMapping_Texturing.json deleted file mode 100644 index 7607b9ff..00000000 --- a/compiled/ShaderResources/forward/forward_Instancing_NormalMapping_Texturing.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Instancing_NormalMapping_Texturing.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_Instancing_NormalMapping_Texturing.vert" - } - ], - "id": "forward_Instancing_NormalMapping_Texturing", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "tan", - "size": 3 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Instancing_NormalMapping_Texturing_VCols.json b/compiled/ShaderResources/forward/forward_Instancing_NormalMapping_Texturing_VCols.json deleted file mode 100644 index 56ef7502..00000000 --- a/compiled/ShaderResources/forward/forward_Instancing_NormalMapping_Texturing_VCols.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Instancing_NormalMapping_Texturing_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_Instancing_NormalMapping_Texturing_VCols.vert" - } - ], - "id": "forward_Instancing_NormalMapping_Texturing_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "col", - "size": 4 - }, - { - "name": "tan", - "size": 3 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Instancing_NormalMapping_VCols.json b/compiled/ShaderResources/forward/forward_Instancing_NormalMapping_VCols.json deleted file mode 100644 index a8f394af..00000000 --- a/compiled/ShaderResources/forward/forward_Instancing_NormalMapping_VCols.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Instancing_NormalMapping_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_Instancing_NormalMapping_VCols.vert" - } - ], - "id": "forward_Instancing_NormalMapping_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "col", - "size": 4 - }, - { - "name": "tan", - "size": 3 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Instancing_Skinning.json b/compiled/ShaderResources/forward/forward_Instancing_Skinning.json deleted file mode 100644 index 5efed5af..00000000 --- a/compiled/ShaderResources/forward/forward_Instancing_Skinning.json +++ /dev/null @@ -1,104 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Instancing_Skinning.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_Instancing_Skinning.vert" - } - ], - "id": "forward_Instancing_Skinning", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Instancing_Skinning_Texturing.json b/compiled/ShaderResources/forward/forward_Instancing_Skinning_Texturing.json deleted file mode 100644 index 59fa48da..00000000 --- a/compiled/ShaderResources/forward/forward_Instancing_Skinning_Texturing.json +++ /dev/null @@ -1,111 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Instancing_Skinning_Texturing.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_Instancing_Skinning_Texturing.vert" - } - ], - "id": "forward_Instancing_Skinning_Texturing", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Instancing_Skinning_Texturing_VCols.json b/compiled/ShaderResources/forward/forward_Instancing_Skinning_Texturing_VCols.json deleted file mode 100644 index 78a1ed39..00000000 --- a/compiled/ShaderResources/forward/forward_Instancing_Skinning_Texturing_VCols.json +++ /dev/null @@ -1,115 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Instancing_Skinning_Texturing_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_Instancing_Skinning_Texturing_VCols.vert" - } - ], - "id": "forward_Instancing_Skinning_Texturing_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "col", - "size": 4 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Instancing_Skinning_VCols.json b/compiled/ShaderResources/forward/forward_Instancing_Skinning_VCols.json deleted file mode 100644 index bb46f6b9..00000000 --- a/compiled/ShaderResources/forward/forward_Instancing_Skinning_VCols.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Instancing_Skinning_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_Instancing_Skinning_VCols.vert" - } - ], - "id": "forward_Instancing_Skinning_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "col", - "size": 4 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Instancing_Texturing.json b/compiled/ShaderResources/forward/forward_Instancing_Texturing.json deleted file mode 100644 index ce1a970e..00000000 --- a/compiled/ShaderResources/forward/forward_Instancing_Texturing.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Instancing_Texturing.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_Instancing_Texturing.vert" - } - ], - "id": "forward_Instancing_Texturing", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Instancing_Texturing_VCols.json b/compiled/ShaderResources/forward/forward_Instancing_Texturing_VCols.json deleted file mode 100644 index 6b965d3d..00000000 --- a/compiled/ShaderResources/forward/forward_Instancing_Texturing_VCols.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Instancing_Texturing_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_Instancing_Texturing_VCols.vert" - } - ], - "id": "forward_Instancing_Texturing_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "col", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Instancing_VCols.json b/compiled/ShaderResources/forward/forward_Instancing_VCols.json deleted file mode 100644 index 5abeaa24..00000000 --- a/compiled/ShaderResources/forward/forward_Instancing_VCols.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Instancing_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_Instancing_VCols.vert" - } - ], - "id": "forward_Instancing_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "col", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_NormalMapping.json b/compiled/ShaderResources/forward/forward_NormalMapping.json deleted file mode 100644 index 71ffa277..00000000 --- a/compiled/ShaderResources/forward/forward_NormalMapping.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_NormalMapping.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_NormalMapping.vert" - } - ], - "id": "forward_NormalMapping", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tan", - "size": 3 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_NormalMapping_Skinning.json b/compiled/ShaderResources/forward/forward_NormalMapping_Skinning.json deleted file mode 100644 index 4d1d174a..00000000 --- a/compiled/ShaderResources/forward/forward_NormalMapping_Skinning.json +++ /dev/null @@ -1,111 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_NormalMapping_Skinning.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_NormalMapping_Skinning.vert" - } - ], - "id": "forward_NormalMapping_Skinning", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tan", - "size": 3 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_NormalMapping_Skinning_Texturing.json b/compiled/ShaderResources/forward/forward_NormalMapping_Skinning_Texturing.json deleted file mode 100644 index b8b47120..00000000 --- a/compiled/ShaderResources/forward/forward_NormalMapping_Skinning_Texturing.json +++ /dev/null @@ -1,118 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_NormalMapping_Skinning_Texturing.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_NormalMapping_Skinning_Texturing.vert" - } - ], - "id": "forward_NormalMapping_Skinning_Texturing", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "tan", - "size": 3 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_NormalMapping_Skinning_Texturing_VCols.json b/compiled/ShaderResources/forward/forward_NormalMapping_Skinning_Texturing_VCols.json deleted file mode 100644 index 9b403415..00000000 --- a/compiled/ShaderResources/forward/forward_NormalMapping_Skinning_Texturing_VCols.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_NormalMapping_Skinning_Texturing_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_NormalMapping_Skinning_Texturing_VCols.vert" - } - ], - "id": "forward_NormalMapping_Skinning_Texturing_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "col", - "size": 4 - }, - { - "name": "tan", - "size": 3 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_NormalMapping_Skinning_VCols.json b/compiled/ShaderResources/forward/forward_NormalMapping_Skinning_VCols.json deleted file mode 100644 index 5b08249a..00000000 --- a/compiled/ShaderResources/forward/forward_NormalMapping_Skinning_VCols.json +++ /dev/null @@ -1,115 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_NormalMapping_Skinning_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_NormalMapping_Skinning_VCols.vert" - } - ], - "id": "forward_NormalMapping_Skinning_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "col", - "size": 4 - }, - { - "name": "tan", - "size": 3 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_NormalMapping_Texturing.json b/compiled/ShaderResources/forward/forward_NormalMapping_Texturing.json deleted file mode 100644 index d03da6d8..00000000 --- a/compiled/ShaderResources/forward/forward_NormalMapping_Texturing.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_NormalMapping_Texturing.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_NormalMapping_Texturing.vert" - } - ], - "id": "forward_NormalMapping_Texturing", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "tan", - "size": 3 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_NormalMapping_Texturing_VCols.json b/compiled/ShaderResources/forward/forward_NormalMapping_Texturing_VCols.json deleted file mode 100644 index 6a845141..00000000 --- a/compiled/ShaderResources/forward/forward_NormalMapping_Texturing_VCols.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_NormalMapping_Texturing_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_NormalMapping_Texturing_VCols.vert" - } - ], - "id": "forward_NormalMapping_Texturing_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "col", - "size": 4 - }, - { - "name": "tan", - "size": 3 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_NormalMapping_VCols.json b/compiled/ShaderResources/forward/forward_NormalMapping_VCols.json deleted file mode 100644 index 426b04b1..00000000 --- a/compiled/ShaderResources/forward/forward_NormalMapping_VCols.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_NormalMapping_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - }, - { - "id": "snormal" - } - ], - "vertex_shader": "forward_NormalMapping_VCols.vert" - } - ], - "id": "forward_NormalMapping_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "col", - "size": 4 - }, - { - "name": "tan", - "size": 3 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Skinning.json b/compiled/ShaderResources/forward/forward_Skinning.json deleted file mode 100644 index 43afe69c..00000000 --- a/compiled/ShaderResources/forward/forward_Skinning.json +++ /dev/null @@ -1,104 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Skinning.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_Skinning.vert" - } - ], - "id": "forward_Skinning", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Skinning_Texturing.json b/compiled/ShaderResources/forward/forward_Skinning_Texturing.json deleted file mode 100644 index 149bd338..00000000 --- a/compiled/ShaderResources/forward/forward_Skinning_Texturing.json +++ /dev/null @@ -1,111 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Skinning_Texturing.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_Skinning_Texturing.vert" - } - ], - "id": "forward_Skinning_Texturing", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Skinning_Texturing_VCols.json b/compiled/ShaderResources/forward/forward_Skinning_Texturing_VCols.json deleted file mode 100644 index 13ffc7de..00000000 --- a/compiled/ShaderResources/forward/forward_Skinning_Texturing_VCols.json +++ /dev/null @@ -1,115 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Skinning_Texturing_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_Skinning_Texturing_VCols.vert" - } - ], - "id": "forward_Skinning_Texturing_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "col", - "size": 4 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Skinning_VCols.json b/compiled/ShaderResources/forward/forward_Skinning_VCols.json deleted file mode 100644 index 99020f68..00000000 --- a/compiled/ShaderResources/forward/forward_Skinning_VCols.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "skinBones", - "link": "_skinBones", - "type": "floats" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Skinning_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_Skinning_VCols.vert" - } - ], - "id": "forward_Skinning_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "col", - "size": 4 - }, - { - "name": "bone", - "size": 4 - }, - { - "name": "weight", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Texturing.json b/compiled/ShaderResources/forward/forward_Texturing.json deleted file mode 100644 index 5554edd4..00000000 --- a/compiled/ShaderResources/forward/forward_Texturing.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Texturing.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_Texturing.vert" - } - ], - "id": "forward_Texturing", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_Texturing_VCols.json b/compiled/ShaderResources/forward/forward_Texturing_VCols.json deleted file mode 100644 index c6fbb7e7..00000000 --- a/compiled/ShaderResources/forward/forward_Texturing_VCols.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_Texturing_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "salbedo" - }, - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_Texturing_VCols.vert" - } - ], - "id": "forward_Texturing_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "tex", - "size": 2 - }, - { - "name": "col", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/ShaderResources/forward/forward_VCols.json b/compiled/ShaderResources/forward/forward_VCols.json deleted file mode 100644 index acded039..00000000 --- a/compiled/ShaderResources/forward/forward_VCols.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "shader_resources": [ - { - "contexts": [ - { - "blend_destination": "blend_zero", - "blend_source": "blend_one", - "compare_mode": "less", - "constants": [ - { - "id": "M", - "link": "_modelMatrix", - "type": "mat4" - }, - { - "id": "NM", - "link": "_normalMatrix", - "type": "mat4" - }, - { - "id": "V", - "link": "_viewMatrix", - "type": "mat4" - }, - { - "id": "P", - "link": "_projectionMatrix", - "type": "mat4" - }, - { - "id": "LMVP", - "link": "_lightModelViewProjectionMatrix", - "type": "mat4" - }, - { - "id": "albedo_color", - "type": "vec4" - }, - { - "id": "light", - "link": "_lightPosition", - "type": "vec3" - }, - { - "id": "eye", - "link": "_cameraPosition", - "type": "vec3" - }, - { - "id": "lighting", - "type": "bool" - }, - { - "id": "receiveShadow", - "type": "bool" - }, - { - "id": "roughness", - "type": "float" - }, - { - "id": "metalness", - "type": "float" - } - ], - "cull_mode": "counter_clockwise", - "depth_write": true, - "fragment_shader": "forward_VCols.frag", - "id": "forward", - "texture_units": [ - { - "id": "shadowMap" - } - ], - "vertex_shader": "forward_VCols.vert" - } - ], - "id": "forward_VCols", - "vertex_structure": [ - { - "name": "pos", - "size": 3 - }, - { - "name": "nor", - "size": 3 - }, - { - "name": "col", - "size": 4 - } - ] - } - ] -} \ No newline at end of file diff --git a/compiled/Shaders/env_map/env_map.frag.glsl b/compiled/Shaders/env_map/env_map.frag.glsl deleted file mode 100644 index 12d2e263..00000000 --- a/compiled/Shaders/env_map/env_map.frag.glsl +++ /dev/null @@ -1,24 +0,0 @@ -#version 450 - -#ifdef GL_ES -precision mediump float; -#endif - -#define PI 3.1415926 -#define TwoPI (2.0 * PI) - -uniform sampler2D envmap; - -in vec3 wcNormal; - -vec2 envMapEquirect(vec3 wcNormal, float flipEnvMap) { - float phi = acos(wcNormal.z); - float theta = atan(flipEnvMap * wcNormal.x, wcNormal.y) + PI; - return vec2(theta / TwoPI, phi / PI); -} - -void main() { - - vec3 N = normalize(wcNormal); - gl_FragColor = texture(envmap, envMapEquirect(N, -1.0)); -} diff --git a/compiled/Shaders/env_map/env_map.vert.glsl b/compiled/Shaders/env_map/env_map.vert.glsl deleted file mode 100644 index 1fc8c267..00000000 --- a/compiled/Shaders/env_map/env_map.vert.glsl +++ /dev/null @@ -1,73 +0,0 @@ -#version 450 - -#ifdef GL_ES -precision highp float; -#endif - -uniform mat4 V; -uniform mat4 P; - -in vec2 pos; - -out vec3 wcNormal; - -mat4 inverse(mat4 m) { - float - a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3], - a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3], - a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3], - a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3], - - b00 = a00 * a11 - a01 * a10, - b01 = a00 * a12 - a02 * a10, - b02 = a00 * a13 - a03 * a10, - b03 = a01 * a12 - a02 * a11, - b04 = a01 * a13 - a03 * a11, - b05 = a02 * a13 - a03 * a12, - b06 = a20 * a31 - a21 * a30, - b07 = a20 * a32 - a22 * a30, - b08 = a20 * a33 - a23 * a30, - b09 = a21 * a32 - a22 * a31, - b10 = a21 * a33 - a23 * a31, - b11 = a22 * a33 - a23 * a32, - - det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; - - return mat4( - a11 * b11 - a12 * b10 + a13 * b09, - a02 * b10 - a01 * b11 - a03 * b09, - a31 * b05 - a32 * b04 + a33 * b03, - a22 * b04 - a21 * b05 - a23 * b03, - a12 * b08 - a10 * b11 - a13 * b07, - a00 * b11 - a02 * b08 + a03 * b07, - a32 * b02 - a30 * b05 - a33 * b01, - a20 * b05 - a22 * b02 + a23 * b01, - a10 * b10 - a11 * b08 + a13 * b06, - a01 * b08 - a00 * b10 - a03 * b06, - a30 * b04 - a31 * b02 + a33 * b00, - a21 * b02 - a20 * b04 - a23 * b00, - a11 * b07 - a10 * b09 - a12 * b06, - a00 * b09 - a01 * b07 + a02 * b06, - a31 * b01 - a30 * b03 - a32 * b00, - a20 * b03 - a21 * b01 + a22 * b00) / det; -} - -// mat3 transpose(mat3 m) { -// return mat3(m[0][0], m[1][0], m[2][0], -// m[0][1], m[1][1], m[2][1], -// m[0][2], m[1][2], m[2][2]); -// } - -void main() { - - mat4 invP = inverse(P); - mat3 invMV = transpose(mat3(V)); - - vec4 p = vec4(pos.xy, 0.0, 1.0); - - vec3 unprojected = (invP * p).xyz; - - wcNormal = invMV * unprojected; - - gl_Position = vec4(pos.xy, 0.0, 1.0); -} diff --git a/compiled/Shaders/forward/forward.frag.glsl b/compiled/Shaders/forward/forward.frag.glsl deleted file mode 100644 index 7c45bf41..00000000 --- a/compiled/Shaders/forward/forward.frag.glsl +++ /dev/null @@ -1,145 +0,0 @@ -#version 450 - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward.vert.glsl b/compiled/Shaders/forward/forward.vert.glsl deleted file mode 100644 index 2010baa9..00000000 --- a/compiled/Shaders/forward/forward.vert.glsl +++ /dev/null @@ -1,150 +0,0 @@ -#version 450 - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest.frag.glsl deleted file mode 100644 index 0507b003..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest.frag.glsl +++ /dev/null @@ -1,146 +0,0 @@ -#version 450 -#define _AlphaTest - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest.vert.glsl deleted file mode 100644 index 2b097260..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest.vert.glsl +++ /dev/null @@ -1,151 +0,0 @@ -#version 450 -#define _AlphaTest - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard.frag.glsl deleted file mode 100644 index 8db80315..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard.frag.glsl +++ /dev/null @@ -1,147 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard.vert.glsl deleted file mode 100644 index 82070dd1..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard.vert.glsl +++ /dev/null @@ -1,152 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing.frag.glsl deleted file mode 100644 index bc6ebda5..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing.frag.glsl +++ /dev/null @@ -1,148 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _Instancing - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing.vert.glsl deleted file mode 100644 index d34b3300..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing.vert.glsl +++ /dev/null @@ -1,153 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _Instancing - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping.frag.glsl deleted file mode 100644 index 37d2a586..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping.frag.glsl +++ /dev/null @@ -1,149 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _Instancing -#define _NormalMapping - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping.vert.glsl deleted file mode 100644 index 2be70ae0..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping.vert.glsl +++ /dev/null @@ -1,154 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _Instancing -#define _NormalMapping - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning.frag.glsl deleted file mode 100644 index c0a7a633..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning.frag.glsl +++ /dev/null @@ -1,150 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _Instancing -#define _NormalMapping -#define _Skinning - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning.vert.glsl deleted file mode 100644 index 3065b7ea..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning.vert.glsl +++ /dev/null @@ -1,155 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _Instancing -#define _NormalMapping -#define _Skinning - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning_Texturing.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning_Texturing.frag.glsl deleted file mode 100644 index 05614ec9..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning_Texturing.frag.glsl +++ /dev/null @@ -1,151 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _Instancing -#define _NormalMapping -#define _Skinning -#define _Texturing - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning_Texturing.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning_Texturing.vert.glsl deleted file mode 100644 index 21301073..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning_Texturing.vert.glsl +++ /dev/null @@ -1,156 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _Instancing -#define _NormalMapping -#define _Skinning -#define _Texturing - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning_Texturing_VCols.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning_Texturing_VCols.frag.glsl deleted file mode 100644 index 9caeb99b..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning_Texturing_VCols.frag.glsl +++ /dev/null @@ -1,152 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _Instancing -#define _NormalMapping -#define _Skinning -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning_Texturing_VCols.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning_Texturing_VCols.vert.glsl deleted file mode 100644 index bfcffff5..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning_Texturing_VCols.vert.glsl +++ /dev/null @@ -1,157 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _Instancing -#define _NormalMapping -#define _Skinning -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning_VCols.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning_VCols.frag.glsl deleted file mode 100644 index e319321f..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning_VCols.frag.glsl +++ /dev/null @@ -1,151 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _Instancing -#define _NormalMapping -#define _Skinning -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning_VCols.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning_VCols.vert.glsl deleted file mode 100644 index c0a0adcd..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Skinning_VCols.vert.glsl +++ /dev/null @@ -1,156 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _Instancing -#define _NormalMapping -#define _Skinning -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Texturing.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Texturing.frag.glsl deleted file mode 100644 index 7c918009..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Texturing.frag.glsl +++ /dev/null @@ -1,150 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _Instancing -#define _NormalMapping -#define _Texturing - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Texturing.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Texturing.vert.glsl deleted file mode 100644 index ebd4500a..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Texturing.vert.glsl +++ /dev/null @@ -1,155 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _Instancing -#define _NormalMapping -#define _Texturing - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Texturing_VCols.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Texturing_VCols.frag.glsl deleted file mode 100644 index a9a305ed..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Texturing_VCols.frag.glsl +++ /dev/null @@ -1,151 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _Instancing -#define _NormalMapping -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Texturing_VCols.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Texturing_VCols.vert.glsl deleted file mode 100644 index 8a6bcd14..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_Texturing_VCols.vert.glsl +++ /dev/null @@ -1,156 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _Instancing -#define _NormalMapping -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_VCols.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_VCols.frag.glsl deleted file mode 100644 index e57887e1..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_VCols.frag.glsl +++ /dev/null @@ -1,150 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _Instancing -#define _NormalMapping -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_VCols.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_VCols.vert.glsl deleted file mode 100644 index 2f35c67d..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_NormalMapping_VCols.vert.glsl +++ /dev/null @@ -1,155 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _Instancing -#define _NormalMapping -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_Skinning.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_Skinning.frag.glsl deleted file mode 100644 index 76d59708..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_Skinning.frag.glsl +++ /dev/null @@ -1,149 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _Instancing -#define _Skinning - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_Skinning.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_Skinning.vert.glsl deleted file mode 100644 index 690e39ba..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_Skinning.vert.glsl +++ /dev/null @@ -1,154 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _Instancing -#define _Skinning - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_Skinning_Texturing.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_Skinning_Texturing.frag.glsl deleted file mode 100644 index 5a7dd7c7..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_Skinning_Texturing.frag.glsl +++ /dev/null @@ -1,150 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _Instancing -#define _Skinning -#define _Texturing - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_Skinning_Texturing.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_Skinning_Texturing.vert.glsl deleted file mode 100644 index c3299116..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_Skinning_Texturing.vert.glsl +++ /dev/null @@ -1,155 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _Instancing -#define _Skinning -#define _Texturing - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_Skinning_Texturing_VCols.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_Skinning_Texturing_VCols.frag.glsl deleted file mode 100644 index 36d082d4..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_Skinning_Texturing_VCols.frag.glsl +++ /dev/null @@ -1,151 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _Instancing -#define _Skinning -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_Skinning_Texturing_VCols.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_Skinning_Texturing_VCols.vert.glsl deleted file mode 100644 index e3aaea0e..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_Skinning_Texturing_VCols.vert.glsl +++ /dev/null @@ -1,156 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _Instancing -#define _Skinning -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_Skinning_VCols.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_Skinning_VCols.frag.glsl deleted file mode 100644 index 6b71f7a7..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_Skinning_VCols.frag.glsl +++ /dev/null @@ -1,150 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _Instancing -#define _Skinning -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_Skinning_VCols.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_Skinning_VCols.vert.glsl deleted file mode 100644 index 76d8ee6c..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_Skinning_VCols.vert.glsl +++ /dev/null @@ -1,155 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _Instancing -#define _Skinning -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_Texturing.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_Texturing.frag.glsl deleted file mode 100644 index 13d3bc38..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_Texturing.frag.glsl +++ /dev/null @@ -1,149 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _Instancing -#define _Texturing - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_Texturing.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_Texturing.vert.glsl deleted file mode 100644 index 23460f66..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_Texturing.vert.glsl +++ /dev/null @@ -1,154 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _Instancing -#define _Texturing - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_Texturing_VCols.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_Texturing_VCols.frag.glsl deleted file mode 100644 index dbc311fd..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_Texturing_VCols.frag.glsl +++ /dev/null @@ -1,150 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _Instancing -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_Texturing_VCols.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_Texturing_VCols.vert.glsl deleted file mode 100644 index 4f22e30d..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_Texturing_VCols.vert.glsl +++ /dev/null @@ -1,155 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _Instancing -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_VCols.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_VCols.frag.glsl deleted file mode 100644 index cd19a7a6..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_VCols.frag.glsl +++ /dev/null @@ -1,149 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _Instancing -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_VCols.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_VCols.vert.glsl deleted file mode 100644 index 8f16c2cc..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Instancing_VCols.vert.glsl +++ /dev/null @@ -1,154 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _Instancing -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping.frag.glsl deleted file mode 100644 index 68ae41c2..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping.frag.glsl +++ /dev/null @@ -1,148 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _NormalMapping - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping.vert.glsl deleted file mode 100644 index 51fce1f3..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping.vert.glsl +++ /dev/null @@ -1,153 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _NormalMapping - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_Skinning.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_Skinning.frag.glsl deleted file mode 100644 index 9bffd684..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_Skinning.frag.glsl +++ /dev/null @@ -1,149 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _NormalMapping -#define _Skinning - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_Skinning.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_Skinning.vert.glsl deleted file mode 100644 index 3dd9fcad..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_Skinning.vert.glsl +++ /dev/null @@ -1,154 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _NormalMapping -#define _Skinning - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_Skinning_Texturing.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_Skinning_Texturing.frag.glsl deleted file mode 100644 index ed897874..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_Skinning_Texturing.frag.glsl +++ /dev/null @@ -1,150 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _NormalMapping -#define _Skinning -#define _Texturing - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_Skinning_Texturing.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_Skinning_Texturing.vert.glsl deleted file mode 100644 index 631825ab..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_Skinning_Texturing.vert.glsl +++ /dev/null @@ -1,155 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _NormalMapping -#define _Skinning -#define _Texturing - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_Skinning_Texturing_VCols.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_Skinning_Texturing_VCols.frag.glsl deleted file mode 100644 index 1a73ed09..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_Skinning_Texturing_VCols.frag.glsl +++ /dev/null @@ -1,151 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _NormalMapping -#define _Skinning -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_Skinning_Texturing_VCols.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_Skinning_Texturing_VCols.vert.glsl deleted file mode 100644 index 57f5065f..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_Skinning_Texturing_VCols.vert.glsl +++ /dev/null @@ -1,156 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _NormalMapping -#define _Skinning -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_Skinning_VCols.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_Skinning_VCols.frag.glsl deleted file mode 100644 index 91e53a0c..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_Skinning_VCols.frag.glsl +++ /dev/null @@ -1,150 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _NormalMapping -#define _Skinning -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_Skinning_VCols.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_Skinning_VCols.vert.glsl deleted file mode 100644 index b9e03cca..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_Skinning_VCols.vert.glsl +++ /dev/null @@ -1,155 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _NormalMapping -#define _Skinning -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_Texturing.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_Texturing.frag.glsl deleted file mode 100644 index 49f9f856..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_Texturing.frag.glsl +++ /dev/null @@ -1,149 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _NormalMapping -#define _Texturing - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_Texturing.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_Texturing.vert.glsl deleted file mode 100644 index 8ea130b6..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_Texturing.vert.glsl +++ /dev/null @@ -1,154 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _NormalMapping -#define _Texturing - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_Texturing_VCols.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_Texturing_VCols.frag.glsl deleted file mode 100644 index a6ca1cb7..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_Texturing_VCols.frag.glsl +++ /dev/null @@ -1,150 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _NormalMapping -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_Texturing_VCols.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_Texturing_VCols.vert.glsl deleted file mode 100644 index b5e74856..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_Texturing_VCols.vert.glsl +++ /dev/null @@ -1,155 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _NormalMapping -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_VCols.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_VCols.frag.glsl deleted file mode 100644 index 3a82671d..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_VCols.frag.glsl +++ /dev/null @@ -1,149 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _NormalMapping -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_VCols.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_VCols.vert.glsl deleted file mode 100644 index f3b50a5a..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_NormalMapping_VCols.vert.glsl +++ /dev/null @@ -1,154 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _NormalMapping -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Skinning.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_Skinning.frag.glsl deleted file mode 100644 index 8360c060..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Skinning.frag.glsl +++ /dev/null @@ -1,148 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _Skinning - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Skinning.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_Skinning.vert.glsl deleted file mode 100644 index f1288fd9..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Skinning.vert.glsl +++ /dev/null @@ -1,153 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _Skinning - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Skinning_Texturing.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_Skinning_Texturing.frag.glsl deleted file mode 100644 index 85f5cb49..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Skinning_Texturing.frag.glsl +++ /dev/null @@ -1,149 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _Skinning -#define _Texturing - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Skinning_Texturing.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_Skinning_Texturing.vert.glsl deleted file mode 100644 index ac3655ad..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Skinning_Texturing.vert.glsl +++ /dev/null @@ -1,154 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _Skinning -#define _Texturing - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Skinning_Texturing_VCols.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_Skinning_Texturing_VCols.frag.glsl deleted file mode 100644 index 91569072..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Skinning_Texturing_VCols.frag.glsl +++ /dev/null @@ -1,150 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _Skinning -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Skinning_Texturing_VCols.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_Skinning_Texturing_VCols.vert.glsl deleted file mode 100644 index 69222fcb..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Skinning_Texturing_VCols.vert.glsl +++ /dev/null @@ -1,155 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _Skinning -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Skinning_VCols.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_Skinning_VCols.frag.glsl deleted file mode 100644 index 87634aed..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Skinning_VCols.frag.glsl +++ /dev/null @@ -1,149 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _Skinning -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Skinning_VCols.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_Skinning_VCols.vert.glsl deleted file mode 100644 index c43b4047..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Skinning_VCols.vert.glsl +++ /dev/null @@ -1,154 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _Skinning -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Texturing.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_Texturing.frag.glsl deleted file mode 100644 index 747977b8..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Texturing.frag.glsl +++ /dev/null @@ -1,148 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _Texturing - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Texturing.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_Texturing.vert.glsl deleted file mode 100644 index f1167433..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Texturing.vert.glsl +++ /dev/null @@ -1,153 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _Texturing - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Texturing_VCols.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_Texturing_VCols.frag.glsl deleted file mode 100644 index 8d7356cc..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Texturing_VCols.frag.glsl +++ /dev/null @@ -1,149 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Texturing_VCols.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_Texturing_VCols.vert.glsl deleted file mode 100644 index 5b2126f1..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_Texturing_VCols.vert.glsl +++ /dev/null @@ -1,154 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_VCols.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_VCols.frag.glsl deleted file mode 100644 index 071c7af9..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_VCols.frag.glsl +++ /dev/null @@ -1,148 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Billboard_VCols.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Billboard_VCols.vert.glsl deleted file mode 100644 index 4266241e..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Billboard_VCols.vert.glsl +++ /dev/null @@ -1,153 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Billboard -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Instancing.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Instancing.frag.glsl deleted file mode 100644 index 5c61b398..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Instancing.frag.glsl +++ /dev/null @@ -1,147 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Instancing - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Instancing.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Instancing.vert.glsl deleted file mode 100644 index 51ef0217..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Instancing.vert.glsl +++ /dev/null @@ -1,152 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Instancing - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping.frag.glsl deleted file mode 100644 index 6929b1c3..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping.frag.glsl +++ /dev/null @@ -1,148 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Instancing -#define _NormalMapping - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping.vert.glsl deleted file mode 100644 index bd3fa81e..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping.vert.glsl +++ /dev/null @@ -1,153 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Instancing -#define _NormalMapping - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_Skinning.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_Skinning.frag.glsl deleted file mode 100644 index d6917adb..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_Skinning.frag.glsl +++ /dev/null @@ -1,149 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Instancing -#define _NormalMapping -#define _Skinning - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_Skinning.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_Skinning.vert.glsl deleted file mode 100644 index 31c4760b..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_Skinning.vert.glsl +++ /dev/null @@ -1,154 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Instancing -#define _NormalMapping -#define _Skinning - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_Skinning_Texturing.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_Skinning_Texturing.frag.glsl deleted file mode 100644 index 2376d853..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_Skinning_Texturing.frag.glsl +++ /dev/null @@ -1,150 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Instancing -#define _NormalMapping -#define _Skinning -#define _Texturing - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_Skinning_Texturing.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_Skinning_Texturing.vert.glsl deleted file mode 100644 index 9089abc7..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_Skinning_Texturing.vert.glsl +++ /dev/null @@ -1,155 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Instancing -#define _NormalMapping -#define _Skinning -#define _Texturing - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_Skinning_Texturing_VCols.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_Skinning_Texturing_VCols.frag.glsl deleted file mode 100644 index 1142d1eb..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_Skinning_Texturing_VCols.frag.glsl +++ /dev/null @@ -1,151 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Instancing -#define _NormalMapping -#define _Skinning -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_Skinning_Texturing_VCols.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_Skinning_Texturing_VCols.vert.glsl deleted file mode 100644 index 8228b1b9..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_Skinning_Texturing_VCols.vert.glsl +++ /dev/null @@ -1,156 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Instancing -#define _NormalMapping -#define _Skinning -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_Skinning_VCols.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_Skinning_VCols.frag.glsl deleted file mode 100644 index 8cb1ba29..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_Skinning_VCols.frag.glsl +++ /dev/null @@ -1,150 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Instancing -#define _NormalMapping -#define _Skinning -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_Skinning_VCols.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_Skinning_VCols.vert.glsl deleted file mode 100644 index 90e08a8c..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_Skinning_VCols.vert.glsl +++ /dev/null @@ -1,155 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Instancing -#define _NormalMapping -#define _Skinning -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_Texturing.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_Texturing.frag.glsl deleted file mode 100644 index d8e2eb15..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_Texturing.frag.glsl +++ /dev/null @@ -1,149 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Instancing -#define _NormalMapping -#define _Texturing - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_Texturing.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_Texturing.vert.glsl deleted file mode 100644 index 269b1747..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_Texturing.vert.glsl +++ /dev/null @@ -1,154 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Instancing -#define _NormalMapping -#define _Texturing - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_Texturing_VCols.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_Texturing_VCols.frag.glsl deleted file mode 100644 index d31ff5c2..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_Texturing_VCols.frag.glsl +++ /dev/null @@ -1,150 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Instancing -#define _NormalMapping -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_Texturing_VCols.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_Texturing_VCols.vert.glsl deleted file mode 100644 index ae8dd1b0..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_Texturing_VCols.vert.glsl +++ /dev/null @@ -1,155 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Instancing -#define _NormalMapping -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_VCols.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_VCols.frag.glsl deleted file mode 100644 index 8005905e..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_VCols.frag.glsl +++ /dev/null @@ -1,149 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Instancing -#define _NormalMapping -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_VCols.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_VCols.vert.glsl deleted file mode 100644 index 43c30fb2..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Instancing_NormalMapping_VCols.vert.glsl +++ /dev/null @@ -1,154 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Instancing -#define _NormalMapping -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Instancing_Skinning.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Instancing_Skinning.frag.glsl deleted file mode 100644 index 877cc11c..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Instancing_Skinning.frag.glsl +++ /dev/null @@ -1,148 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Instancing -#define _Skinning - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Instancing_Skinning.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Instancing_Skinning.vert.glsl deleted file mode 100644 index 649d68e3..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Instancing_Skinning.vert.glsl +++ /dev/null @@ -1,153 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Instancing -#define _Skinning - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Instancing_Skinning_Texturing.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Instancing_Skinning_Texturing.frag.glsl deleted file mode 100644 index c0132d71..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Instancing_Skinning_Texturing.frag.glsl +++ /dev/null @@ -1,149 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Instancing -#define _Skinning -#define _Texturing - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Instancing_Skinning_Texturing.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Instancing_Skinning_Texturing.vert.glsl deleted file mode 100644 index b8b115ad..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Instancing_Skinning_Texturing.vert.glsl +++ /dev/null @@ -1,154 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Instancing -#define _Skinning -#define _Texturing - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Instancing_Skinning_Texturing_VCols.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Instancing_Skinning_Texturing_VCols.frag.glsl deleted file mode 100644 index 74650804..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Instancing_Skinning_Texturing_VCols.frag.glsl +++ /dev/null @@ -1,150 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Instancing -#define _Skinning -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Instancing_Skinning_Texturing_VCols.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Instancing_Skinning_Texturing_VCols.vert.glsl deleted file mode 100644 index bf92edec..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Instancing_Skinning_Texturing_VCols.vert.glsl +++ /dev/null @@ -1,155 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Instancing -#define _Skinning -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Instancing_Skinning_VCols.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Instancing_Skinning_VCols.frag.glsl deleted file mode 100644 index 3f5fd7fa..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Instancing_Skinning_VCols.frag.glsl +++ /dev/null @@ -1,149 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Instancing -#define _Skinning -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Instancing_Skinning_VCols.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Instancing_Skinning_VCols.vert.glsl deleted file mode 100644 index ad6d544c..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Instancing_Skinning_VCols.vert.glsl +++ /dev/null @@ -1,154 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Instancing -#define _Skinning -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Instancing_Texturing.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Instancing_Texturing.frag.glsl deleted file mode 100644 index b3eb9a7d..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Instancing_Texturing.frag.glsl +++ /dev/null @@ -1,148 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Instancing -#define _Texturing - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Instancing_Texturing.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Instancing_Texturing.vert.glsl deleted file mode 100644 index ba41e34a..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Instancing_Texturing.vert.glsl +++ /dev/null @@ -1,153 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Instancing -#define _Texturing - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Instancing_Texturing_VCols.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Instancing_Texturing_VCols.frag.glsl deleted file mode 100644 index cc418218..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Instancing_Texturing_VCols.frag.glsl +++ /dev/null @@ -1,149 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Instancing -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Instancing_Texturing_VCols.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Instancing_Texturing_VCols.vert.glsl deleted file mode 100644 index 59ff7e9f..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Instancing_Texturing_VCols.vert.glsl +++ /dev/null @@ -1,154 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Instancing -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Instancing_VCols.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Instancing_VCols.frag.glsl deleted file mode 100644 index 1d64f166..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Instancing_VCols.frag.glsl +++ /dev/null @@ -1,148 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Instancing -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Instancing_VCols.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Instancing_VCols.vert.glsl deleted file mode 100644 index 45e8661a..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Instancing_VCols.vert.glsl +++ /dev/null @@ -1,153 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Instancing -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_NormalMapping.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_NormalMapping.frag.glsl deleted file mode 100644 index 4d84ad71..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_NormalMapping.frag.glsl +++ /dev/null @@ -1,147 +0,0 @@ -#version 450 -#define _AlphaTest -#define _NormalMapping - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_NormalMapping.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_NormalMapping.vert.glsl deleted file mode 100644 index b59da215..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_NormalMapping.vert.glsl +++ /dev/null @@ -1,152 +0,0 @@ -#version 450 -#define _AlphaTest -#define _NormalMapping - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_NormalMapping_Skinning.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_NormalMapping_Skinning.frag.glsl deleted file mode 100644 index c0eb3bc2..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_NormalMapping_Skinning.frag.glsl +++ /dev/null @@ -1,148 +0,0 @@ -#version 450 -#define _AlphaTest -#define _NormalMapping -#define _Skinning - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_NormalMapping_Skinning.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_NormalMapping_Skinning.vert.glsl deleted file mode 100644 index 083df499..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_NormalMapping_Skinning.vert.glsl +++ /dev/null @@ -1,153 +0,0 @@ -#version 450 -#define _AlphaTest -#define _NormalMapping -#define _Skinning - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_NormalMapping_Skinning_Texturing.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_NormalMapping_Skinning_Texturing.frag.glsl deleted file mode 100644 index 74cafb15..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_NormalMapping_Skinning_Texturing.frag.glsl +++ /dev/null @@ -1,149 +0,0 @@ -#version 450 -#define _AlphaTest -#define _NormalMapping -#define _Skinning -#define _Texturing - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_NormalMapping_Skinning_Texturing.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_NormalMapping_Skinning_Texturing.vert.glsl deleted file mode 100644 index 042815fb..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_NormalMapping_Skinning_Texturing.vert.glsl +++ /dev/null @@ -1,154 +0,0 @@ -#version 450 -#define _AlphaTest -#define _NormalMapping -#define _Skinning -#define _Texturing - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_NormalMapping_Skinning_Texturing_VCols.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_NormalMapping_Skinning_Texturing_VCols.frag.glsl deleted file mode 100644 index a113c1b8..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_NormalMapping_Skinning_Texturing_VCols.frag.glsl +++ /dev/null @@ -1,150 +0,0 @@ -#version 450 -#define _AlphaTest -#define _NormalMapping -#define _Skinning -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_NormalMapping_Skinning_Texturing_VCols.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_NormalMapping_Skinning_Texturing_VCols.vert.glsl deleted file mode 100644 index 97c585fd..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_NormalMapping_Skinning_Texturing_VCols.vert.glsl +++ /dev/null @@ -1,155 +0,0 @@ -#version 450 -#define _AlphaTest -#define _NormalMapping -#define _Skinning -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_NormalMapping_Skinning_VCols.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_NormalMapping_Skinning_VCols.frag.glsl deleted file mode 100644 index 0041bb4d..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_NormalMapping_Skinning_VCols.frag.glsl +++ /dev/null @@ -1,149 +0,0 @@ -#version 450 -#define _AlphaTest -#define _NormalMapping -#define _Skinning -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_NormalMapping_Skinning_VCols.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_NormalMapping_Skinning_VCols.vert.glsl deleted file mode 100644 index bad7a4e6..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_NormalMapping_Skinning_VCols.vert.glsl +++ /dev/null @@ -1,154 +0,0 @@ -#version 450 -#define _AlphaTest -#define _NormalMapping -#define _Skinning -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_NormalMapping_Texturing.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_NormalMapping_Texturing.frag.glsl deleted file mode 100644 index 7dcdfde0..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_NormalMapping_Texturing.frag.glsl +++ /dev/null @@ -1,148 +0,0 @@ -#version 450 -#define _AlphaTest -#define _NormalMapping -#define _Texturing - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_NormalMapping_Texturing.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_NormalMapping_Texturing.vert.glsl deleted file mode 100644 index 2f252116..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_NormalMapping_Texturing.vert.glsl +++ /dev/null @@ -1,153 +0,0 @@ -#version 450 -#define _AlphaTest -#define _NormalMapping -#define _Texturing - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_NormalMapping_Texturing_VCols.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_NormalMapping_Texturing_VCols.frag.glsl deleted file mode 100644 index c5b18b8e..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_NormalMapping_Texturing_VCols.frag.glsl +++ /dev/null @@ -1,149 +0,0 @@ -#version 450 -#define _AlphaTest -#define _NormalMapping -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_NormalMapping_Texturing_VCols.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_NormalMapping_Texturing_VCols.vert.glsl deleted file mode 100644 index ed5f63fe..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_NormalMapping_Texturing_VCols.vert.glsl +++ /dev/null @@ -1,154 +0,0 @@ -#version 450 -#define _AlphaTest -#define _NormalMapping -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_NormalMapping_VCols.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_NormalMapping_VCols.frag.glsl deleted file mode 100644 index 1352d9bb..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_NormalMapping_VCols.frag.glsl +++ /dev/null @@ -1,148 +0,0 @@ -#version 450 -#define _AlphaTest -#define _NormalMapping -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_NormalMapping_VCols.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_NormalMapping_VCols.vert.glsl deleted file mode 100644 index eee4dc8e..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_NormalMapping_VCols.vert.glsl +++ /dev/null @@ -1,153 +0,0 @@ -#version 450 -#define _AlphaTest -#define _NormalMapping -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Skinning.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Skinning.frag.glsl deleted file mode 100644 index fad1660d..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Skinning.frag.glsl +++ /dev/null @@ -1,147 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Skinning - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Skinning.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Skinning.vert.glsl deleted file mode 100644 index 153eb94e..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Skinning.vert.glsl +++ /dev/null @@ -1,152 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Skinning - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Skinning_Texturing.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Skinning_Texturing.frag.glsl deleted file mode 100644 index 9e14e31a..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Skinning_Texturing.frag.glsl +++ /dev/null @@ -1,148 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Skinning -#define _Texturing - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Skinning_Texturing.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Skinning_Texturing.vert.glsl deleted file mode 100644 index d4885516..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Skinning_Texturing.vert.glsl +++ /dev/null @@ -1,153 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Skinning -#define _Texturing - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Skinning_Texturing_VCols.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Skinning_Texturing_VCols.frag.glsl deleted file mode 100644 index 4b81917a..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Skinning_Texturing_VCols.frag.glsl +++ /dev/null @@ -1,149 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Skinning -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Skinning_Texturing_VCols.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Skinning_Texturing_VCols.vert.glsl deleted file mode 100644 index ee2e56bf..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Skinning_Texturing_VCols.vert.glsl +++ /dev/null @@ -1,154 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Skinning -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Skinning_VCols.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Skinning_VCols.frag.glsl deleted file mode 100644 index d02843c6..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Skinning_VCols.frag.glsl +++ /dev/null @@ -1,148 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Skinning -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Skinning_VCols.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Skinning_VCols.vert.glsl deleted file mode 100644 index eba7d1fa..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Skinning_VCols.vert.glsl +++ /dev/null @@ -1,153 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Skinning -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Texturing.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Texturing.frag.glsl deleted file mode 100644 index 1d543c80..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Texturing.frag.glsl +++ /dev/null @@ -1,147 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Texturing - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Texturing.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Texturing.vert.glsl deleted file mode 100644 index 269d1322..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Texturing.vert.glsl +++ /dev/null @@ -1,152 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Texturing - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Texturing_VCols.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_Texturing_VCols.frag.glsl deleted file mode 100644 index 70e1ce0c..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Texturing_VCols.frag.glsl +++ /dev/null @@ -1,148 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_Texturing_VCols.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_Texturing_VCols.vert.glsl deleted file mode 100644 index d7ffef9b..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_Texturing_VCols.vert.glsl +++ /dev/null @@ -1,153 +0,0 @@ -#version 450 -#define _AlphaTest -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_VCols.frag.glsl b/compiled/Shaders/forward/forward_AlphaTest_VCols.frag.glsl deleted file mode 100644 index c21c898d..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_VCols.frag.glsl +++ /dev/null @@ -1,147 +0,0 @@ -#version 450 -#define _AlphaTest -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_AlphaTest_VCols.vert.glsl b/compiled/Shaders/forward/forward_AlphaTest_VCols.vert.glsl deleted file mode 100644 index 6bafad2f..00000000 --- a/compiled/Shaders/forward/forward_AlphaTest_VCols.vert.glsl +++ /dev/null @@ -1,152 +0,0 @@ -#version 450 -#define _AlphaTest -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Billboard.frag.glsl b/compiled/Shaders/forward/forward_Billboard.frag.glsl deleted file mode 100644 index 9366ab68..00000000 --- a/compiled/Shaders/forward/forward_Billboard.frag.glsl +++ /dev/null @@ -1,146 +0,0 @@ -#version 450 -#define _Billboard - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Billboard.vert.glsl b/compiled/Shaders/forward/forward_Billboard.vert.glsl deleted file mode 100644 index 2e2fdeb2..00000000 --- a/compiled/Shaders/forward/forward_Billboard.vert.glsl +++ /dev/null @@ -1,151 +0,0 @@ -#version 450 -#define _Billboard - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Billboard_Instancing.frag.glsl b/compiled/Shaders/forward/forward_Billboard_Instancing.frag.glsl deleted file mode 100644 index c11d499b..00000000 --- a/compiled/Shaders/forward/forward_Billboard_Instancing.frag.glsl +++ /dev/null @@ -1,147 +0,0 @@ -#version 450 -#define _Billboard -#define _Instancing - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Billboard_Instancing.vert.glsl b/compiled/Shaders/forward/forward_Billboard_Instancing.vert.glsl deleted file mode 100644 index eda7dc9c..00000000 --- a/compiled/Shaders/forward/forward_Billboard_Instancing.vert.glsl +++ /dev/null @@ -1,152 +0,0 @@ -#version 450 -#define _Billboard -#define _Instancing - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping.frag.glsl b/compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping.frag.glsl deleted file mode 100644 index fc611f1d..00000000 --- a/compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping.frag.glsl +++ /dev/null @@ -1,148 +0,0 @@ -#version 450 -#define _Billboard -#define _Instancing -#define _NormalMapping - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping.vert.glsl b/compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping.vert.glsl deleted file mode 100644 index 9b9dafd5..00000000 --- a/compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping.vert.glsl +++ /dev/null @@ -1,153 +0,0 @@ -#version 450 -#define _Billboard -#define _Instancing -#define _NormalMapping - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_Skinning.frag.glsl b/compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_Skinning.frag.glsl deleted file mode 100644 index ef53bd52..00000000 --- a/compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_Skinning.frag.glsl +++ /dev/null @@ -1,149 +0,0 @@ -#version 450 -#define _Billboard -#define _Instancing -#define _NormalMapping -#define _Skinning - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_Skinning.vert.glsl b/compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_Skinning.vert.glsl deleted file mode 100644 index f8dc088a..00000000 --- a/compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_Skinning.vert.glsl +++ /dev/null @@ -1,154 +0,0 @@ -#version 450 -#define _Billboard -#define _Instancing -#define _NormalMapping -#define _Skinning - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_Skinning_Texturing.frag.glsl b/compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_Skinning_Texturing.frag.glsl deleted file mode 100644 index bc98056b..00000000 --- a/compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_Skinning_Texturing.frag.glsl +++ /dev/null @@ -1,150 +0,0 @@ -#version 450 -#define _Billboard -#define _Instancing -#define _NormalMapping -#define _Skinning -#define _Texturing - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_Skinning_Texturing.vert.glsl b/compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_Skinning_Texturing.vert.glsl deleted file mode 100644 index 3baef458..00000000 --- a/compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_Skinning_Texturing.vert.glsl +++ /dev/null @@ -1,155 +0,0 @@ -#version 450 -#define _Billboard -#define _Instancing -#define _NormalMapping -#define _Skinning -#define _Texturing - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_Skinning_Texturing_VCols.frag.glsl b/compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_Skinning_Texturing_VCols.frag.glsl deleted file mode 100644 index 12713277..00000000 --- a/compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_Skinning_Texturing_VCols.frag.glsl +++ /dev/null @@ -1,151 +0,0 @@ -#version 450 -#define _Billboard -#define _Instancing -#define _NormalMapping -#define _Skinning -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_Skinning_Texturing_VCols.vert.glsl b/compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_Skinning_Texturing_VCols.vert.glsl deleted file mode 100644 index 303e4d18..00000000 --- a/compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_Skinning_Texturing_VCols.vert.glsl +++ /dev/null @@ -1,156 +0,0 @@ -#version 450 -#define _Billboard -#define _Instancing -#define _NormalMapping -#define _Skinning -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_Skinning_VCols.frag.glsl b/compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_Skinning_VCols.frag.glsl deleted file mode 100644 index aed674be..00000000 --- a/compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_Skinning_VCols.frag.glsl +++ /dev/null @@ -1,150 +0,0 @@ -#version 450 -#define _Billboard -#define _Instancing -#define _NormalMapping -#define _Skinning -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_Skinning_VCols.vert.glsl b/compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_Skinning_VCols.vert.glsl deleted file mode 100644 index 8d52584e..00000000 --- a/compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_Skinning_VCols.vert.glsl +++ /dev/null @@ -1,155 +0,0 @@ -#version 450 -#define _Billboard -#define _Instancing -#define _NormalMapping -#define _Skinning -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_Texturing.frag.glsl b/compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_Texturing.frag.glsl deleted file mode 100644 index 23d773f0..00000000 --- a/compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_Texturing.frag.glsl +++ /dev/null @@ -1,149 +0,0 @@ -#version 450 -#define _Billboard -#define _Instancing -#define _NormalMapping -#define _Texturing - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_Texturing.vert.glsl b/compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_Texturing.vert.glsl deleted file mode 100644 index d24f9e17..00000000 --- a/compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_Texturing.vert.glsl +++ /dev/null @@ -1,154 +0,0 @@ -#version 450 -#define _Billboard -#define _Instancing -#define _NormalMapping -#define _Texturing - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_Texturing_VCols.frag.glsl b/compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_Texturing_VCols.frag.glsl deleted file mode 100644 index 5efca850..00000000 --- a/compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_Texturing_VCols.frag.glsl +++ /dev/null @@ -1,150 +0,0 @@ -#version 450 -#define _Billboard -#define _Instancing -#define _NormalMapping -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_Texturing_VCols.vert.glsl b/compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_Texturing_VCols.vert.glsl deleted file mode 100644 index 2f03be2a..00000000 --- a/compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_Texturing_VCols.vert.glsl +++ /dev/null @@ -1,155 +0,0 @@ -#version 450 -#define _Billboard -#define _Instancing -#define _NormalMapping -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_VCols.frag.glsl b/compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_VCols.frag.glsl deleted file mode 100644 index c1d185e7..00000000 --- a/compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_VCols.frag.glsl +++ /dev/null @@ -1,149 +0,0 @@ -#version 450 -#define _Billboard -#define _Instancing -#define _NormalMapping -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_VCols.vert.glsl b/compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_VCols.vert.glsl deleted file mode 100644 index 6d7efac0..00000000 --- a/compiled/Shaders/forward/forward_Billboard_Instancing_NormalMapping_VCols.vert.glsl +++ /dev/null @@ -1,154 +0,0 @@ -#version 450 -#define _Billboard -#define _Instancing -#define _NormalMapping -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Billboard_Instancing_Skinning.frag.glsl b/compiled/Shaders/forward/forward_Billboard_Instancing_Skinning.frag.glsl deleted file mode 100644 index 88068349..00000000 --- a/compiled/Shaders/forward/forward_Billboard_Instancing_Skinning.frag.glsl +++ /dev/null @@ -1,148 +0,0 @@ -#version 450 -#define _Billboard -#define _Instancing -#define _Skinning - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Billboard_Instancing_Skinning.vert.glsl b/compiled/Shaders/forward/forward_Billboard_Instancing_Skinning.vert.glsl deleted file mode 100644 index eb12ab5d..00000000 --- a/compiled/Shaders/forward/forward_Billboard_Instancing_Skinning.vert.glsl +++ /dev/null @@ -1,153 +0,0 @@ -#version 450 -#define _Billboard -#define _Instancing -#define _Skinning - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Billboard_Instancing_Skinning_Texturing.frag.glsl b/compiled/Shaders/forward/forward_Billboard_Instancing_Skinning_Texturing.frag.glsl deleted file mode 100644 index 1da83a4c..00000000 --- a/compiled/Shaders/forward/forward_Billboard_Instancing_Skinning_Texturing.frag.glsl +++ /dev/null @@ -1,149 +0,0 @@ -#version 450 -#define _Billboard -#define _Instancing -#define _Skinning -#define _Texturing - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Billboard_Instancing_Skinning_Texturing.vert.glsl b/compiled/Shaders/forward/forward_Billboard_Instancing_Skinning_Texturing.vert.glsl deleted file mode 100644 index 236452a7..00000000 --- a/compiled/Shaders/forward/forward_Billboard_Instancing_Skinning_Texturing.vert.glsl +++ /dev/null @@ -1,154 +0,0 @@ -#version 450 -#define _Billboard -#define _Instancing -#define _Skinning -#define _Texturing - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Billboard_Instancing_Skinning_Texturing_VCols.frag.glsl b/compiled/Shaders/forward/forward_Billboard_Instancing_Skinning_Texturing_VCols.frag.glsl deleted file mode 100644 index e83162af..00000000 --- a/compiled/Shaders/forward/forward_Billboard_Instancing_Skinning_Texturing_VCols.frag.glsl +++ /dev/null @@ -1,150 +0,0 @@ -#version 450 -#define _Billboard -#define _Instancing -#define _Skinning -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Billboard_Instancing_Skinning_Texturing_VCols.vert.glsl b/compiled/Shaders/forward/forward_Billboard_Instancing_Skinning_Texturing_VCols.vert.glsl deleted file mode 100644 index 754ce3bd..00000000 --- a/compiled/Shaders/forward/forward_Billboard_Instancing_Skinning_Texturing_VCols.vert.glsl +++ /dev/null @@ -1,155 +0,0 @@ -#version 450 -#define _Billboard -#define _Instancing -#define _Skinning -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Billboard_Instancing_Skinning_VCols.frag.glsl b/compiled/Shaders/forward/forward_Billboard_Instancing_Skinning_VCols.frag.glsl deleted file mode 100644 index 57c19939..00000000 --- a/compiled/Shaders/forward/forward_Billboard_Instancing_Skinning_VCols.frag.glsl +++ /dev/null @@ -1,149 +0,0 @@ -#version 450 -#define _Billboard -#define _Instancing -#define _Skinning -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Billboard_Instancing_Skinning_VCols.vert.glsl b/compiled/Shaders/forward/forward_Billboard_Instancing_Skinning_VCols.vert.glsl deleted file mode 100644 index 6bdcd7f8..00000000 --- a/compiled/Shaders/forward/forward_Billboard_Instancing_Skinning_VCols.vert.glsl +++ /dev/null @@ -1,154 +0,0 @@ -#version 450 -#define _Billboard -#define _Instancing -#define _Skinning -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Billboard_Instancing_Texturing.frag.glsl b/compiled/Shaders/forward/forward_Billboard_Instancing_Texturing.frag.glsl deleted file mode 100644 index 41367c40..00000000 --- a/compiled/Shaders/forward/forward_Billboard_Instancing_Texturing.frag.glsl +++ /dev/null @@ -1,148 +0,0 @@ -#version 450 -#define _Billboard -#define _Instancing -#define _Texturing - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Billboard_Instancing_Texturing.vert.glsl b/compiled/Shaders/forward/forward_Billboard_Instancing_Texturing.vert.glsl deleted file mode 100644 index 07c6cf6f..00000000 --- a/compiled/Shaders/forward/forward_Billboard_Instancing_Texturing.vert.glsl +++ /dev/null @@ -1,153 +0,0 @@ -#version 450 -#define _Billboard -#define _Instancing -#define _Texturing - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Billboard_Instancing_Texturing_VCols.frag.glsl b/compiled/Shaders/forward/forward_Billboard_Instancing_Texturing_VCols.frag.glsl deleted file mode 100644 index ff394bb8..00000000 --- a/compiled/Shaders/forward/forward_Billboard_Instancing_Texturing_VCols.frag.glsl +++ /dev/null @@ -1,149 +0,0 @@ -#version 450 -#define _Billboard -#define _Instancing -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Billboard_Instancing_Texturing_VCols.vert.glsl b/compiled/Shaders/forward/forward_Billboard_Instancing_Texturing_VCols.vert.glsl deleted file mode 100644 index 12421412..00000000 --- a/compiled/Shaders/forward/forward_Billboard_Instancing_Texturing_VCols.vert.glsl +++ /dev/null @@ -1,154 +0,0 @@ -#version 450 -#define _Billboard -#define _Instancing -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Billboard_Instancing_VCols.frag.glsl b/compiled/Shaders/forward/forward_Billboard_Instancing_VCols.frag.glsl deleted file mode 100644 index 049cb996..00000000 --- a/compiled/Shaders/forward/forward_Billboard_Instancing_VCols.frag.glsl +++ /dev/null @@ -1,148 +0,0 @@ -#version 450 -#define _Billboard -#define _Instancing -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Billboard_Instancing_VCols.vert.glsl b/compiled/Shaders/forward/forward_Billboard_Instancing_VCols.vert.glsl deleted file mode 100644 index a03adf73..00000000 --- a/compiled/Shaders/forward/forward_Billboard_Instancing_VCols.vert.glsl +++ /dev/null @@ -1,153 +0,0 @@ -#version 450 -#define _Billboard -#define _Instancing -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Billboard_NormalMapping.frag.glsl b/compiled/Shaders/forward/forward_Billboard_NormalMapping.frag.glsl deleted file mode 100644 index 667f895b..00000000 --- a/compiled/Shaders/forward/forward_Billboard_NormalMapping.frag.glsl +++ /dev/null @@ -1,147 +0,0 @@ -#version 450 -#define _Billboard -#define _NormalMapping - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Billboard_NormalMapping.vert.glsl b/compiled/Shaders/forward/forward_Billboard_NormalMapping.vert.glsl deleted file mode 100644 index 74acd5a9..00000000 --- a/compiled/Shaders/forward/forward_Billboard_NormalMapping.vert.glsl +++ /dev/null @@ -1,152 +0,0 @@ -#version 450 -#define _Billboard -#define _NormalMapping - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Billboard_NormalMapping_Skinning.frag.glsl b/compiled/Shaders/forward/forward_Billboard_NormalMapping_Skinning.frag.glsl deleted file mode 100644 index da765d4a..00000000 --- a/compiled/Shaders/forward/forward_Billboard_NormalMapping_Skinning.frag.glsl +++ /dev/null @@ -1,148 +0,0 @@ -#version 450 -#define _Billboard -#define _NormalMapping -#define _Skinning - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Billboard_NormalMapping_Skinning.vert.glsl b/compiled/Shaders/forward/forward_Billboard_NormalMapping_Skinning.vert.glsl deleted file mode 100644 index 6fdb585a..00000000 --- a/compiled/Shaders/forward/forward_Billboard_NormalMapping_Skinning.vert.glsl +++ /dev/null @@ -1,153 +0,0 @@ -#version 450 -#define _Billboard -#define _NormalMapping -#define _Skinning - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Billboard_NormalMapping_Skinning_Texturing.frag.glsl b/compiled/Shaders/forward/forward_Billboard_NormalMapping_Skinning_Texturing.frag.glsl deleted file mode 100644 index 0c89585f..00000000 --- a/compiled/Shaders/forward/forward_Billboard_NormalMapping_Skinning_Texturing.frag.glsl +++ /dev/null @@ -1,149 +0,0 @@ -#version 450 -#define _Billboard -#define _NormalMapping -#define _Skinning -#define _Texturing - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Billboard_NormalMapping_Skinning_Texturing.vert.glsl b/compiled/Shaders/forward/forward_Billboard_NormalMapping_Skinning_Texturing.vert.glsl deleted file mode 100644 index d661b028..00000000 --- a/compiled/Shaders/forward/forward_Billboard_NormalMapping_Skinning_Texturing.vert.glsl +++ /dev/null @@ -1,154 +0,0 @@ -#version 450 -#define _Billboard -#define _NormalMapping -#define _Skinning -#define _Texturing - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Billboard_NormalMapping_Skinning_Texturing_VCols.frag.glsl b/compiled/Shaders/forward/forward_Billboard_NormalMapping_Skinning_Texturing_VCols.frag.glsl deleted file mode 100644 index 160c1219..00000000 --- a/compiled/Shaders/forward/forward_Billboard_NormalMapping_Skinning_Texturing_VCols.frag.glsl +++ /dev/null @@ -1,150 +0,0 @@ -#version 450 -#define _Billboard -#define _NormalMapping -#define _Skinning -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Billboard_NormalMapping_Skinning_Texturing_VCols.vert.glsl b/compiled/Shaders/forward/forward_Billboard_NormalMapping_Skinning_Texturing_VCols.vert.glsl deleted file mode 100644 index 2ddae820..00000000 --- a/compiled/Shaders/forward/forward_Billboard_NormalMapping_Skinning_Texturing_VCols.vert.glsl +++ /dev/null @@ -1,155 +0,0 @@ -#version 450 -#define _Billboard -#define _NormalMapping -#define _Skinning -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Billboard_NormalMapping_Skinning_VCols.frag.glsl b/compiled/Shaders/forward/forward_Billboard_NormalMapping_Skinning_VCols.frag.glsl deleted file mode 100644 index 49e1fd16..00000000 --- a/compiled/Shaders/forward/forward_Billboard_NormalMapping_Skinning_VCols.frag.glsl +++ /dev/null @@ -1,149 +0,0 @@ -#version 450 -#define _Billboard -#define _NormalMapping -#define _Skinning -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Billboard_NormalMapping_Skinning_VCols.vert.glsl b/compiled/Shaders/forward/forward_Billboard_NormalMapping_Skinning_VCols.vert.glsl deleted file mode 100644 index 4ebf03ea..00000000 --- a/compiled/Shaders/forward/forward_Billboard_NormalMapping_Skinning_VCols.vert.glsl +++ /dev/null @@ -1,154 +0,0 @@ -#version 450 -#define _Billboard -#define _NormalMapping -#define _Skinning -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Billboard_NormalMapping_Texturing.frag.glsl b/compiled/Shaders/forward/forward_Billboard_NormalMapping_Texturing.frag.glsl deleted file mode 100644 index e1c9efae..00000000 --- a/compiled/Shaders/forward/forward_Billboard_NormalMapping_Texturing.frag.glsl +++ /dev/null @@ -1,148 +0,0 @@ -#version 450 -#define _Billboard -#define _NormalMapping -#define _Texturing - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Billboard_NormalMapping_Texturing.vert.glsl b/compiled/Shaders/forward/forward_Billboard_NormalMapping_Texturing.vert.glsl deleted file mode 100644 index d05fef6e..00000000 --- a/compiled/Shaders/forward/forward_Billboard_NormalMapping_Texturing.vert.glsl +++ /dev/null @@ -1,153 +0,0 @@ -#version 450 -#define _Billboard -#define _NormalMapping -#define _Texturing - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Billboard_NormalMapping_Texturing_VCols.frag.glsl b/compiled/Shaders/forward/forward_Billboard_NormalMapping_Texturing_VCols.frag.glsl deleted file mode 100644 index 470b297c..00000000 --- a/compiled/Shaders/forward/forward_Billboard_NormalMapping_Texturing_VCols.frag.glsl +++ /dev/null @@ -1,149 +0,0 @@ -#version 450 -#define _Billboard -#define _NormalMapping -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Billboard_NormalMapping_Texturing_VCols.vert.glsl b/compiled/Shaders/forward/forward_Billboard_NormalMapping_Texturing_VCols.vert.glsl deleted file mode 100644 index a2f6a811..00000000 --- a/compiled/Shaders/forward/forward_Billboard_NormalMapping_Texturing_VCols.vert.glsl +++ /dev/null @@ -1,154 +0,0 @@ -#version 450 -#define _Billboard -#define _NormalMapping -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Billboard_NormalMapping_VCols.frag.glsl b/compiled/Shaders/forward/forward_Billboard_NormalMapping_VCols.frag.glsl deleted file mode 100644 index 98d9cabe..00000000 --- a/compiled/Shaders/forward/forward_Billboard_NormalMapping_VCols.frag.glsl +++ /dev/null @@ -1,148 +0,0 @@ -#version 450 -#define _Billboard -#define _NormalMapping -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Billboard_NormalMapping_VCols.vert.glsl b/compiled/Shaders/forward/forward_Billboard_NormalMapping_VCols.vert.glsl deleted file mode 100644 index c17889b6..00000000 --- a/compiled/Shaders/forward/forward_Billboard_NormalMapping_VCols.vert.glsl +++ /dev/null @@ -1,153 +0,0 @@ -#version 450 -#define _Billboard -#define _NormalMapping -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Billboard_Skinning.frag.glsl b/compiled/Shaders/forward/forward_Billboard_Skinning.frag.glsl deleted file mode 100644 index a7b6eefd..00000000 --- a/compiled/Shaders/forward/forward_Billboard_Skinning.frag.glsl +++ /dev/null @@ -1,147 +0,0 @@ -#version 450 -#define _Billboard -#define _Skinning - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Billboard_Skinning.vert.glsl b/compiled/Shaders/forward/forward_Billboard_Skinning.vert.glsl deleted file mode 100644 index c69fe0e1..00000000 --- a/compiled/Shaders/forward/forward_Billboard_Skinning.vert.glsl +++ /dev/null @@ -1,152 +0,0 @@ -#version 450 -#define _Billboard -#define _Skinning - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Billboard_Skinning_Texturing.frag.glsl b/compiled/Shaders/forward/forward_Billboard_Skinning_Texturing.frag.glsl deleted file mode 100644 index 75e53e6f..00000000 --- a/compiled/Shaders/forward/forward_Billboard_Skinning_Texturing.frag.glsl +++ /dev/null @@ -1,148 +0,0 @@ -#version 450 -#define _Billboard -#define _Skinning -#define _Texturing - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Billboard_Skinning_Texturing.vert.glsl b/compiled/Shaders/forward/forward_Billboard_Skinning_Texturing.vert.glsl deleted file mode 100644 index e23ff473..00000000 --- a/compiled/Shaders/forward/forward_Billboard_Skinning_Texturing.vert.glsl +++ /dev/null @@ -1,153 +0,0 @@ -#version 450 -#define _Billboard -#define _Skinning -#define _Texturing - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Billboard_Skinning_Texturing_VCols.frag.glsl b/compiled/Shaders/forward/forward_Billboard_Skinning_Texturing_VCols.frag.glsl deleted file mode 100644 index cf3cfdc5..00000000 --- a/compiled/Shaders/forward/forward_Billboard_Skinning_Texturing_VCols.frag.glsl +++ /dev/null @@ -1,149 +0,0 @@ -#version 450 -#define _Billboard -#define _Skinning -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Billboard_Skinning_Texturing_VCols.vert.glsl b/compiled/Shaders/forward/forward_Billboard_Skinning_Texturing_VCols.vert.glsl deleted file mode 100644 index 3073aae4..00000000 --- a/compiled/Shaders/forward/forward_Billboard_Skinning_Texturing_VCols.vert.glsl +++ /dev/null @@ -1,154 +0,0 @@ -#version 450 -#define _Billboard -#define _Skinning -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Billboard_Skinning_VCols.frag.glsl b/compiled/Shaders/forward/forward_Billboard_Skinning_VCols.frag.glsl deleted file mode 100644 index 0d1d30c1..00000000 --- a/compiled/Shaders/forward/forward_Billboard_Skinning_VCols.frag.glsl +++ /dev/null @@ -1,148 +0,0 @@ -#version 450 -#define _Billboard -#define _Skinning -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Billboard_Skinning_VCols.vert.glsl b/compiled/Shaders/forward/forward_Billboard_Skinning_VCols.vert.glsl deleted file mode 100644 index fa7145d6..00000000 --- a/compiled/Shaders/forward/forward_Billboard_Skinning_VCols.vert.glsl +++ /dev/null @@ -1,153 +0,0 @@ -#version 450 -#define _Billboard -#define _Skinning -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Billboard_Texturing.frag.glsl b/compiled/Shaders/forward/forward_Billboard_Texturing.frag.glsl deleted file mode 100644 index 692c4393..00000000 --- a/compiled/Shaders/forward/forward_Billboard_Texturing.frag.glsl +++ /dev/null @@ -1,147 +0,0 @@ -#version 450 -#define _Billboard -#define _Texturing - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Billboard_Texturing.vert.glsl b/compiled/Shaders/forward/forward_Billboard_Texturing.vert.glsl deleted file mode 100644 index 9ae864d8..00000000 --- a/compiled/Shaders/forward/forward_Billboard_Texturing.vert.glsl +++ /dev/null @@ -1,152 +0,0 @@ -#version 450 -#define _Billboard -#define _Texturing - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Billboard_Texturing_VCols.frag.glsl b/compiled/Shaders/forward/forward_Billboard_Texturing_VCols.frag.glsl deleted file mode 100644 index 0b35a476..00000000 --- a/compiled/Shaders/forward/forward_Billboard_Texturing_VCols.frag.glsl +++ /dev/null @@ -1,148 +0,0 @@ -#version 450 -#define _Billboard -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Billboard_Texturing_VCols.vert.glsl b/compiled/Shaders/forward/forward_Billboard_Texturing_VCols.vert.glsl deleted file mode 100644 index 8824af78..00000000 --- a/compiled/Shaders/forward/forward_Billboard_Texturing_VCols.vert.glsl +++ /dev/null @@ -1,153 +0,0 @@ -#version 450 -#define _Billboard -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Billboard_VCols.frag.glsl b/compiled/Shaders/forward/forward_Billboard_VCols.frag.glsl deleted file mode 100644 index 8ce0246c..00000000 --- a/compiled/Shaders/forward/forward_Billboard_VCols.frag.glsl +++ /dev/null @@ -1,147 +0,0 @@ -#version 450 -#define _Billboard -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Billboard_VCols.vert.glsl b/compiled/Shaders/forward/forward_Billboard_VCols.vert.glsl deleted file mode 100644 index 51c7eb86..00000000 --- a/compiled/Shaders/forward/forward_Billboard_VCols.vert.glsl +++ /dev/null @@ -1,152 +0,0 @@ -#version 450 -#define _Billboard -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Instancing.frag.glsl b/compiled/Shaders/forward/forward_Instancing.frag.glsl deleted file mode 100644 index 67c6f9c0..00000000 --- a/compiled/Shaders/forward/forward_Instancing.frag.glsl +++ /dev/null @@ -1,146 +0,0 @@ -#version 450 -#define _Instancing - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Instancing.vert.glsl b/compiled/Shaders/forward/forward_Instancing.vert.glsl deleted file mode 100644 index 0e46b594..00000000 --- a/compiled/Shaders/forward/forward_Instancing.vert.glsl +++ /dev/null @@ -1,151 +0,0 @@ -#version 450 -#define _Instancing - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Instancing_NormalMapping.frag.glsl b/compiled/Shaders/forward/forward_Instancing_NormalMapping.frag.glsl deleted file mode 100644 index cfb69f04..00000000 --- a/compiled/Shaders/forward/forward_Instancing_NormalMapping.frag.glsl +++ /dev/null @@ -1,147 +0,0 @@ -#version 450 -#define _Instancing -#define _NormalMapping - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Instancing_NormalMapping.vert.glsl b/compiled/Shaders/forward/forward_Instancing_NormalMapping.vert.glsl deleted file mode 100644 index b9eeb183..00000000 --- a/compiled/Shaders/forward/forward_Instancing_NormalMapping.vert.glsl +++ /dev/null @@ -1,152 +0,0 @@ -#version 450 -#define _Instancing -#define _NormalMapping - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Instancing_NormalMapping_Skinning.frag.glsl b/compiled/Shaders/forward/forward_Instancing_NormalMapping_Skinning.frag.glsl deleted file mode 100644 index 1c6894e9..00000000 --- a/compiled/Shaders/forward/forward_Instancing_NormalMapping_Skinning.frag.glsl +++ /dev/null @@ -1,148 +0,0 @@ -#version 450 -#define _Instancing -#define _NormalMapping -#define _Skinning - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Instancing_NormalMapping_Skinning.vert.glsl b/compiled/Shaders/forward/forward_Instancing_NormalMapping_Skinning.vert.glsl deleted file mode 100644 index 1c822a25..00000000 --- a/compiled/Shaders/forward/forward_Instancing_NormalMapping_Skinning.vert.glsl +++ /dev/null @@ -1,153 +0,0 @@ -#version 450 -#define _Instancing -#define _NormalMapping -#define _Skinning - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Instancing_NormalMapping_Skinning_Texturing.frag.glsl b/compiled/Shaders/forward/forward_Instancing_NormalMapping_Skinning_Texturing.frag.glsl deleted file mode 100644 index 1cbfee6a..00000000 --- a/compiled/Shaders/forward/forward_Instancing_NormalMapping_Skinning_Texturing.frag.glsl +++ /dev/null @@ -1,149 +0,0 @@ -#version 450 -#define _Instancing -#define _NormalMapping -#define _Skinning -#define _Texturing - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Instancing_NormalMapping_Skinning_Texturing.vert.glsl b/compiled/Shaders/forward/forward_Instancing_NormalMapping_Skinning_Texturing.vert.glsl deleted file mode 100644 index 32253e55..00000000 --- a/compiled/Shaders/forward/forward_Instancing_NormalMapping_Skinning_Texturing.vert.glsl +++ /dev/null @@ -1,154 +0,0 @@ -#version 450 -#define _Instancing -#define _NormalMapping -#define _Skinning -#define _Texturing - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Instancing_NormalMapping_Skinning_Texturing_VCols.frag.glsl b/compiled/Shaders/forward/forward_Instancing_NormalMapping_Skinning_Texturing_VCols.frag.glsl deleted file mode 100644 index a398e06c..00000000 --- a/compiled/Shaders/forward/forward_Instancing_NormalMapping_Skinning_Texturing_VCols.frag.glsl +++ /dev/null @@ -1,150 +0,0 @@ -#version 450 -#define _Instancing -#define _NormalMapping -#define _Skinning -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Instancing_NormalMapping_Skinning_Texturing_VCols.vert.glsl b/compiled/Shaders/forward/forward_Instancing_NormalMapping_Skinning_Texturing_VCols.vert.glsl deleted file mode 100644 index ad61f5b8..00000000 --- a/compiled/Shaders/forward/forward_Instancing_NormalMapping_Skinning_Texturing_VCols.vert.glsl +++ /dev/null @@ -1,155 +0,0 @@ -#version 450 -#define _Instancing -#define _NormalMapping -#define _Skinning -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Instancing_NormalMapping_Skinning_VCols.frag.glsl b/compiled/Shaders/forward/forward_Instancing_NormalMapping_Skinning_VCols.frag.glsl deleted file mode 100644 index efa2a60c..00000000 --- a/compiled/Shaders/forward/forward_Instancing_NormalMapping_Skinning_VCols.frag.glsl +++ /dev/null @@ -1,149 +0,0 @@ -#version 450 -#define _Instancing -#define _NormalMapping -#define _Skinning -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Instancing_NormalMapping_Skinning_VCols.vert.glsl b/compiled/Shaders/forward/forward_Instancing_NormalMapping_Skinning_VCols.vert.glsl deleted file mode 100644 index 8d638e9d..00000000 --- a/compiled/Shaders/forward/forward_Instancing_NormalMapping_Skinning_VCols.vert.glsl +++ /dev/null @@ -1,154 +0,0 @@ -#version 450 -#define _Instancing -#define _NormalMapping -#define _Skinning -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Instancing_NormalMapping_Texturing.frag.glsl b/compiled/Shaders/forward/forward_Instancing_NormalMapping_Texturing.frag.glsl deleted file mode 100644 index ab744c23..00000000 --- a/compiled/Shaders/forward/forward_Instancing_NormalMapping_Texturing.frag.glsl +++ /dev/null @@ -1,148 +0,0 @@ -#version 450 -#define _Instancing -#define _NormalMapping -#define _Texturing - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Instancing_NormalMapping_Texturing.vert.glsl b/compiled/Shaders/forward/forward_Instancing_NormalMapping_Texturing.vert.glsl deleted file mode 100644 index e46253e3..00000000 --- a/compiled/Shaders/forward/forward_Instancing_NormalMapping_Texturing.vert.glsl +++ /dev/null @@ -1,153 +0,0 @@ -#version 450 -#define _Instancing -#define _NormalMapping -#define _Texturing - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Instancing_NormalMapping_Texturing_VCols.frag.glsl b/compiled/Shaders/forward/forward_Instancing_NormalMapping_Texturing_VCols.frag.glsl deleted file mode 100644 index 2f1e5244..00000000 --- a/compiled/Shaders/forward/forward_Instancing_NormalMapping_Texturing_VCols.frag.glsl +++ /dev/null @@ -1,149 +0,0 @@ -#version 450 -#define _Instancing -#define _NormalMapping -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Instancing_NormalMapping_Texturing_VCols.vert.glsl b/compiled/Shaders/forward/forward_Instancing_NormalMapping_Texturing_VCols.vert.glsl deleted file mode 100644 index e69170e0..00000000 --- a/compiled/Shaders/forward/forward_Instancing_NormalMapping_Texturing_VCols.vert.glsl +++ /dev/null @@ -1,154 +0,0 @@ -#version 450 -#define _Instancing -#define _NormalMapping -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Instancing_NormalMapping_VCols.frag.glsl b/compiled/Shaders/forward/forward_Instancing_NormalMapping_VCols.frag.glsl deleted file mode 100644 index 7127fd9c..00000000 --- a/compiled/Shaders/forward/forward_Instancing_NormalMapping_VCols.frag.glsl +++ /dev/null @@ -1,148 +0,0 @@ -#version 450 -#define _Instancing -#define _NormalMapping -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Instancing_NormalMapping_VCols.vert.glsl b/compiled/Shaders/forward/forward_Instancing_NormalMapping_VCols.vert.glsl deleted file mode 100644 index 796fc13a..00000000 --- a/compiled/Shaders/forward/forward_Instancing_NormalMapping_VCols.vert.glsl +++ /dev/null @@ -1,153 +0,0 @@ -#version 450 -#define _Instancing -#define _NormalMapping -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Instancing_Skinning.frag.glsl b/compiled/Shaders/forward/forward_Instancing_Skinning.frag.glsl deleted file mode 100644 index faa0326c..00000000 --- a/compiled/Shaders/forward/forward_Instancing_Skinning.frag.glsl +++ /dev/null @@ -1,147 +0,0 @@ -#version 450 -#define _Instancing -#define _Skinning - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Instancing_Skinning.vert.glsl b/compiled/Shaders/forward/forward_Instancing_Skinning.vert.glsl deleted file mode 100644 index 9b6cc373..00000000 --- a/compiled/Shaders/forward/forward_Instancing_Skinning.vert.glsl +++ /dev/null @@ -1,152 +0,0 @@ -#version 450 -#define _Instancing -#define _Skinning - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Instancing_Skinning_Texturing.frag.glsl b/compiled/Shaders/forward/forward_Instancing_Skinning_Texturing.frag.glsl deleted file mode 100644 index fad890ce..00000000 --- a/compiled/Shaders/forward/forward_Instancing_Skinning_Texturing.frag.glsl +++ /dev/null @@ -1,148 +0,0 @@ -#version 450 -#define _Instancing -#define _Skinning -#define _Texturing - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Instancing_Skinning_Texturing.vert.glsl b/compiled/Shaders/forward/forward_Instancing_Skinning_Texturing.vert.glsl deleted file mode 100644 index 30b416bd..00000000 --- a/compiled/Shaders/forward/forward_Instancing_Skinning_Texturing.vert.glsl +++ /dev/null @@ -1,153 +0,0 @@ -#version 450 -#define _Instancing -#define _Skinning -#define _Texturing - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Instancing_Skinning_Texturing_VCols.frag.glsl b/compiled/Shaders/forward/forward_Instancing_Skinning_Texturing_VCols.frag.glsl deleted file mode 100644 index b4974d73..00000000 --- a/compiled/Shaders/forward/forward_Instancing_Skinning_Texturing_VCols.frag.glsl +++ /dev/null @@ -1,149 +0,0 @@ -#version 450 -#define _Instancing -#define _Skinning -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Instancing_Skinning_Texturing_VCols.vert.glsl b/compiled/Shaders/forward/forward_Instancing_Skinning_Texturing_VCols.vert.glsl deleted file mode 100644 index d182a492..00000000 --- a/compiled/Shaders/forward/forward_Instancing_Skinning_Texturing_VCols.vert.glsl +++ /dev/null @@ -1,154 +0,0 @@ -#version 450 -#define _Instancing -#define _Skinning -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Instancing_Skinning_VCols.frag.glsl b/compiled/Shaders/forward/forward_Instancing_Skinning_VCols.frag.glsl deleted file mode 100644 index df62e271..00000000 --- a/compiled/Shaders/forward/forward_Instancing_Skinning_VCols.frag.glsl +++ /dev/null @@ -1,148 +0,0 @@ -#version 450 -#define _Instancing -#define _Skinning -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Instancing_Skinning_VCols.vert.glsl b/compiled/Shaders/forward/forward_Instancing_Skinning_VCols.vert.glsl deleted file mode 100644 index 293ee68e..00000000 --- a/compiled/Shaders/forward/forward_Instancing_Skinning_VCols.vert.glsl +++ /dev/null @@ -1,153 +0,0 @@ -#version 450 -#define _Instancing -#define _Skinning -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Instancing_Texturing.frag.glsl b/compiled/Shaders/forward/forward_Instancing_Texturing.frag.glsl deleted file mode 100644 index 6877fcf5..00000000 --- a/compiled/Shaders/forward/forward_Instancing_Texturing.frag.glsl +++ /dev/null @@ -1,147 +0,0 @@ -#version 450 -#define _Instancing -#define _Texturing - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Instancing_Texturing.vert.glsl b/compiled/Shaders/forward/forward_Instancing_Texturing.vert.glsl deleted file mode 100644 index 073484a0..00000000 --- a/compiled/Shaders/forward/forward_Instancing_Texturing.vert.glsl +++ /dev/null @@ -1,152 +0,0 @@ -#version 450 -#define _Instancing -#define _Texturing - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Instancing_Texturing_VCols.frag.glsl b/compiled/Shaders/forward/forward_Instancing_Texturing_VCols.frag.glsl deleted file mode 100644 index 8554840a..00000000 --- a/compiled/Shaders/forward/forward_Instancing_Texturing_VCols.frag.glsl +++ /dev/null @@ -1,148 +0,0 @@ -#version 450 -#define _Instancing -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Instancing_Texturing_VCols.vert.glsl b/compiled/Shaders/forward/forward_Instancing_Texturing_VCols.vert.glsl deleted file mode 100644 index 99c176a5..00000000 --- a/compiled/Shaders/forward/forward_Instancing_Texturing_VCols.vert.glsl +++ /dev/null @@ -1,153 +0,0 @@ -#version 450 -#define _Instancing -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Instancing_VCols.frag.glsl b/compiled/Shaders/forward/forward_Instancing_VCols.frag.glsl deleted file mode 100644 index 7125ce72..00000000 --- a/compiled/Shaders/forward/forward_Instancing_VCols.frag.glsl +++ /dev/null @@ -1,147 +0,0 @@ -#version 450 -#define _Instancing -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Instancing_VCols.vert.glsl b/compiled/Shaders/forward/forward_Instancing_VCols.vert.glsl deleted file mode 100644 index c7ea30f6..00000000 --- a/compiled/Shaders/forward/forward_Instancing_VCols.vert.glsl +++ /dev/null @@ -1,152 +0,0 @@ -#version 450 -#define _Instancing -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_NormalMapping.frag.glsl b/compiled/Shaders/forward/forward_NormalMapping.frag.glsl deleted file mode 100644 index fa7d65cb..00000000 --- a/compiled/Shaders/forward/forward_NormalMapping.frag.glsl +++ /dev/null @@ -1,146 +0,0 @@ -#version 450 -#define _NormalMapping - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_NormalMapping.vert.glsl b/compiled/Shaders/forward/forward_NormalMapping.vert.glsl deleted file mode 100644 index f85f66e2..00000000 --- a/compiled/Shaders/forward/forward_NormalMapping.vert.glsl +++ /dev/null @@ -1,151 +0,0 @@ -#version 450 -#define _NormalMapping - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_NormalMapping_Skinning.frag.glsl b/compiled/Shaders/forward/forward_NormalMapping_Skinning.frag.glsl deleted file mode 100644 index ad871abd..00000000 --- a/compiled/Shaders/forward/forward_NormalMapping_Skinning.frag.glsl +++ /dev/null @@ -1,147 +0,0 @@ -#version 450 -#define _NormalMapping -#define _Skinning - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_NormalMapping_Skinning.vert.glsl b/compiled/Shaders/forward/forward_NormalMapping_Skinning.vert.glsl deleted file mode 100644 index 64ebc1e5..00000000 --- a/compiled/Shaders/forward/forward_NormalMapping_Skinning.vert.glsl +++ /dev/null @@ -1,152 +0,0 @@ -#version 450 -#define _NormalMapping -#define _Skinning - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_NormalMapping_Skinning_Texturing.frag.glsl b/compiled/Shaders/forward/forward_NormalMapping_Skinning_Texturing.frag.glsl deleted file mode 100644 index a7e7a65a..00000000 --- a/compiled/Shaders/forward/forward_NormalMapping_Skinning_Texturing.frag.glsl +++ /dev/null @@ -1,148 +0,0 @@ -#version 450 -#define _NormalMapping -#define _Skinning -#define _Texturing - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_NormalMapping_Skinning_Texturing.vert.glsl b/compiled/Shaders/forward/forward_NormalMapping_Skinning_Texturing.vert.glsl deleted file mode 100644 index 7a496130..00000000 --- a/compiled/Shaders/forward/forward_NormalMapping_Skinning_Texturing.vert.glsl +++ /dev/null @@ -1,153 +0,0 @@ -#version 450 -#define _NormalMapping -#define _Skinning -#define _Texturing - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_NormalMapping_Skinning_Texturing_VCols.frag.glsl b/compiled/Shaders/forward/forward_NormalMapping_Skinning_Texturing_VCols.frag.glsl deleted file mode 100644 index c5df90ee..00000000 --- a/compiled/Shaders/forward/forward_NormalMapping_Skinning_Texturing_VCols.frag.glsl +++ /dev/null @@ -1,149 +0,0 @@ -#version 450 -#define _NormalMapping -#define _Skinning -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_NormalMapping_Skinning_Texturing_VCols.vert.glsl b/compiled/Shaders/forward/forward_NormalMapping_Skinning_Texturing_VCols.vert.glsl deleted file mode 100644 index cd92890e..00000000 --- a/compiled/Shaders/forward/forward_NormalMapping_Skinning_Texturing_VCols.vert.glsl +++ /dev/null @@ -1,154 +0,0 @@ -#version 450 -#define _NormalMapping -#define _Skinning -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_NormalMapping_Skinning_VCols.frag.glsl b/compiled/Shaders/forward/forward_NormalMapping_Skinning_VCols.frag.glsl deleted file mode 100644 index 13c20219..00000000 --- a/compiled/Shaders/forward/forward_NormalMapping_Skinning_VCols.frag.glsl +++ /dev/null @@ -1,148 +0,0 @@ -#version 450 -#define _NormalMapping -#define _Skinning -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_NormalMapping_Skinning_VCols.vert.glsl b/compiled/Shaders/forward/forward_NormalMapping_Skinning_VCols.vert.glsl deleted file mode 100644 index c8f80ade..00000000 --- a/compiled/Shaders/forward/forward_NormalMapping_Skinning_VCols.vert.glsl +++ /dev/null @@ -1,153 +0,0 @@ -#version 450 -#define _NormalMapping -#define _Skinning -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_NormalMapping_Texturing.frag.glsl b/compiled/Shaders/forward/forward_NormalMapping_Texturing.frag.glsl deleted file mode 100644 index b6cd0046..00000000 --- a/compiled/Shaders/forward/forward_NormalMapping_Texturing.frag.glsl +++ /dev/null @@ -1,147 +0,0 @@ -#version 450 -#define _NormalMapping -#define _Texturing - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_NormalMapping_Texturing.vert.glsl b/compiled/Shaders/forward/forward_NormalMapping_Texturing.vert.glsl deleted file mode 100644 index 4dc4dadd..00000000 --- a/compiled/Shaders/forward/forward_NormalMapping_Texturing.vert.glsl +++ /dev/null @@ -1,152 +0,0 @@ -#version 450 -#define _NormalMapping -#define _Texturing - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_NormalMapping_Texturing_VCols.frag.glsl b/compiled/Shaders/forward/forward_NormalMapping_Texturing_VCols.frag.glsl deleted file mode 100644 index 98c386e7..00000000 --- a/compiled/Shaders/forward/forward_NormalMapping_Texturing_VCols.frag.glsl +++ /dev/null @@ -1,148 +0,0 @@ -#version 450 -#define _NormalMapping -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_NormalMapping_Texturing_VCols.vert.glsl b/compiled/Shaders/forward/forward_NormalMapping_Texturing_VCols.vert.glsl deleted file mode 100644 index 903cb890..00000000 --- a/compiled/Shaders/forward/forward_NormalMapping_Texturing_VCols.vert.glsl +++ /dev/null @@ -1,153 +0,0 @@ -#version 450 -#define _NormalMapping -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_NormalMapping_VCols.frag.glsl b/compiled/Shaders/forward/forward_NormalMapping_VCols.frag.glsl deleted file mode 100644 index b9b6730e..00000000 --- a/compiled/Shaders/forward/forward_NormalMapping_VCols.frag.glsl +++ /dev/null @@ -1,147 +0,0 @@ -#version 450 -#define _NormalMapping -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_NormalMapping_VCols.vert.glsl b/compiled/Shaders/forward/forward_NormalMapping_VCols.vert.glsl deleted file mode 100644 index d3fb271c..00000000 --- a/compiled/Shaders/forward/forward_NormalMapping_VCols.vert.glsl +++ /dev/null @@ -1,152 +0,0 @@ -#version 450 -#define _NormalMapping -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Skinning.frag.glsl b/compiled/Shaders/forward/forward_Skinning.frag.glsl deleted file mode 100644 index 5936d7c2..00000000 --- a/compiled/Shaders/forward/forward_Skinning.frag.glsl +++ /dev/null @@ -1,146 +0,0 @@ -#version 450 -#define _Skinning - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Skinning.vert.glsl b/compiled/Shaders/forward/forward_Skinning.vert.glsl deleted file mode 100644 index 4892a50e..00000000 --- a/compiled/Shaders/forward/forward_Skinning.vert.glsl +++ /dev/null @@ -1,151 +0,0 @@ -#version 450 -#define _Skinning - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Skinning_Texturing.frag.glsl b/compiled/Shaders/forward/forward_Skinning_Texturing.frag.glsl deleted file mode 100644 index 3c99f419..00000000 --- a/compiled/Shaders/forward/forward_Skinning_Texturing.frag.glsl +++ /dev/null @@ -1,147 +0,0 @@ -#version 450 -#define _Skinning -#define _Texturing - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Skinning_Texturing.vert.glsl b/compiled/Shaders/forward/forward_Skinning_Texturing.vert.glsl deleted file mode 100644 index b7950d6e..00000000 --- a/compiled/Shaders/forward/forward_Skinning_Texturing.vert.glsl +++ /dev/null @@ -1,152 +0,0 @@ -#version 450 -#define _Skinning -#define _Texturing - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Skinning_Texturing_VCols.frag.glsl b/compiled/Shaders/forward/forward_Skinning_Texturing_VCols.frag.glsl deleted file mode 100644 index b47fabfb..00000000 --- a/compiled/Shaders/forward/forward_Skinning_Texturing_VCols.frag.glsl +++ /dev/null @@ -1,148 +0,0 @@ -#version 450 -#define _Skinning -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Skinning_Texturing_VCols.vert.glsl b/compiled/Shaders/forward/forward_Skinning_Texturing_VCols.vert.glsl deleted file mode 100644 index 11a01923..00000000 --- a/compiled/Shaders/forward/forward_Skinning_Texturing_VCols.vert.glsl +++ /dev/null @@ -1,153 +0,0 @@ -#version 450 -#define _Skinning -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Skinning_VCols.frag.glsl b/compiled/Shaders/forward/forward_Skinning_VCols.frag.glsl deleted file mode 100644 index 7866451e..00000000 --- a/compiled/Shaders/forward/forward_Skinning_VCols.frag.glsl +++ /dev/null @@ -1,147 +0,0 @@ -#version 450 -#define _Skinning -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Skinning_VCols.vert.glsl b/compiled/Shaders/forward/forward_Skinning_VCols.vert.glsl deleted file mode 100644 index 4560592b..00000000 --- a/compiled/Shaders/forward/forward_Skinning_VCols.vert.glsl +++ /dev/null @@ -1,152 +0,0 @@ -#version 450 -#define _Skinning -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Texturing.frag.glsl b/compiled/Shaders/forward/forward_Texturing.frag.glsl deleted file mode 100644 index d859a229..00000000 --- a/compiled/Shaders/forward/forward_Texturing.frag.glsl +++ /dev/null @@ -1,146 +0,0 @@ -#version 450 -#define _Texturing - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Texturing.vert.glsl b/compiled/Shaders/forward/forward_Texturing.vert.glsl deleted file mode 100644 index 5c9ea67b..00000000 --- a/compiled/Shaders/forward/forward_Texturing.vert.glsl +++ /dev/null @@ -1,151 +0,0 @@ -#version 450 -#define _Texturing - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_Texturing_VCols.frag.glsl b/compiled/Shaders/forward/forward_Texturing_VCols.frag.glsl deleted file mode 100644 index 568dc038..00000000 --- a/compiled/Shaders/forward/forward_Texturing_VCols.frag.glsl +++ /dev/null @@ -1,147 +0,0 @@ -#version 450 -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_Texturing_VCols.vert.glsl b/compiled/Shaders/forward/forward_Texturing_VCols.vert.glsl deleted file mode 100644 index abc8bc2f..00000000 --- a/compiled/Shaders/forward/forward_Texturing_VCols.vert.glsl +++ /dev/null @@ -1,152 +0,0 @@ -#version 450 -#define _Texturing -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/compiled/Shaders/forward/forward_VCols.frag.glsl b/compiled/Shaders/forward/forward_VCols.frag.glsl deleted file mode 100644 index e91eaf9d..00000000 --- a/compiled/Shaders/forward/forward_VCols.frag.glsl +++ /dev/null @@ -1,146 +0,0 @@ -#version 450 -#define _VCols - -#ifdef GL_ES -precision mediump float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -#ifdef _Texturing -uniform sampler2D salbedo; -#endif -uniform sampler2D shadowMap; -#ifdef _NormalMapping -uniform sampler2D snormal; -#endif -uniform bool lighting; -uniform bool receiveShadow; -uniform float roughness; -uniform float metalness; - -in vec3 position; -#ifdef _Texturing -in vec2 texCoord; -#endif -in vec3 normal; -in vec4 lPos; -in vec4 matColor; -in vec3 lightDir; -in vec3 eyeDir; - -float shadowSimple(vec4 lPos) { - vec4 lPosH = lPos / lPos.w; - - lPosH.x = (lPosH.x + 1.0) / 2.0; - lPosH.y = 1.0 - ((-lPosH.y + 1.0) / (2.0)); - - vec4 packedZValue = texture(shadowMap, lPosH.st); - - float distanceFromLight = packedZValue.z; - - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; - - // 1.0 = not in shadow, 0.0 = in shadow - return float(distanceFromLight > lPosH.z - bias); -} - -vec2 LightingFuncGGX_FV(float dotLH, float roughness) { - float alpha = roughness*roughness; - - // F - float F_a, F_b; - float dotLH5 = pow(1.0 - dotLH, 5.0); - F_a = 1.0; - F_b = dotLH5; - - // V - float vis; - float k = alpha / 2.0; - float k2 = k * k; - float invK2 = 1.0 - k2; - //vis = rcp(dotLH * dotLH * invK2 + k2); - vis = inversesqrt(dotLH * dotLH * invK2 + k2); - - return vec2(F_a * vis, F_b * vis); -} - -float LightingFuncGGX_D(float dotNH, float roughness) { - float alpha = roughness * roughness; - float alphaSqr = alpha * alpha; - float pi = 3.14159; - float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; - - float D = alphaSqr / (pi * denom * denom); - return D; -} - -// John Hable - Optimizing GGX Shaders -// http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); - - float D = LightingFuncGGX_D(dotNH, roughness); - vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); - float FV = F0 * FV_helper.x + (1.0 - F0) * FV_helper.y; - float specular = dotNL * D * FV; - - return specular; -} - -void main() { - float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); - } - -#ifdef _Texturing - vec4 texel = texture(salbedo, texCoord); - -#ifdef _AlphaTest - if(texel.a < 0.4) - discard; -#endif - - outColor = vec4(texel * outColor); -#else - outColor = vec4(outColor.rgb, 1.0); -#endif - - gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); -} diff --git a/compiled/Shaders/forward/forward_VCols.vert.glsl b/compiled/Shaders/forward/forward_VCols.vert.glsl deleted file mode 100644 index a7fa26bc..00000000 --- a/compiled/Shaders/forward/forward_VCols.vert.glsl +++ /dev/null @@ -1,151 +0,0 @@ -#version 450 -#define _VCols - -#ifdef GL_ES -precision highp float; -#endif - -#ifdef _NormalMapping -#define _Texturing -#endif - -in vec3 pos; -in vec3 nor; -#ifdef _Texturing -in vec2 tex; -#endif -#ifdef _VCols -in vec4 col; -#endif -#ifdef _NormalMapping -in vec3 tan; -#endif -#ifdef _Skinning -in vec4 bone; -in vec4 weight; -#endif -#ifdef _Instancing -in vec3 off; -#endif - -uniform mat4 M; -uniform mat4 NM; -uniform mat4 V; -uniform mat4 P; -uniform mat4 LMVP; -uniform vec4 albedo_color; -uniform vec3 light; -uniform vec3 eye; -#ifdef _Skinning -uniform float skinBones[50 * 12]; -#endif - -out vec3 position; -#ifdef _Texturing -out vec2 texCoord; -#endif -out vec3 normal; -out vec4 lPos; -out vec4 matColor; -out vec3 lightDir; -out vec3 eyeDir; - -#ifdef _NormalMapping -mat3 transpose(mat3 m) { - return mat3(m[0][0], m[1][0], m[2][0], - m[0][1], m[1][1], m[2][1], - m[0][2], m[1][2], m[2][2]); -} -#endif - -#ifdef _Skinning -mat4 getBoneMat(const int boneIndex) { - vec4 v0 = vec4(skinBones[boneIndex * 12 + 0], - skinBones[boneIndex * 12 + 1], - skinBones[boneIndex * 12 + 2], - skinBones[boneIndex * 12 + 3]); - vec4 v1 = vec4(skinBones[boneIndex * 12 + 4], - skinBones[boneIndex * 12 + 5], - skinBones[boneIndex * 12 + 6], - skinBones[boneIndex * 12 + 7]); - vec4 v2 = vec4(skinBones[boneIndex * 12 + 8], - skinBones[boneIndex * 12 + 9], - skinBones[boneIndex * 12 + 10], - skinBones[boneIndex * 12 + 11]); - return mat4(v0.x, v0.y, v0.z, v0.w, - v1.x, v1.y, v1.z, v1.w, - v2.x, v2.y, v2.z, v2.w, - 0, 0, 0, 1); -} - -mat4 getSkinningMat() { - return weight.x * getBoneMat(int(bone.x)) + - weight.y * getBoneMat(int(bone.y)) + - weight.z * getBoneMat(int(bone.z)) + - weight.w * getBoneMat(int(bone.w)); -} - -mat3 getSkinningMatVec(const mat4 skinningMat) { - return mat3(skinningMat[0].xyz, skinningMat[1].xyz, skinningMat[2].xyz); -} -#endif - -void main() { - -#ifdef _Instancing - vec4 sPos = (vec4(pos + off, 1.0)); -#else - vec4 sPos = (vec4(pos, 1.0)); -#endif -#ifdef _Skinning - mat4 skinningMat = getSkinningMat(); - mat3 skinningMatVec = getSkinningMatVec(skinningMat); - sPos = sPos * skinningMat; -#endif - lPos = LMVP * sPos; - - mat4 VM = V * M; - -#ifdef _Billboard - // Spherical - VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - VM[1][0] = 0.0; VM[1][1] = 1.0; VM[1][2] = 0.0; - VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; - // Cylindrical - //VM[0][0] = 1.0; VM[0][1] = 0.0; VM[0][2] = 0.0; - //VM[2][0] = 0.0; VM[2][1] = 0.0; VM[2][2] = 1.0; -#endif - - gl_Position = P * VM * sPos; - - vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; - -#ifdef _Texturing - texCoord = tex; -#endif - -#ifdef _Skinning - normal = normalize(mat3(NM) * (nor * skinningMatVec)); -#else - normal = normalize(mat3(NM) * nor); -#endif - - matColor = albedo_color; - -#ifdef _VCols - matColor *= col; -#endif - -#ifdef _NormalMapping - vec3 vtan = (tan); - vec3 vbitan = cross(normal, vtan) * 1.0;//tangent.w; - - mat3 TBN = transpose(mat3(vtan, vbitan, normal)); - lightDir = normalize(TBN * lightDir); - eyeDir = normalize(TBN * eyeDir); -#else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); -#endif -} diff --git a/raw/forward/forward.frag.glsl b/raw/forward/forward.frag.glsl index 7c45bf41..c30f7c69 100644 --- a/raw/forward/forward.frag.glsl +++ b/raw/forward/forward.frag.glsl @@ -4,6 +4,9 @@ precision mediump float; #endif +#define PI 3.1415926535 +#define TwoPI (2.0 * PI) + #ifdef _NormalMapping #define _Texturing #endif @@ -12,6 +15,8 @@ precision mediump float; uniform sampler2D salbedo; #endif uniform sampler2D shadowMap; +uniform sampler2D senvmap; +uniform sampler2D senvmaplod; #ifdef _NormalMapping uniform sampler2D snormal; #endif @@ -30,7 +35,8 @@ in vec4 matColor; in vec3 lightDir; in vec3 eyeDir; -float shadowSimple(vec4 lPos) { + +float shadowTest(vec4 lPos, float dotNL) { vec4 lPosH = lPos / lPos.w; lPosH.x = (lPosH.x + 1.0) / 2.0; @@ -40,13 +46,20 @@ float shadowSimple(vec4 lPos) { float distanceFromLight = packedZValue.z; - //float bias = clamp(0.005*tan(acos(dotNL)), 0, 0.01); - float bias = 0.0;//0.0005; + float bias = clamp(0.005 * tan(acos(dotNL)), 0.0, 0.01); // 1.0 = not in shadow, 0.0 = in shadow return float(distanceFromLight > lPosH.z - bias); } + +vec2 envMapEquirect(vec3 n) { + float phi = acos(n.z); + float theta = atan(n.x, n.y) + PI; + return vec2(theta / TwoPI, phi / PI); +} + + vec2 LightingFuncGGX_FV(float dotLH, float roughness) { float alpha = roughness*roughness; @@ -79,12 +92,11 @@ float LightingFuncGGX_D(float dotNH, float roughness) { // John Hable - Optimizing GGX Shaders // http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/ -float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { - vec3 H = normalize(V + L); - - float dotNL = clamp(dot(N, L), 0.0, 1.0); - float dotLH = clamp(dot(L, H), 0.0, 1.0); - float dotNH = clamp(dot(N, H), 0.0, 1.0); +float LightingFuncGGX_OPT3(float dotNL, float dotLH, float dotNH, float roughness, float F0) { + // vec3 H = normalize(V + L); + // float dotNL = clamp(dot(N, L), 0.0, 1.0); + // float dotLH = clamp(dot(L, H), 0.0, 1.0); + // float dotNH = clamp(dot(N, H), 0.0, 1.0); float D = LightingFuncGGX_D(dotNH, roughness); vec2 FV_helper = LightingFuncGGX_FV(dotLH, roughness); @@ -94,52 +106,135 @@ float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) { return specular; } +vec3 f_schlick(vec3 f0, float vh) { + return f0 + (1.0-f0)*exp2((-5.55473 * vh - 6.98316)*vh); +} + +float v_smithschlick(float nl, float nv, float a) { + return 1.0 / ( (nl*(1.0-a)+a) * (nv*(1.0-a)+a) ); +} + +float d_ggx(float nh, float a) { + float a2 = a*a; + float denom = pow(nh*nh * (a2-1.0) + 1.0, 2.0); + return a2 * (1.0 / 3.1415926535) / denom; +} + +vec3 specularBRDF(vec3 f0, float roughness, float nl, float nh, float nv, float vh, float lh) { + float a = roughness * roughness; + return d_ggx(nh, a) * clamp(v_smithschlick(nl, nv, a), 0.0, 1.0) * f_schlick(f0, vh) / 4.0; + //return vec3(LightingFuncGGX_OPT3(nl, lh, nh, roughness, f0[0])); +} + + +vec3 lambert(vec3 albedo, float nl) { + return albedo * max(0.0, nl); +} + +vec3 burley(vec3 albedo, float roughness, float NoV, float NoL, float VoH) { + float FD90 = 0.5 + 2 * VoH * VoH * roughness; + float FdV = 1 + (FD90 - 1) * pow( 1 - NoV, 5 ); + float FdL = 1 + (FD90 - 1) * pow( 1 - NoL, 5 ); + return albedo * ( (1.0 / 3.1415926535) * FdV * FdL ); +} + +vec3 orenNayar(vec3 albedo, float roughness, float NoV, float NoL, float VoH ) { + float pi = 3.1415926535; + float a = roughness * roughness; + float s = a;// / ( 1.29 + 0.5 * a ); + float s2 = s * s; + float VoL = 2.0 * VoH * VoH - 1.0; // double angle identity + float Cosri = VoL - NoV * NoL; + float C1 = 1.0 - 0.5 * s2 / (s2 + 0.33); + float test = 1.0; + if (Cosri >= 0.0) test = (1.0 / ( max( NoL, NoV ) )); + float C2 = 0.45 * s2 / (s2 + 0.09) * Cosri * test; + return albedo / pi * ( C1 + C2 ) * ( 1.0 + roughness * 0.5 ); +} + +vec3 diffuseBRDF(vec3 albedo, float roughness, float nv, float nl, float vh, float lv) { + return lambert(albedo, nl); + //return burley(albedo, roughness, nv, nl, vh); + //return orenNayar(albedo, roughness, lv, nl, nv); +} + +vec3 surfaceAlbedo(vec3 baseColor, float metalness) { + return mix(baseColor, vec3(0.0), metalness); +} + +vec3 surfaceF0(vec3 baseColor, float metalness) { + return mix(vec3(0.04), baseColor, metalness); +} + void main() { + vec3 n = normalize(normal); + vec3 l = normalize(lightDir); + float dotNL = max(dot(n, l), 0.0); + float visibility = 1.0; - // if (receiveShadow && lPos.w > 0.0) { - // visibility = shadowSimple(lPos); - // visibility = (visibility * 0.8) + 0.2; - // } - - vec4 outColor; - vec3 t = pow(matColor.rgb, vec3(2.2)); - - if (lighting) { - float specular = 0.1; - - vec3 n = normalize(normal); - vec3 l = lightDir; - vec3 v = eyeDir; - - float dotNL = 0.0; -#ifdef _NormalMapping - vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); - dotNL = clamp(dot(tn, l), 0.0, 1.0); -#else - dotNL = clamp(dot(n, l), 0.0, 1.0); -#endif - - float spec = LightingFuncGGX_OPT3(n, v, l, roughness, specular); - vec3 rgb = spec + t * dotNL; - - outColor = vec4(vec3(rgb * visibility), 1.0); - } - else { - outColor = vec4(t * visibility, 1.0); + if (receiveShadow) { + if (lPos.w > 0.0) { + visibility = shadowTest(lPos, dotNL); + visibility = (visibility * 0.8) + 0.2; + } } #ifdef _Texturing vec4 texel = texture(salbedo, texCoord); - #ifdef _AlphaTest if(texel.a < 0.4) discard; #endif - - outColor = vec4(texel * outColor); + vec3 baseColor = texel.rgb; #else - outColor = vec4(outColor.rgb, 1.0); + vec3 baseColor = matColor.rgb; #endif + baseColor = pow(baseColor.rgb, vec3(2.2)); + vec4 outColor; + + if (lighting) { + vec3 v = normalize(eyeDir); + vec3 h = normalize(v + l); + +#ifdef _NormalMapping + vec3 tn = normalize(texture(snormal, texCoord).rgb * 2.0 - 1.0); + //float dotNL = clamp(dot(tn, l), 0.0, 1.0); +#else + //float dotNL = clamp(dot(n, l), 0.0, 1.0); +#endif + float dotNV = max(dot(n, v), 0.0); + float dotNH = max(dot(n, h), 0.0); + float dotVH = max(dot(v, h), 0.0); + float dotLV = max(dot(l, v), 0.0); + float dotLH = max(dot(l, h), 0.0); + + vec3 albedo = surfaceAlbedo(baseColor, metalness); + vec3 f0 = surfaceF0(baseColor, metalness); + + // Direct + vec3 direct = diffuseBRDF(albedo, roughness, dotNV, dotNL, dotVH, dotLV) + specularBRDF(f0, roughness, dotNL, dotNH, dotNV, dotVH, dotLH); + + // Indirect + vec3 indirectDiffuse = texture(senvmap, envMapEquirect(n)).rgb; + indirectDiffuse = pow(indirectDiffuse, vec3(2.2)); + + vec3 reflectionWorld = reflect(-v, n); + //lod = getMipLevelFromRoughness(roughness) + vec3 prefilteredColor = texture(senvmaplod, envMapEquirect(reflectionWorld)).rgb; + prefilteredColor = pow(prefilteredColor, vec3(2.2)); + //prefilteredColor = textureCube(PrefilteredEnvMap, refVec, lod) + //envBRDF = texture2D(BRDFIntegrationMap,vec2(roughness, ndotv)).xy + //indirectSpecular = prefilteredColor * (specularColor * envBRDF.x + envBRDF.y) + vec3 indirectSpecular = prefilteredColor; + + vec3 indirect = albedo * indirectDiffuse + f0 * indirectSpecular; + + outColor = vec4(vec3((direct + indirect) * visibility), 1.0); + } + else { + outColor = vec4(baseColor * visibility, 1.0); + } + gl_FragColor = vec4(pow(outColor.rgb, vec3(1.0 / 2.2)), outColor.a); } diff --git a/raw/forward/forward.shader.json b/raw/forward/forward.shader.json index ccc989dd..049358ca 100755 --- a/raw/forward/forward.shader.json +++ b/raw/forward/forward.shader.json @@ -62,6 +62,39 @@ "texture_params": [], "vertex_shader": "forward.vert.glsl", "fragment_shader": "forward.frag.glsl" + }, + { + "id": "shadowmap", + "params": [ + { + "id": "depth_write", + "value": "true" + }, + { + "id": "compare_mode", + "value": "less" + }, + { + "id": "cull_mode", + "value": "clockwise" + }, + { + "id": "blend_source", + "value": "blend_one" + }, + { + "id": "blend_destination", + "value": "blend_zero" + } + ], + "links": [ + { + "id": "LMVP", + "link": "_lightModelViewProjectionMatrix" + } + ], + "vertex_shader": "shadowmap.vert.glsl", + "fragment_shader": "shadowmap.frag.glsl" } ] } diff --git a/raw/forward/forward.shader_withshadow.json b/raw/forward/forward.shader_withshadow.json deleted file mode 100755 index 251fb27b..00000000 --- a/raw/forward/forward.shader_withshadow.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "contexts": [ - { - "id": "forward", - "params": [ - { - "id": "depth_write", - "value": "true" - }, - { - "id": "compare_mode", - "value": "less" - }, - { - "id": "cull_mode", - "value": "counter_clockwise" - }, - { - "id": "blend_source", - "value": "blend_one" - }, - { - "id": "blend_destination", - "value": "blend_zero" - } - ], - "links": [ - { - "id": "M", - "link": "_modelMatrix" - }, - { - "id": "NM", - "link": "_normalMatrix" - }, - { - "id": "V", - "link": "_viewMatrix" - }, - { - "id": "P", - "link": "_projectionMatrix" - }, - { - "id": "lightMVP", - "link": "_lightMVP" - }, - { - "id": "light", - "link": "_lightPosition" - }, - { - "id": "eye", - "link": "_cameraPosition" - }, - { - "id": "skinBones", - "link": "_skinBones", - "ifdef": "_Skinning" - } - ], - "vertex_shader": "forward.vert.glsl", - "fragment_shader": "forward.frag.glsl" - }, - { - "id": "shadow_map", - "params": [ - { - "id": "depth_write", - "value": "true" - }, - { - "id": "compare_mode", - "value": "less" - }, - { - "id": "cull_mode", - "value": "counter_clockwise" - }, - { - "id": "blend_source", - "value": "blend_one" - }, - { - "id": "blend_destination", - "value": "blend_zero" - } - ], - "links": [ - { - "id": "lightMVP", - "link": "_lightMVP" - } - ], - "vertex_shader": "shadow_map.vert.glsl", - "fragment_shader": "shadow_map.frag.glsl" - } - ] -} diff --git a/raw/forward/forward.vert.glsl b/raw/forward/forward.vert.glsl index 2010baa9..0141a2e2 100644 --- a/raw/forward/forward.vert.glsl +++ b/raw/forward/forward.vert.glsl @@ -118,7 +118,8 @@ void main() { gl_Position = P * VM * sPos; vec4 mPos = M * sPos; - position = mPos.xyz / mPos.w; + //position = mPos.xyz / mPos.w; + position = pos; #ifdef _Texturing texCoord = tex; @@ -144,7 +145,7 @@ void main() { lightDir = normalize(TBN * lightDir); eyeDir = normalize(TBN * eyeDir); #else - lightDir = normalize(light - position); - eyeDir = normalize(eye - position); + lightDir = (light - position); + eyeDir = (eye - position); #endif } diff --git a/raw/forward/shadow_map.frag.glsl b/raw/forward/shadowmap.frag.glsl similarity index 100% rename from raw/forward/shadow_map.frag.glsl rename to raw/forward/shadowmap.frag.glsl diff --git a/raw/forward/shadow_map.vert.glsl b/raw/forward/shadowmap.vert.glsl similarity index 79% rename from raw/forward/shadow_map.vert.glsl rename to raw/forward/shadowmap.vert.glsl index 2252ca6e..138cdb60 100644 --- a/raw/forward/shadow_map.vert.glsl +++ b/raw/forward/shadowmap.vert.glsl @@ -28,15 +28,15 @@ in vec4 weight; in vec3 off; #endif -uniform mat4 lightMVP; +uniform mat4 LMVP; out vec4 position; void main() { #ifdef _Instancing - gl_Position = lightMVP * vec4(pos + off, 1.0); + gl_Position = LMVP * vec4(pos + off, 1.0); #else - gl_Position = lightMVP * vec4(pos, 1.0); + gl_Position = LMVP * vec4(pos, 1.0); #endif position = gl_Position; } diff --git a/raw/make_resources.py b/raw/make_resources.py index dbf3b99c..34bbd6ab 100644 --- a/raw/make_resources.py +++ b/raw/make_resources.py @@ -175,7 +175,7 @@ def make(json_name): # Make out dir #if not os.path.exists('out'): # os.makedirs('out') - path = '../../compiled/ShaderResources/' + base_name + path = '../../../../compiled/ShaderResources/' + base_name if not os.path.exists(path): os.makedirs(path) @@ -210,7 +210,7 @@ def make(json_name): for s in subset: res_name += s #with open('out/' + res_name + '.json', 'w') as f: - with open('../../compiled/ShaderResources/' + base_name + '/' + res_name + '.json', 'w') as f: + with open(path + '/' + res_name + '.json', 'w') as f: r = Object() r.shader_resources = [res.shader_resources[-1]] f.write(r.to_JSON()) diff --git a/raw/make_variants.py b/raw/make_variants.py index 7a178f3d..a129bc7d 100644 --- a/raw/make_variants.py +++ b/raw/make_variants.py @@ -9,9 +9,9 @@ import os import json # Create variations -def writeFile(base_name, name, defs, lines): +def writeFile(path, name, defs, lines): # with open('out/' + name, "w") as f: - with open('../../compiled/Shaders/' + base_name + '/' + name, "w") as f: + with open(path + '/' + name, "w") as f: # Write variation defs_written = False for line in lines: @@ -33,7 +33,7 @@ def make(json_name): # Make out dir #if not os.path.exists('out'): # os.makedirs('out') - path = '../../compiled/Shaders/' + base_name + path = '../../../../compiled/Shaders/' + base_name if not os.path.exists(path): os.makedirs(path) @@ -70,5 +70,5 @@ def make(json_name): shader_name = shader_names[i] for s in subset: shader_name += s - writeFile(base_name, shader_name + '.vert.glsl', subset, vert_lines) - writeFile(base_name, shader_name + '.frag.glsl', subset, frag_lines) + writeFile(path, shader_name + '.vert.glsl', subset, vert_lines) + writeFile(path, shader_name + '.frag.glsl', subset, frag_lines) diff --git a/Assets/pipeline_resource.json b/raw/pipeline_resource.json similarity index 100% rename from Assets/pipeline_resource.json rename to raw/pipeline_resource.json