Browse Source

Demonstrate alpha mask, render order change & occlusion disable with a new example material in the SceneLoadExample demo scene. Porting note added related to missing techniques.

Lasse Öörni 9 years ago
parent
commit
63043ebdf3

+ 2 - 1
Docs/Urho3D.dox

@@ -1040,7 +1040,8 @@ From 1.6 to master:
 - SoundSource autoremove boolean was replaced with AutoRemoveMode enum, which allows removing either the component or owner node. Also used by ParticleEmitter.
 - Getting camera projection matrix has changed. Use GetProjection() to get the API-independent matrix, and GetGPUProjection() to get the matrix converted to be usable as a shader parameter. On D3D these are the same.
 - Alpha masking hint has been removed from Technique & Pass, due to materials also now being able to define additional shader compilation defines. You can use Material::SetRenderOrder() instead to ensure that partially opaque geometry will be drawn after fully opaque for GPU depth buffer optimization.
-  Due to this change you must also manually define that a material should not take part in occlusion rendering, see Material::SetOcclusion().
+  Due to this change you must also manually define that a material should not take part in occlusion rendering, see Material::SetOcclusion(). 
+- Techniques that existed just for shader defines like ALPHAMASK and PACKEDNORMAL have been removed. Replace by using techniques without those defines (e.g. DiffNormal instead of DiffNormalPacked), and adding the necessary defines to your materials instead.
 */
 
 }

+ 20 - 0
bin/Data/Materials/UrhoDecalAlphaMaskTwoSided.xml

@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<material>
+	<technique name="Techniques/Diff.xml" quality="0" loddistance="0" />
+	<texture unit="diffuse" name="Textures/UrhoDecalAlpha.dds" />
+	<shader psdefines="ALPHAMASK" />
+	<parameter name="UOffset" value="1 0 0 0" />
+	<parameter name="VOffset" value="0 1 0 0" />
+	<parameter name="MatDiffColor" value="1 1 1 1" />
+	<parameter name="MatEmissiveColor" value="0 0 0" />
+	<parameter name="MatEnvMapColor" value="1 1 1" />
+	<parameter name="MatSpecColor" value="0 0 0 1" />
+	<parameter name="Roughness" value="0.5" />
+	<parameter name="Metallic" value="0" />
+	<cull value="none" />
+	<shadowcull value="none" />
+	<fill value="solid" />
+	<depthbias constant="0" slopescaled="0" />
+	<renderorder value="129" />
+	<occlusion enable="false" />
+</material>

+ 24 - 4
bin/Data/Scenes/SceneLoadExample.xml

@@ -5,10 +5,10 @@
 	<attribute name="Smoothing Constant" value="50" />
 	<attribute name="Snap Threshold" value="5" />
 	<attribute name="Elapsed Time" value="0" />
-	<attribute name="Next Replicated Node ID" value="8" />
-	<attribute name="Next Replicated Component ID" value="9" />
-	<attribute name="Next Local Node ID" value="16777216" />
-	<attribute name="Next Local Component ID" value="16777216" />
+	<attribute name="Next Replicated Node ID" value="9" />
+	<attribute name="Next Replicated Component ID" value="10" />
+	<attribute name="Next Local Node ID" value="16777217" />
+	<attribute name="Next Local Component ID" value="16777228" />
 	<attribute name="Variables" />
 	<attribute name="Variable Names" value="" />
 	<component type="Octree" id="1" />
@@ -16,6 +16,7 @@
 	<node id="2">
 		<attribute name="Is Enabled" value="true" />
 		<attribute name="Name" value="Plane" />
+		<attribute name="Tags" />
 		<attribute name="Position" value="0 0.0792121 0" />
 		<attribute name="Rotation" value="1 0 0 0" />
 		<attribute name="Scale" value="5 1 5" />
@@ -28,6 +29,7 @@
 	<node id="3">
 		<attribute name="Is Enabled" value="true" />
 		<attribute name="Name" value="Box" />
+		<attribute name="Tags" />
 		<attribute name="Position" value="1.32267 0.594299 -1.57271" />
 		<attribute name="Rotation" value="0.92388 0 0.382683 0" />
 		<attribute name="Scale" value="1 1 1" />
@@ -41,6 +43,7 @@
 	<node id="4">
 		<attribute name="Is Enabled" value="true" />
 		<attribute name="Name" value="Box" />
+		<attribute name="Tags" />
 		<attribute name="Position" value="-1.30641 0.594299 -1.3801" />
 		<attribute name="Rotation" value="0.966853 0 -0.255333 0" />
 		<attribute name="Scale" value="1 1 1" />
@@ -54,6 +57,7 @@
 	<node id="5">
 		<attribute name="Is Enabled" value="true" />
 		<attribute name="Name" value="Light1" />
+		<attribute name="Tags" />
 		<attribute name="Position" value="0.275269 1.54593 -5.1247" />
 		<attribute name="Rotation" value="0.996465 0.0840061 0 0" />
 		<attribute name="Scale" value="1 1 1" />
@@ -69,6 +73,7 @@
 	<node id="6">
 		<attribute name="Is Enabled" value="true" />
 		<attribute name="Name" value="Box" />
+		<attribute name="Tags" />
 		<attribute name="Position" value="0.055109 0.594299 0.653738" />
 		<attribute name="Rotation" value="0.999947 0 0.0103017 0" />
 		<attribute name="Scale" value="1 1 1" />
@@ -82,6 +87,7 @@
 	<node id="7">
 		<attribute name="Is Enabled" value="true" />
 		<attribute name="Name" value="Light2" />
+		<attribute name="Tags" />
 		<attribute name="Position" value="-2.55712 0.969277 4.03673" />
 		<attribute name="Rotation" value="0.346269 0.0588016 0.923076 -0.156752" />
 		<attribute name="Scale" value="1 1 1" />
@@ -94,4 +100,18 @@
 			<attribute name="Depth Constant Bias" value="0.0001" />
 		</component>
 	</node>
+	<node id="8">
+		<attribute name="Is Enabled" value="true" />
+		<attribute name="Name" value="" />
+		<attribute name="Tags" />
+		<attribute name="Position" value="0.0482672 0.747751 -1.93713" />
+		<attribute name="Rotation" value="0.707107 -0.707107 0 0" />
+		<attribute name="Scale" value="1 1 1" />
+		<attribute name="Variables" />
+		<component type="StaticModel" id="9">
+			<attribute name="Model" value="Model;Models/Plane.mdl" />
+			<attribute name="Material" value="Material;Materials/UrhoDecalAlphaMaskTwoSided.xml" />
+			<attribute name="Cast Shadows" value="true" />
+		</component>
+	</node>
 </scene>