@@ -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
@@ -181,12 +181,3 @@ void emitPbrFragment( vec4 color,vec3 ambient,vec3 emissive,float metalness,floa
}
#endif
-
-#if MX2_SHADOWPASS
-void main(){
- emitShadowFragment();
-}
-#endif
@@ -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();
+}
@@ -12,8 +12,6 @@ void main(){
uniform vec4 m_ColorFactor;
@@ -50,5 +48,3 @@ void main(){
@@ -514,6 +514,20 @@ Class Mesh Extends Resource
InvalidateVertices()
+ #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.
@@ -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 )