Răsfoiți Sursa

Removed alphaTest from rendering options, added alphatest shaders

Ivan Safrin 9 ani în urmă
părinte
comite
65c81b8d7d

BIN
assets/default/default.pak


+ 15 - 0
assets/default/default/UnlitAlphaTest.frag

@@ -0,0 +1,15 @@
+#ifdef GL_ES
+	precision mediump float;
+#endif
+
+uniform sampler2D diffuse;
+uniform vec4 entityColor;
+varying vec2 texCoordVar;
+
+void main() {
+	vec4 color = texture2D(diffuse, texCoordVar) * entityColor;
+	if(color.a < 0.001) {
+		discard;
+	}
+	gl_FragColor = color;
+}

+ 16 - 0
assets/default/default/UnlitVertexColorAlphaTest.frag

@@ -0,0 +1,16 @@
+#ifdef GL_ES
+	precision mediump float;
+#endif
+
+uniform sampler2D diffuse;
+uniform vec4 entityColor;
+varying vec2 texCoordVar;
+varying vec4 varColor;
+
+void main() {
+	vec4 color = texture2D(diffuse, texCoordVar) * entityColor * varColor;
+	if(color.a < 0.001) {
+		discard;
+	}
+	gl_FragColor = color;
+}

+ 24 - 2
assets/default/default/default.mat

@@ -5,7 +5,7 @@
 			<vp source="default/DefaultShader.vert"/>
 			<fp source="default/DefaultShader.frag"/>
 		</shader>
-		<shader type="glsl" name="DefaultShaderAnimated" numPointLights="6" numSpotLights="2">
+		<shader type="glsl" name="	" numPointLights="6" numSpotLights="2">
 			<vp source="default/GPUSkinning.vert"/>
 			<fp source="default/DefaultShader.frag"/>
 		</shader>		
@@ -21,10 +21,18 @@
 			<vp source="default/Unlit.vert"/>
 			<fp source="default/Unlit.frag"/>
 		</shader>
+		<shader type="glsl" name="UnlitAlphaTest" numPointLights="0" numSpotLights="0">		
+			<vp source="default/Unlit.vert"/>
+			<fp source="default/UnlitAlphaTest.frag"/>
+		</shader>		
 		<shader type="glsl" name="UnlitVertexColor" numPointLights="0" numSpotLights="0">		
 			<vp source="default/UnlitVertexColor.vert"/>
 			<fp source="default/UnlitVertexColor.frag"/>
-		</shader>		
+		</shader>
+		<shader type="glsl" name="UnlitVertexColorAlphaTest" numPointLights="0" numSpotLights="0">		
+			<vp source="default/UnlitVertexColor.vert"/>
+			<fp source="default/UnlitVertexColorAlphaTest.frag"/>
+		</shader>	
 		<shader type="glsl" name="UnlitPointUntextured" numPointLights="0" numSpotLights="0">		
 			<vp source="default/UnlitPoint.vert"/>
 			<fp source="default/UnlitUntextured.frag"/>
@@ -125,6 +133,13 @@
 				</params>				
 			</shader>
 		</material>
+		<material name="UnlitAlphaTest">
+			<shader name="UnlitAlphaTest">
+				<params>
+					<param name="entityColor" value="1.0 1.0 1.0 1.0" />
+				</params>				
+			</shader>
+		</material>		
 		<material name="UnlitAdditive" blendingMode="2">
 			<shader name="Unlit">
 				<params>
@@ -160,6 +175,13 @@
 				</params>					
 			</shader>
 		</material>
+		<material name="UnlitVertexColorAlphaTest">
+			<shader name="UnlitVertexColorAlphaTest">
+				<params>
+					<param name="entityColor" value="1.0 1.0 1.0 1.0" />
+				</params>					
+			</shader>
+		</material>		
 		<material name="UnlitWireframe">
 			<shader name="UnlitWireframe" wireframe="true">
 				<params>

+ 0 - 9
bindings/javascript/Polycode/GPUDrawOptions.js

@@ -6,7 +6,6 @@ function GPUDrawOptions() {
 		'depthTest': { enumerable: true, configurable: true, get: GPUDrawOptions.prototype.__get_depthTest, set: GPUDrawOptions.prototype.__set_depthTest},
 		'depthWrite': { enumerable: true, configurable: true, get: GPUDrawOptions.prototype.__get_depthWrite, set: GPUDrawOptions.prototype.__set_depthWrite},
 		'linePointSize': { enumerable: true, configurable: true, get: GPUDrawOptions.prototype.__get_linePointSize, set: GPUDrawOptions.prototype.__set_linePointSize},
-		'alphaTest': { enumerable: true, configurable: true, get: GPUDrawOptions.prototype.__get_alphaTest, set: GPUDrawOptions.prototype.__set_alphaTest},
 		'backfaceCull': { enumerable: true, configurable: true, get: GPUDrawOptions.prototype.__get_backfaceCull, set: GPUDrawOptions.prototype.__set_backfaceCull},
 		'depthOnly': { enumerable: true, configurable: true, get: GPUDrawOptions.prototype.__get_depthOnly, set: GPUDrawOptions.prototype.__set_depthOnly},
 		'forceMaterial': { enumerable: true, configurable: true, get: GPUDrawOptions.prototype.__get_forceMaterial, set: GPUDrawOptions.prototype.__set_forceMaterial},
@@ -42,14 +41,6 @@ GPUDrawOptions.prototype.__set_linePointSize = function(val) {
 	Polycode.GPUDrawOptions__set_linePointSize(this.__ptr, val)
 }
 
-GPUDrawOptions.prototype.__get_alphaTest = function() {
-	return Polycode.GPUDrawOptions__get_alphaTest(this.__ptr)
-}
-
-GPUDrawOptions.prototype.__set_alphaTest = function(val) {
-	Polycode.GPUDrawOptions__set_alphaTest(this.__ptr, val)
-}
-
 GPUDrawOptions.prototype.__get_backfaceCull = function() {
 	return Polycode.GPUDrawOptions__get_backfaceCull(this.__ptr)
 }

+ 4 - 0
bindings/javascript/Polycode/Material.js

@@ -43,6 +43,10 @@ Material.prototype.addShaderPass = function(pass) {
 	Polycode.Material_addShaderPass(this.__ptr, pass)
 }
 
+Material.prototype.addShaderPassForShader = function(shader) {
+	Polycode.Material_addShaderPassForShader(this.__ptr, shader)
+}
+
 Material.prototype.addShaderPassAtIndex = function(pass,shaderIndex) {
 	Polycode.Material_addShaderPassAtIndex(this.__ptr, pass, shaderIndex)
 }

+ 0 - 9
bindings/javascript/Polycode/SceneMesh.js

@@ -9,7 +9,6 @@ function SceneMesh() {
 		'lineSmooth': { enumerable: true, configurable: true, get: SceneMesh.prototype.__get_lineSmooth, set: SceneMesh.prototype.__set_lineSmooth},
 		'pointSmooth': { enumerable: true, configurable: true, get: SceneMesh.prototype.__get_pointSmooth, set: SceneMesh.prototype.__set_pointSmooth},
 		'useGeometryHitDetection': { enumerable: true, configurable: true, get: SceneMesh.prototype.__get_useGeometryHitDetection, set: SceneMesh.prototype.__set_useGeometryHitDetection},
-		'alphaTest': { enumerable: true, configurable: true, get: SceneMesh.prototype.__get_alphaTest, set: SceneMesh.prototype.__set_alphaTest},
 		'backfaceCulled': { enumerable: true, configurable: true, get: SceneMesh.prototype.__get_backfaceCulled, set: SceneMesh.prototype.__set_backfaceCulled},
 		'sendBoneMatricesToMaterial': { enumerable: true, configurable: true, get: SceneMesh.prototype.__get_sendBoneMatricesToMaterial, set: SceneMesh.prototype.__set_sendBoneMatricesToMaterial}
 	})
@@ -50,14 +49,6 @@ SceneMesh.prototype.__set_useGeometryHitDetection = function(val) {
 	Polycode.SceneMesh__set_useGeometryHitDetection(this.__ptr, val)
 }
 
-SceneMesh.prototype.__get_alphaTest = function() {
-	return Polycode.SceneMesh__get_alphaTest(this.__ptr)
-}
-
-SceneMesh.prototype.__set_alphaTest = function(val) {
-	Polycode.SceneMesh__set_alphaTest(this.__ptr, val)
-}
-
 SceneMesh.prototype.__get_backfaceCulled = function() {
 	return Polycode.SceneMesh__get_backfaceCulled(this.__ptr)
 }

BIN
bindings/javascript/js_Polycode.pak


+ 0 - 5
bindings/lua/Polycode/GPUDrawOptions.lua

@@ -8,8 +8,6 @@ function GPUDrawOptions:__getvar(name)
 		return Polycode.GPUDrawOptions_get_depthWrite(self.__ptr)
 	elseif name == "linePointSize" then
 		return Polycode.GPUDrawOptions_get_linePointSize(self.__ptr)
-	elseif name == "alphaTest" then
-		return Polycode.GPUDrawOptions_get_alphaTest(self.__ptr)
 	elseif name == "backfaceCull" then
 		return Polycode.GPUDrawOptions_get_backfaceCull(self.__ptr)
 	elseif name == "depthOnly" then
@@ -45,9 +43,6 @@ function GPUDrawOptions:__setvar(name,value)
 	elseif name == "linePointSize" then
 		Polycode.GPUDrawOptions_set_linePointSize(self.__ptr, value)
 		return true
-	elseif name == "alphaTest" then
-		Polycode.GPUDrawOptions_set_alphaTest(self.__ptr, value)
-		return true
 	elseif name == "backfaceCull" then
 		Polycode.GPUDrawOptions_set_backfaceCull(self.__ptr, value)
 		return true

+ 4 - 0
bindings/lua/Polycode/Material.lua

@@ -57,6 +57,10 @@ function Material:addShaderPass(pass)
 	local retVal = Polycode.Material_addShaderPass(self.__ptr, pass.__ptr)
 end
 
+function Material:addShaderPassForShader(shader)
+	local retVal = Polycode.Material_addShaderPassForShader(self.__ptr, shader.__ptr)
+end
+
 function Material:addShaderPassAtIndex(pass, shaderIndex)
 	local retVal = Polycode.Material_addShaderPassAtIndex(self.__ptr, pass.__ptr, shaderIndex)
 end

+ 0 - 5
bindings/lua/Polycode/SceneMesh.lua

@@ -12,8 +12,6 @@ function SceneMesh:__getvar(name)
 		return Polycode.SceneMesh_get_pointSmooth(self.__ptr)
 	elseif name == "useGeometryHitDetection" then
 		return Polycode.SceneMesh_get_useGeometryHitDetection(self.__ptr)
-	elseif name == "alphaTest" then
-		return Polycode.SceneMesh_get_alphaTest(self.__ptr)
 	elseif name == "backfaceCulled" then
 		return Polycode.SceneMesh_get_backfaceCulled(self.__ptr)
 	elseif name == "sendBoneMatricesToMaterial" then
@@ -37,9 +35,6 @@ function SceneMesh:__setvar(name,value)
 	elseif name == "useGeometryHitDetection" then
 		Polycode.SceneMesh_set_useGeometryHitDetection(self.__ptr, value)
 		return true
-	elseif name == "alphaTest" then
-		Polycode.SceneMesh_set_alphaTest(self.__ptr, value)
-		return true
 	elseif name == "backfaceCulled" then
 		Polycode.SceneMesh_set_backfaceCulled(self.__ptr, value)
 		return true

BIN
bindings/lua/lua_Polycode.pak


+ 7 - 24
include/polycode/bindings/javascript/PolycodeJSWrappers.h

@@ -4035,18 +4035,6 @@ namespace Polycode {
 		return 0;
 	}
 
-	duk_ret_t Polycode_GPUDrawOptions__get_alphaTest(duk_context *context) {
-		std::shared_ptr<GPUDrawOptions> *inst = (std::shared_ptr<GPUDrawOptions>*)duk_to_pointer(context, 0);
-		duk_push_boolean(context, (*inst)->alphaTest);
-		return 1;
-	}
-
-	duk_ret_t Polycode_GPUDrawOptions__set_alphaTest(duk_context *context) {
-		GPUDrawOptions *inst = (GPUDrawOptions*)duk_to_pointer(context, 0);
-		inst->alphaTest = duk_to_boolean(context, 1);
-		return 0;
-	}
-
 	duk_ret_t Polycode_GPUDrawOptions__get_backfaceCull(duk_context *context) {
 		std::shared_ptr<GPUDrawOptions> *inst = (std::shared_ptr<GPUDrawOptions>*)duk_to_pointer(context, 0);
 		duk_push_boolean(context, (*inst)->backfaceCull);
@@ -5037,6 +5025,13 @@ namespace Polycode {
 		return 0;
 	}
 
+	duk_ret_t Polycode_Material_addShaderPassForShader(duk_context *context) {
+		std::shared_ptr<Material> *inst = (std::shared_ptr<Material>*)duk_to_pointer(context, 0);
+		shared_ptr<Shader> shader = *(shared_ptr<Shader>*)duk_to_pointer(context, 1);
+		(*inst)->addShaderPassForShader(shader);
+		return 0;
+	}
+
 	duk_ret_t Polycode_Material_addShaderPassAtIndex(duk_context *context) {
 		std::shared_ptr<Material> *inst = (std::shared_ptr<Material>*)duk_to_pointer(context, 0);
 		ShaderPass pass = *(ShaderPass*)duk_to_pointer(context, 1);
@@ -8710,18 +8705,6 @@ namespace Polycode {
 		return 0;
 	}
 
-	duk_ret_t Polycode_SceneMesh__get_alphaTest(duk_context *context) {
-		std::shared_ptr<SceneMesh> *inst = (std::shared_ptr<SceneMesh>*)duk_to_pointer(context, 0);
-		duk_push_boolean(context, (*inst)->alphaTest);
-		return 1;
-	}
-
-	duk_ret_t Polycode_SceneMesh__set_alphaTest(duk_context *context) {
-		SceneMesh *inst = (SceneMesh*)duk_to_pointer(context, 0);
-		inst->alphaTest = duk_to_boolean(context, 1);
-		return 0;
-	}
-
 	duk_ret_t Polycode_SceneMesh__get_backfaceCulled(duk_context *context) {
 		std::shared_ptr<SceneMesh> *inst = (std::shared_ptr<SceneMesh>*)duk_to_pointer(context, 0);
 		duk_push_boolean(context, (*inst)->backfaceCulled);

+ 8 - 30
include/polycode/bindings/lua/PolycodeLuaWrappers.h

@@ -4858,13 +4858,6 @@ static int Polycode_GPUDrawOptions_get_linePointSize(lua_State *L) {
 	return 1;
 }
 
-static int Polycode_GPUDrawOptions_get_alphaTest(lua_State *L) {
-	luaL_checktype(L, 1, LUA_TUSERDATA);
-	GPUDrawOptions *inst = (GPUDrawOptions*) *((PolyBase**)lua_touserdata(L, 1));
-	lua_pushboolean(L, inst->alphaTest);
-	return 1;
-}
-
 static int Polycode_GPUDrawOptions_get_backfaceCull(lua_State *L) {
 	luaL_checktype(L, 1, LUA_TUSERDATA);
 	GPUDrawOptions *inst = (GPUDrawOptions*) *((PolyBase**)lua_touserdata(L, 1));
@@ -4940,14 +4933,6 @@ static int Polycode_GPUDrawOptions_set_linePointSize(lua_State *L) {
 	return 0;
 }
 
-static int Polycode_GPUDrawOptions_set_alphaTest(lua_State *L) {
-	luaL_checktype(L, 1, LUA_TUSERDATA);
-	GPUDrawOptions *inst = (GPUDrawOptions*) *((PolyBase**)lua_touserdata(L, 1));
-	bool param = lua_toboolean(L, 2) != 0;
-	inst->alphaTest = param;
-	return 0;
-}
-
 static int Polycode_GPUDrawOptions_set_backfaceCull(lua_State *L) {
 	luaL_checktype(L, 1, LUA_TUSERDATA);
 	GPUDrawOptions *inst = (GPUDrawOptions*) *((PolyBase**)lua_touserdata(L, 1));
@@ -6084,6 +6069,14 @@ static int Polycode_Material_set_screenMaterial(lua_State *L) {
 		inst->addShaderPass(pass);
 		return 0;
 	}
+	static int Polycode_Material_addShaderPassForShader(lua_State *L) {
+		luaL_checktype(L, 1, LUA_TUSERDATA);
+		Material *inst = (Material*) *((PolyBase**)lua_touserdata(L, 1));
+		luaL_checktype(L, 2, LUA_TUSERDATA);
+		shared_ptr<Shader> shader = *(shared_ptr<Shader>*) *((PolyBase**)lua_touserdata(L, 2));
+		inst->addShaderPassForShader(shader);
+		return 0;
+	}
 	static int Polycode_Material_addShaderPassAtIndex(lua_State *L) {
 		luaL_checktype(L, 1, LUA_TUSERDATA);
 		Material *inst = (Material*) *((PolyBase**)lua_touserdata(L, 1));
@@ -10595,13 +10588,6 @@ static int Polycode_SceneMesh_get_useGeometryHitDetection(lua_State *L) {
 	return 1;
 }
 
-static int Polycode_SceneMesh_get_alphaTest(lua_State *L) {
-	luaL_checktype(L, 1, LUA_TUSERDATA);
-	SceneMesh *inst = (SceneMesh*) *((PolyBase**)lua_touserdata(L, 1));
-	lua_pushboolean(L, inst->alphaTest);
-	return 1;
-}
-
 static int Polycode_SceneMesh_get_backfaceCulled(lua_State *L) {
 	luaL_checktype(L, 1, LUA_TUSERDATA);
 	SceneMesh *inst = (SceneMesh*) *((PolyBase**)lua_touserdata(L, 1));
@@ -10648,14 +10634,6 @@ static int Polycode_SceneMesh_set_useGeometryHitDetection(lua_State *L) {
 	return 0;
 }
 
-static int Polycode_SceneMesh_set_alphaTest(lua_State *L) {
-	luaL_checktype(L, 1, LUA_TUSERDATA);
-	SceneMesh *inst = (SceneMesh*) *((PolyBase**)lua_touserdata(L, 1));
-	bool param = lua_toboolean(L, 2) != 0;
-	inst->alphaTest = param;
-	return 0;
-}
-
 static int Polycode_SceneMesh_set_backfaceCulled(lua_State *L) {
 	luaL_checktype(L, 1, LUA_TUSERDATA);
 	SceneMesh *inst = (SceneMesh*) *((PolyBase**)lua_touserdata(L, 1));

+ 0 - 1
include/polycode/core/PolyGPUDrawBuffer.h

@@ -59,7 +59,6 @@ namespace Polycode {
 		bool depthTest;
 		bool depthWrite;
 		float linePointSize;
-		bool alphaTest;
 		bool backfaceCull;
 		bool depthOnly;
 		bool forceMaterial;

+ 1 - 6
include/polycode/core/PolySceneMesh.h

@@ -166,12 +166,7 @@ namespace Polycode {
 			bool getForceMaterial();
 		
 			virtual Entity *Clone(bool deepClone, bool ignoreEditorOnly) const;
-			virtual void applyClone(Entity *clone, bool deepClone, bool ignoreEditorOnly) const;		
-			
-			/**
-			 * Normally, translucent textures do not affect the depth buffer, but if this flag is set to true, this entity's alpha channel is written to the depth buffer at a preset threshold. This flag is set to false by default.
-			 */
-			bool alphaTest;
+			virtual void applyClone(Entity *clone, bool deepClone, bool ignoreEditorOnly) const;
 			
 			/**
 			 * If this flag is set to false, backface culling is disabled when rendering this entity, rendering both sides of each face. Set to true by default.

+ 0 - 2
include/polycode/ide/PolycodeProps.h

@@ -719,8 +719,6 @@ class SceneMeshSheet : public PropSheet {
 	
 		BoolProp *gpuSkinningProp;
 		BoolProp *backfaceCullProp;
-		BoolProp *alphaTestProp;
-	
 		SceneMesh *sceneMesh;
 };
 

+ 1 - 4
src/bindings/javascript/PolycodeJS.cpp

@@ -578,8 +578,6 @@ int jsopen_Polycode(duk_context *ctx) {
 			{"GPUDrawOptions__set_depthWrite", Polycode_GPUDrawOptions__set_depthWrite, 2},
 			{"GPUDrawOptions__get_linePointSize", Polycode_GPUDrawOptions__get_linePointSize, 1},
 			{"GPUDrawOptions__set_linePointSize", Polycode_GPUDrawOptions__set_linePointSize, 2},
-			{"GPUDrawOptions__get_alphaTest", Polycode_GPUDrawOptions__get_alphaTest, 1},
-			{"GPUDrawOptions__set_alphaTest", Polycode_GPUDrawOptions__set_alphaTest, 2},
 			{"GPUDrawOptions__get_backfaceCull", Polycode_GPUDrawOptions__get_backfaceCull, 1},
 			{"GPUDrawOptions__set_backfaceCull", Polycode_GPUDrawOptions__set_backfaceCull, 2},
 			{"GPUDrawOptions__get_depthOnly", Polycode_GPUDrawOptions__get_depthOnly, 1},
@@ -725,6 +723,7 @@ int jsopen_Polycode(duk_context *ctx) {
 			{"Material__set_screenMaterial", Polycode_Material__set_screenMaterial, 2},
 			{"Material__delete", Polycode_Material__delete, 1},
 			{"Material_addShaderPass", Polycode_Material_addShaderPass, 2},
+			{"Material_addShaderPassForShader", Polycode_Material_addShaderPassForShader, 2},
 			{"Material_addShaderPassAtIndex", Polycode_Material_addShaderPassAtIndex, 3},
 			{"Material_getNumShaderPasses", Polycode_Material_getNumShaderPasses, 1},
 			{"Material_removeShaderPass", Polycode_Material_removeShaderPass, 2},
@@ -1242,8 +1241,6 @@ int jsopen_Polycode(duk_context *ctx) {
 			{"SceneMesh__set_pointSmooth", Polycode_SceneMesh__set_pointSmooth, 2},
 			{"SceneMesh__get_useGeometryHitDetection", Polycode_SceneMesh__get_useGeometryHitDetection, 1},
 			{"SceneMesh__set_useGeometryHitDetection", Polycode_SceneMesh__set_useGeometryHitDetection, 2},
-			{"SceneMesh__get_alphaTest", Polycode_SceneMesh__get_alphaTest, 1},
-			{"SceneMesh__set_alphaTest", Polycode_SceneMesh__set_alphaTest, 2},
 			{"SceneMesh__get_backfaceCulled", Polycode_SceneMesh__get_backfaceCulled, 1},
 			{"SceneMesh__set_backfaceCulled", Polycode_SceneMesh__set_backfaceCulled, 2},
 			{"SceneMesh__get_sendBoneMatricesToMaterial", Polycode_SceneMesh__get_sendBoneMatricesToMaterial, 1},

+ 1 - 4
src/bindings/lua/PolycodeLua.cpp

@@ -567,7 +567,6 @@ int luaopen_Polycode(lua_State *L) {
 		{"GPUDrawOptions_get_depthTest", Polycode_GPUDrawOptions_get_depthTest},
 		{"GPUDrawOptions_get_depthWrite", Polycode_GPUDrawOptions_get_depthWrite},
 		{"GPUDrawOptions_get_linePointSize", Polycode_GPUDrawOptions_get_linePointSize},
-		{"GPUDrawOptions_get_alphaTest", Polycode_GPUDrawOptions_get_alphaTest},
 		{"GPUDrawOptions_get_backfaceCull", Polycode_GPUDrawOptions_get_backfaceCull},
 		{"GPUDrawOptions_get_depthOnly", Polycode_GPUDrawOptions_get_depthOnly},
 		{"GPUDrawOptions_get_forceMaterial", Polycode_GPUDrawOptions_get_forceMaterial},
@@ -578,7 +577,6 @@ int luaopen_Polycode(lua_State *L) {
 		{"GPUDrawOptions_set_depthTest", Polycode_GPUDrawOptions_set_depthTest},
 		{"GPUDrawOptions_set_depthWrite", Polycode_GPUDrawOptions_set_depthWrite},
 		{"GPUDrawOptions_set_linePointSize", Polycode_GPUDrawOptions_set_linePointSize},
-		{"GPUDrawOptions_set_alphaTest", Polycode_GPUDrawOptions_set_alphaTest},
 		{"GPUDrawOptions_set_backfaceCull", Polycode_GPUDrawOptions_set_backfaceCull},
 		{"GPUDrawOptions_set_depthOnly", Polycode_GPUDrawOptions_set_depthOnly},
 		{"GPUDrawOptions_set_forceMaterial", Polycode_GPUDrawOptions_set_forceMaterial},
@@ -715,6 +713,7 @@ int luaopen_Polycode(lua_State *L) {
 		{"Material_set_screenMaterial", Polycode_Material_set_screenMaterial},
 		{"Material", Polycode_Material},
 		{"Material_addShaderPass", Polycode_Material_addShaderPass},
+		{"Material_addShaderPassForShader", Polycode_Material_addShaderPassForShader},
 		{"Material_addShaderPassAtIndex", Polycode_Material_addShaderPassAtIndex},
 		{"Material_getNumShaderPasses", Polycode_Material_getNumShaderPasses},
 		{"Material_removeShaderPass", Polycode_Material_removeShaderPass},
@@ -1219,14 +1218,12 @@ int luaopen_Polycode(lua_State *L) {
 		{"SceneMesh_get_lineSmooth", Polycode_SceneMesh_get_lineSmooth},
 		{"SceneMesh_get_pointSmooth", Polycode_SceneMesh_get_pointSmooth},
 		{"SceneMesh_get_useGeometryHitDetection", Polycode_SceneMesh_get_useGeometryHitDetection},
-		{"SceneMesh_get_alphaTest", Polycode_SceneMesh_get_alphaTest},
 		{"SceneMesh_get_backfaceCulled", Polycode_SceneMesh_get_backfaceCulled},
 		{"SceneMesh_get_sendBoneMatricesToMaterial", Polycode_SceneMesh_get_sendBoneMatricesToMaterial},
 		{"SceneMesh_set_lineWidth", Polycode_SceneMesh_set_lineWidth},
 		{"SceneMesh_set_lineSmooth", Polycode_SceneMesh_set_lineSmooth},
 		{"SceneMesh_set_pointSmooth", Polycode_SceneMesh_set_pointSmooth},
 		{"SceneMesh_set_useGeometryHitDetection", Polycode_SceneMesh_set_useGeometryHitDetection},
-		{"SceneMesh_set_alphaTest", Polycode_SceneMesh_set_alphaTest},
 		{"SceneMesh_set_backfaceCulled", Polycode_SceneMesh_set_backfaceCulled},
 		{"SceneMesh_set_sendBoneMatricesToMaterial", Polycode_SceneMesh_set_sendBoneMatricesToMaterial},
 		{"SceneMesh", Polycode_SceneMesh},

+ 0 - 1
src/core/PolyCamera.cpp

@@ -349,7 +349,6 @@ void Camera::renderFullScreenQuad(GPUDrawBuffer *drawBuffer, int shaderPass) {
 	drawCall.options.enableScissor = false;
 	drawCall.options.depthOnly = false;
 	drawCall.options.blendingMode = Renderer::BLEND_MODE_NONE;
-	drawCall.options.alphaTest = false;
 	drawCall.options.backfaceCull = false;
 	drawCall.options.depthTest = false;
 	drawCall.options.depthWrite = false;

+ 0 - 4
src/core/PolySceneEntityInstance.cpp

@@ -175,10 +175,6 @@ void SceneEntityInstance::applySceneMesh(ObjectEntry *entry, SceneMesh *sceneMes
 		sceneMesh->sendBoneMatricesToMaterial = (*entry)["sendBoneMatricesToMaterial"]->boolVal;
 	}
 	
-	if((*entry)["alphaTest"]) {
-		sceneMesh->alphaTest = (*entry)["alphaTest"]->boolVal;
-	}
-	
 	if((*entry)["backfaceCulled"]) {
 		sceneMesh->backfaceCulled = (*entry)["backfaceCulled"]->boolVal;
 	}

+ 0 - 5
src/core/PolySceneMesh.cpp

@@ -46,7 +46,6 @@ SceneMesh::SceneMesh() : material(NULL), skeleton(NULL) {
 	lineWidth = 1.0;
 	useGeometryHitDetection = false;
 	backfaceCulled = true;
-	alphaTest = false;
 	sendBoneMatricesToMaterial = false;
 }
 
@@ -59,7 +58,6 @@ SceneMesh::SceneMesh(ResourcePool *pool, const String& fileName) : material(NULL
 	pointSmooth = false;
 	useGeometryHitDetection = false;
 	backfaceCulled = true;
-	alphaTest = false;
 	sendBoneMatricesToMaterial = false;
 }
 
@@ -72,7 +70,6 @@ SceneMesh::SceneMesh(std::shared_ptr<Mesh> mesh) : material(NULL), skeleton(NULL
 	pointSmooth = false;
 	useGeometryHitDetection = false;
 	backfaceCulled = true;
-	alphaTest = false;
 	sendBoneMatricesToMaterial = false;
 }
 
@@ -106,7 +103,6 @@ void SceneMesh::applyClone(Entity *clone, bool deepClone, bool ignoreEditorOnly)
 	_clone->lineWidth = lineWidth;
 	_clone->lineSmooth = lineSmooth;
 	_clone->pointSmooth = pointSmooth;
-	_clone->alphaTest = alphaTest;
 	_clone->backfaceCulled = backfaceCulled;
 	_clone->useGeometryHitDetection = useGeometryHitDetection;
 	_clone->setFilename(fileName);
@@ -300,7 +296,6 @@ void SceneMesh::Render(GPUDrawBuffer *buffer) {
     }
 
 	for(int i=0; i < mesh->getNumSubmeshes(); i++) {
-		drawCall.options.alphaTest = alphaTest;
 		drawCall.options.linePointSize = lineWidth;
 		drawCall.options.backfaceCull = backfaceCulled;
 		drawCall.options.depthTest = depthTest;

+ 0 - 1
src/ide/PolycodeEntityEditor.cpp

@@ -2431,7 +2431,6 @@ void PolycodeEntityEditor::saveEntityToObjectEntry(Entity *entity, ObjectEntry *
 			meshEntry->addChild("file", sceneMesh->getFilename().replace(parentProject->getRootFolder()+"/", ""));
 		}
 
-		meshEntry->addChild("alphaTest", sceneMesh->alphaTest);
 		meshEntry->addChild("backfaceCulled", sceneMesh->backfaceCulled);
 		meshEntry->addChild("sendBoneMatricesToMaterial", sceneMesh->sendBoneMatricesToMaterial);
 		

+ 0 - 9
src/ide/PolycodeProps.cpp

@@ -2794,10 +2794,6 @@ SceneMeshSheet::SceneMeshSheet(Core *core, ResourcePool *pool) : PropSheet(core,
 	
 	backfaceCullProp = new BoolProp(core, pool, "Backface culling");
 	addProp(backfaceCullProp);
-
-	alphaTestProp = new BoolProp(core, pool, "Alpha test");
-	addProp(alphaTestProp);
-	
 }
 
 SceneMeshSheet::~SceneMeshSheet() {
@@ -2811,8 +2807,6 @@ void SceneMeshSheet::setSceneMesh(SceneMesh *mesh) {
 		
 		gpuSkinningProp->set(sceneMesh->sendBoneMatricesToMaterial);
 		backfaceCullProp->set(sceneMesh->backfaceCulled);
-		alphaTestProp->set(sceneMesh->alphaTest);
-		
 		enabled = true;
 	} else {
 		enabled = false;
@@ -2828,10 +2822,7 @@ void SceneMeshSheet::handleEvent(Event *event) {
 		sceneMesh->sendBoneMatricesToMaterial = gpuSkinningProp->get();
 	} else if(event->getDispatcher() == backfaceCullProp) {
 		sceneMesh->backfaceCulled = backfaceCullProp->get();
-	} else if(event->getDispatcher() == alphaTestProp) {
-		sceneMesh->alphaTest = alphaTestProp->get();
 	}
-
 	
 	PropSheet::handleEvent(event);
 }