Mark Sibly 7 ani în urmă
părinte
comite
a734f79134

+ 1 - 1
modules/mojo/graphics/texture.monkey2

@@ -327,7 +327,7 @@ Class Texture Extends Resource
 		Return Null
 	End
 
-	Function Load:Texture( path:String,flags:TextureFlags,flipNormalY:Bool=False )
+	Function Load:Texture( path:String,flags:TextureFlags=TextureFlags.FilterMipmap,flipNormalY:Bool=False )
 
 		Local pixmap:=Pixmap.Load( path,,True )
 		If Not pixmap Return Null

+ 0 - 9
modules/mojo3d/assets/shaders/imports/pbr.glsl

@@ -181,12 +181,3 @@ void emitPbrFragment( vec4 color,vec3 ambient,vec3 emissive,float metalness,floa
 }
 
 #endif
-
-#if MX2_SHADOWPASS
-
-void main(){
-
-	emitShadowFragment();
-}
-
-#endif

+ 8 - 1
modules/mojo3d/assets/shaders/materials/pbr-default.glsl

@@ -12,7 +12,7 @@ void main(){
 
 //@fragment
 
-#if MX2_COLORPASS
+#if MX2_COLORPASS	//is this a color pass?
 
 #if MX2_TEXTURED
 uniform sampler2D m_ColorTexture;
@@ -76,4 +76,11 @@ void main(){
 	emitPbrFragment( color,ambient,emissive,metalness,roughness,occlusion,normal );
 }
 
+#else	//if not a color pass, must be a shadow pass...
+
+void main(){
+
+	emitShadowFragment();
+}
+
 #endif

+ 0 - 4
modules/mojo3d/assets/shaders/materials/water.glsl

@@ -12,8 +12,6 @@ void main(){
 
 //@fragment
 
-#if MX2_COLORPASS
-
 uniform sampler2D m_ColorTexture;
 uniform vec4 m_ColorFactor;
 
@@ -50,5 +48,3 @@ void main(){
 
 	emitPbrFragment( color,ambient,emissive,metalness,roughness,occlusion,normal );
 }
-
-#endif

+ 14 - 0
modules/mojo3d/scene/mesh.monkey2

@@ -514,6 +514,20 @@ Class Mesh Extends Resource
 		InvalidateVertices()
 	End
 
+	#rem monkeydoc Copies texcoord0 to texcoord1.
+	#end
+	Method CopyTexCoords()
+
+		Local vertices:=_vertices.Data
+		
+		For Local i:=0 Until _vertices.Length
+		
+			vertices[i].texCoord1=vertices[i].texCoord0
+		Next
+		
+		InvalidateVertices()
+	End
+	
 	#rem monkeydoc Loads a mesh from a file.
 	
 	On its own, mojo3d can only load gltf2 format mesh and model files.

+ 1 - 1
modules/mojo3d/tests/effects.monkey2

@@ -50,7 +50,7 @@ Class MyWindow Extends Window
 		_light=New Light
 		_light.RotateX( 90 )
 		
-		Local material:=New PbrMaterial( New Color( 2,1,0,1 ) )
+		Local material:=New PbrMaterial( New Color( 2,.5,0,1 ),0,1 )
 		
 		_donut=Model.CreateTorus( 2,.5,48,24,material )
 		_donut.AddComponent<RotateBehaviour>().Speed=New Vec3f( .1,.2,.3 )