Forum Replies Created
- 
		AuthorPosts
 - 
		
			
				
That worked a treat, arpie. Thank you.
Logcat:
It’s lengthy….
Monkey12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088105-08 08:58:28.830 20302-20302/? I/art: Late-enabling -Xcheck:jni05-08 08:58:28.855 20302-20309/? I/art: Debugger is no longer active05-08 08:58:28.856 20302-20309/? I/art: Starting a blocking GC Instrumentation05-08 08:58:29.186 20302-20302/? I/art: Starting a blocking GC HeapTrim05-08 08:58:29.192 20302-20302/? I/InstantRun: starting instant run server: is main process05-08 08:58:29.283 20302-20302/? V/SDL: Device: MIX05-08 08:58:29.283 20302-20302/? V/SDL: Model: MIX05-08 08:58:29.283 20302-20302/? V/SDL: onCreate(): null05-08 08:58:29.424 20302-20302/? D/SurfaceView: checkSurfaceViewlLogProperty get invalid command05-08 08:58:29.483 20302-20302/? V/SDL: onResume()05-08 08:58:29.484 20302-20302/? V/PhoneWindow: DecorView setVisiblity: visibility = 4, Parent = null, this = DecorView@e46832d[]05-08 08:58:29.493 20302-20302/? D/WindowClient: Add to mViews: DecorView@e46832d[Monkey2Game], this = android.view.WindowManagerGlobal@9e689dc05-08 08:58:29.497 20302-20302/? D/OpenGLRenderer: Dumper init 4 threads <0xdd36c800><com.monkey2.monkey2game> is running.05-08 08:58:29.501 20302-20321/? D/OpenGLRenderer: CanvasContext() 0xdade280005-08 08:58:29.505 20302-20302/? D/ViewRootImpl[Monkey2Game]: hardware acceleration is enabled, this = ViewRoot{151eae5 com.monkey2.monkey2game/com.monkey2.monkey2game.Monkey2Game,ident = 0}05-08 08:58:29.510 20302-20302/? V/PhoneWindow: DecorView setVisiblity: visibility = 0, Parent = ViewRoot{151eae5 com.monkey2.monkey2game/com.monkey2.monkey2game.Monkey2Game,ident = 0}, this = DecorView@e46832d[Monkey2Game]05-08 08:58:29.516 20302-20302/? V/InputMethodManager: Not IME target window, ignoring05-08 08:58:29.517 20302-20302/? I/SurfaceView: updateWindow -- onWindowVisibilityChanged, visibility = 0, this = org.libsdl.app.SDLSurface{34bfb57 VFE...... .F....I. 0,0-0,0}05-08 08:58:29.538 20302-20321/? D/OpenGLRenderer: CanvasContext() 0xdade2800 initialize window=0xdadf4000, title=com.monkey2.monkey2game/com.monkey2.monkey2game.Monkey2Game05-08 08:58:29.539 20302-20302/? I/SurfaceView: updateWindow -- setFrame, this = org.libsdl.app.SDLSurface{34bfb57 VFE...... .F....ID 0,0-1184,720}05-08 08:58:29.540 20302-20302/? I/SurfaceView: 55311191 Changes: creating=true format=true size=true visible=true left=true top=true mUpdateWindowNeeded=false mReportDrawNeeded=false redrawNeeded=false forceSizeChanged=true mVisible=false mRequestedVisible=true, this = org.libsdl.app.SDLSurface{34bfb57 VFE...... .F....ID 0,0-1184,720}05-08 08:58:29.543 20302-20302/? I/SurfaceView: 55311191 Cur surface: Surface(name=null)/@0x790f9ba, this = org.libsdl.app.SDLSurface{34bfb57 VFE...... .F....ID 0,0-1184,720}05-08 08:58:29.551 20302-20314/? V/SurfaceView: this = org.libsdl.app.SDLSurface{34bfb57 VFE...... .F....ID 0,0-1184,720} got resized: w=1184 h=720, cur w=-1 h=-105-08 08:58:29.553 20302-20302/? I/SurfaceView: 55311191 New surface: Surface(name=null)/@0x4ad306b, vis=true, frame=Rect(0, 0 - 1184, 720), this = org.libsdl.app.SDLSurface{34bfb57 VFE...... .F....ID 0,0-1184,720}55311191 visibleChanged -- surfaceCreated, this = org.libsdl.app.SDLSurface{34bfb57 VFE...... .F....ID 0,0-1184,720}surfaceCreated callback +, this = org.libsdl.app.SDLSurface{34bfb57 VFE...... .F....ID 0,0-1184,720}05-08 08:58:29.553 20302-20302/? V/SDL: surfaceCreated()05-08 08:58:29.554 20302-20302/? I/SurfaceView: surfaceCreated callback -, this = org.libsdl.app.SDLSurface{34bfb57 VFE...... .F....ID 0,0-1184,720}55311191 surfaceChanged -- format=4 w=1184 h=720, this = org.libsdl.app.SDLSurface{34bfb57 VFE...... .F....ID 0,0-1184,720}surfaceChanged callback +, this = org.libsdl.app.SDLSurface{34bfb57 VFE...... .F....ID 0,0-1184,720}05-08 08:58:29.554 20302-20302/? V/SDL: surfaceChanged()pixel format RGB_56505-08 08:58:29.569 20302-20302/? V/SDL: Window size: 1184x72005-08 08:58:29.570 20302-20321/? I/OpenGLRenderer: Initialized EGL, version 1.405-08 08:58:29.570 20302-20321/? D/OpenGLRenderer: Swap behavior 105-08 08:58:29.579 20302-20336/? I/SDL: SDL_Android_Init()SDL_Android_Init() finished!05-08 08:58:29.583 20302-20302/? I/SurfaceView: surfaceChanged callback -, this = org.libsdl.app.SDLSurface{34bfb57 VFE...... .F....ID 0,0-1184,720}55311191 surfaceRedrawNeeded, this = org.libsdl.app.SDLSurface{34bfb57 VFE...... .F....ID 0,0-1184,720}55311191 finishedDrawing, this = org.libsdl.app.SDLSurface{34bfb57 VFE...... .F....ID 0,0-1184,720}05-08 08:58:29.586 20302-20321/? D/OpenGLRenderer: Created EGL context (0xdc010800)05-08 08:58:29.587 20302-20302/? V/SurfaceView: Layout: x=0 y=0 w=1184 h=720, frame=Rect(0, 0 - 1184, 720), this = org.libsdl.app.SDLSurface{34bfb57 VFE...... .F....ID 0,0-1184,720}05-08 08:58:29.588 20302-20321/? D/OpenGLRenderer: ProgramCache.init: enable enhancement 105-08 08:58:29.588 20302-20321/? I/OpenGLRenderer: Get disable program binary service property (0)Initializing program atlas...05-08 08:58:29.588 20302-20321/? I/ProgramBinary/Service: ProgramBinaryService client side disable debugging.ProgramBinaryService client side disable binary content debugging.05-08 08:58:29.589 20302-20321/? D/ProgramBinary/Service: BpProgramBinaryService.getReadyBpProgramBinaryService.getProgramBinaryData05-08 08:58:29.589 20302-20321/? I/OpenGLRenderer: Program binary detail: Binary length is 249276, program map length is 124.05-08 08:58:29.590 20302-20321/? I/OpenGLRenderer: Succeeded to mmap program binaries. File descriptor is 68, and path is /dev/ashmem.No need to use file discriptor anymore, close fd(68).05-08 08:58:29.590 20302-20321/? D/OpenGLRenderer: Initializing program cache from 0x0, size = -105-08 08:58:29.590 20302-20321/? D/Surface: Surface::connect(this=0xdadf4000,api=1)05-08 08:58:29.591 20302-20321/? W/libEGL: [ANDROID_RECORDABLE] format: 105-08 08:58:29.593 20302-20321/? D/mali_winsys: EGLint new_window_surface(egl_winsys_display*, void*, EGLSurface, EGLConfig, egl_winsys_surface**, egl_color_buffer_format*, EGLBoolean) returns 0x300005-08 08:58:29.596 20302-20302/? I/SurfaceView: 55311191 Changes: creating=false format=false size=false visible=false left=false top=false mUpdateWindowNeeded=true mReportDrawNeeded=true redrawNeeded=false forceSizeChanged=false mVisible=true mRequestedVisible=true, this = org.libsdl.app.SDLSurface{34bfb57 VFE...... .F....ID 0,0-1184,720}55311191 Cur surface: Surface(name=null)/@0x790f9ba, this = org.libsdl.app.SDLSurface{34bfb57 VFE...... .F....ID 0,0-1184,720}05-08 08:58:29.600 20302-20302/? I/SurfaceView: 55311191 New surface: Surface(name=null)/@0x4ad306b, vis=true, frame=Rect(0, 0 - 1184, 720), this = org.libsdl.app.SDLSurface{34bfb57 VFE...... .F....ID 0,0-1184,720}05-08 08:58:29.601 20302-20302/? I/SurfaceView: 55311191 surfaceRedrawNeeded, this = org.libsdl.app.SDLSurface{34bfb57 VFE...... .F....ID 0,0-1184,720}55311191 finishedDrawing, this = org.libsdl.app.SDLSurface{34bfb57 VFE...... .F....ID 0,0-1184,720}05-08 08:58:29.601 20302-20302/? V/SurfaceView: Layout: x=0 y=0 w=1184 h=720, frame=Rect(0, 0 - 1184, 720), this = org.libsdl.app.SDLSurface{34bfb57 VFE...... .F....ID 0,0-1184,720}05-08 08:58:29.605 20302-20338/? D/AudioTrack: getMinFrameCount=6144: afFrameCount=1024, afSampleRate=44100, afLatency=13905-08 08:58:29.609 20302-20302/? I/SurfaceView: Punch a hole(dispatchDraw), this = org.libsdl.app.SDLSurface{34bfb57 VFE...... .F...... 0,0-1184,720}05-08 08:58:29.609 20302-20338/? D/AudioTrack: set(): 0xcada8c00, streamType -1, sampleRate 44100, format 0x1, channelMask 0x3, frameCount 6144, flags #0, notificationFrames 0, sessionId 0, transferType 3, uid -1, pid -105-08 08:58:29.610 20302-20338/? D/AudioTrack: audiotrack 0xcada8c00 set Type -1, rate 44100, fmt 1, chn 3, fcnt 6144, flags 000005-08 08:58:29.611 20302-20321/? D/OpenGLRenderer: ProgramCache.generateProgram: 109951162778405-08 08:58:29.613 20302-20339/? I/SceneKnowledgeProvider: SKP: notifyChange(1, 3, -1)05-08 08:58:29.616 20302-20338/? D/AudioTrack: createTrack_l: 0xcada8c00, mCblk = 0xca200000, mLatency = 278, mAfLatency = 139, frameCount = 6144, mSampleRate = 44100, mFlags = 0, mReqFrameCount = 614405-08 08:58:29.617 20302-20338/? D/AudioTrackCenter: addTrack, trackId:0xca200000, frameCount:6144, sampleRate:44100, trackPtr:0xcada8c00addTrack: trackPtr = 0xcada8c00, trackId = 0xca200000, mAfSampleRate = 44100, sampleRate = 44100, AfFrameCount = 1024 , mAfSampleRate = 44100, frameCount = 6144, framesFilled = 0addTrack: trackId, info.server, info.framePlayed, info.ts, 0xca200000, 0, 0, 711535396305-08 08:58:29.618 20302-20338/? D/AudioTrack: start(): 0xcada8c00, mState = 105-08 08:58:29.620 20302-20338/? D/AudioTrack: AudioTrackThread::resume05-08 08:58:29.620 20302-20338/? D/AudioTrackCenter: setTrackActive, trackId: 0xca200000, active: 105-08 08:58:29.621 20302-20338/? I/OpenAL: _SC_NPROCESSORS_ONLN=505-08 08:58:29.622 20302-20340/? D/SurfaceView: 55311191 updateWindowPosition RT, frameNr = 1, postion = [0, 0, 1184, 720]05-08 08:58:29.644 20302-20321/? D/OpenGLRenderer: ProgramCache.generateProgram: 005-08 08:58:29.675 20302-20302/? V/SDL: onWindowFocusChanged(): true05-08 08:58:29.675 20302-20302/? V/InputMethodManager: onWindowFocus: org.libsdl.app.SDLSurface{34bfb57 VFE...... .F...... 0,0-1184,720} softInputMode=32 first=true flags=#181050005-08 08:58:29.687 20302-20302/? I/SurfaceView: updateWindow -- UPDATE_WINDOW_MSG, this = Handler (android.view.SurfaceView$1) {d6c6847}05-08 08:58:29.724 20302-20336/? D/Surface: Surface::setBuffersUserDimensions(this=0xdadf4e00,w=0,h=0)05-08 08:58:29.725 20302-20336/? D/Surface: Surface::connect(this=0xdadf4e00,api=1)05-08 08:58:29.726 20302-20336/? W/libEGL: [ANDROID_RECORDABLE] format: 205-08 08:58:29.727 20302-20336/? D/mali_winsys: EGLint new_window_surface(egl_winsys_display*, void*, EGLSurface, EGLConfig, egl_winsys_surface**, egl_color_buffer_format*, EGLBoolean) returns 0x300005-08 08:58:29.985 20302-20336/com.monkey2.monkey2game I/MX2: GL_VERSION=OpenGL ES 3.2 v1.r12p0-04rel0.2034b5b303dca12c48abf5518afe7d96Renderer is using forward rendering05-08 08:58:32.701 20302-20336/com.monkey2.monkey2game I/MX2: 1:2: #ifdef GL_ES3: #ifdef GL_FRAGMENT_PRECISION_HIGH4: precision highp float;5: #else6: precision mediump float;7: #endif8: #endif9: #define MX2_RENDERPASS 110: #define MX2_FORWARDRENDERER 111: #define MX2_LINEAROUTPUT 112: #define MX2_ATTRIBMASK 713:14: // **** MX2_RENDERPASS *****15: //16: // PASSTYPE 'mask=3, 0=quad, 1=deferred, 2=forward, 3=shadow17: // LIGHTTYPE 'mask=12, 0=none, 1=directional, 2=point, 3=spot18: // SHADOWTYPE 'mask=16, 0=no shadows, 1=shadows19: //20: #ifndef MX2_RENDERPASS21: #define MX2_RENDERPASS 022: #endif23:24: #ifndef MX2_FORWARDRENDERER25: #define MX2_FORWARDRENDERER 026: #endif27:28: #ifndef MX2_DEFERREDRENDERER29: #define MX2_DEFERREDRENDERER 030: #endif31:32: #ifndef MX2_SRGBOUTPUT33: #define MX2_SRGBOUTPUT 034: #endif35:36: #define MX2_PASSTYPE ((MX2_RENDERPASS & 3))37: #define MX2_LIGHTTYPE ((MX2_RENDERPASS & 12)>>2)38: #define MX2_SHADOWTYPE ((MX2_RENDERPASS & 16)>>4)39:40: #define MX2_DIRECTIONALLIGHT (MX2_LIGHTTYPE==1)41: #define MX2_POINTLIGHT (MX2_LIGHTTYPE==2)42: #define MX2_SPOTLIGHT (MX2_LIGHTTYPE==3)43:44: #define MX2_QUADPASS (MX2_PASSTYPE==0)45: #define MX2_DEFERREDPASS (MX2_PASSTYPE==1)46: #define MX2_FORWARDPASS (MX2_PASSTYPE==2)05-08 08:58:32.702 20302-20336/com.monkey2.monkey2game I/MX2: 47: #define MX2_SHADOWPASS (MX2_PASSTYPE==3)48:49: #define MX2_AMBIENTPASS (MX2_PASSTYPE==1 || MX2_PASSTYPE==2)50: #define MX2_LIGHTINGPASS (MX2_LIGHTTYPE!=0 && MX2_SHADOWPASS==0)51: #define MX2_COLORPASS (MX2_AMBIENTPASS || MX2_LIGHTINGPASS)52:53: // ***** MX2_ATTRIBMASK *****54: //55: // Position 156: // Normal 257: // Color 458: // TexCoord0 859: // TexCoord1 1660: // Tangent 3261: // Weights 6462: // Bones 12863:64: #ifndef MX2_ATTRIBMASK65: #define MX2_ATTRIBMASK 066: #endif67: #define MX2_TEXTURED ((MX2_ATTRIBMASK & 24)!=0)68: #define MX2_BUMPMAPPED ((MX2_ATTRIBMASK & 32)==32)69: #define MX2_BONED ((MX2_ATTRIBMASK & 192)==192)70:71: //***** CONSTS *****72: //73: const float pi=3.1415926535897932384626433832795;74:75: //***** RENDER *****76: //77: uniform float r_Time;78: uniform vec4 r_AmbientDiffuse;79:80: uniform samplerCube r_SkyTextureCube;81: uniform sampler2D r_SkyTexture2D;82: uniform bool r_SkyCube;83:84: uniform samplerCube r_EnvTextureCube;85: uniform sampler2D r_EnvTexture2D;86: uniform bool r_EnvCube;87: uniform float r_EnvTextureMaxLod;88: uniform vec4 r_EnvColor;89: uniform mat3 r_EnvMatrix;90:91: uniform float r_DepthNear;92: uniform float r_DepthFar;93: uniform float r_FogNear;94: uniform float r_FogFar;95: uniform vec4 r_FogColor;96: uniform mat4 r_InverseProjectionMatrix;97: uniform mat4 r_ProjectionMatrix;98: uniform mat4 r_ViewMatrix;99:100: // These only available in deferred renderer!101: uniform sampler2D r_AccumBuffer;102: uniform sampler2D r_ColorBuffer;103: uniform sampler2D r_NormalBuffer;104: uniform sampler2D r_DepthBuffer;105: uniform vec2 r_BufferCoordScale;106:107: //***** LIGHTING *****108: //109: uniform mat4 r_LightViewMatrix;110: uniform mat4 r_InverseLightViewMatrix;111: uniform samplerCube r_LightCubeTexture;112: uniform sampler2D r_LightTexture;113: uniform vec4 r_LightColor;114: uniform float r_LightRange;115: uniform float r_LightInnerAngle;116: uniform float r_LightOuterAngle;117:118: //***** SHADOWS *****119: //120: uniform sampler2D r_ShadowCSMTexture;121: uniform samplerCube r_ShadowCubeTexture;122: uniform vec4 r_ShadowCSMSplits;123: uniform mat4 r_ShadowMatrix0;124: uniform mat4 r_ShadowMatrix1;125: uniform mat4 r_ShadowMatrix2;05-08 08:58:32.703 20302-20336/com.monkey2.monkey2game I/MX2: 126: uniform mat4 r_ShadowMatrix3;127: uniform float r_ShadowAlpha;128:129: //***** INSTANCE *****130: //131: uniform mat4 i_ModelMatrix;132: uniform mat4 i_ModelViewMatrix;133: uniform mat4 i_ModelViewProjectionMatrix;134: uniform mat3 i_ModelViewNormalMatrix;135: uniform mat4 i_ModelBoneMatrices[96];136: uniform vec4 i_Color;137: uniform float i_Alpha;138:139: //***** MATERIAL *****140: //141: uniform mat3 m_TextureMatrix;142:143: //***** VARYINGS *****144: //145: varying vec2 v_ClipPosition;146: varying vec2 v_BufferCoords;147: varying vec3 v_Position;148: varying vec3 v_Normal;149: varying vec4 v_Color;150: varying vec2 v_TexCoord0;151: varying vec2 v_TexCoord1;152: varying mat3 v_TanMatrix;153:154:155: //@import "std"156:157:158: //@renderpasses 1,7,11,15,2,6,10,14,22,26,30159:160: //@import "pbr"161:162:05-08 08:58:32.708 20302-20336/com.monkey2.monkey2game I/MX2: 163: //@fragment164:165: vec4 FloatToRGBA( float value ){166:167: const float MaxFloat=0.9999999;168: value=clamp( value,0.0,MaxFloat );169: vec4 rgba=fract( vec4( 1.0, 255.0, 65025.0, 16581375.0 ) * value );170: return rgba-rgba.yzww * vec4( 1.0/255.0, 1.0/255.0, 1.0/255.0, 0.0 );171: }172:173: float RGBAToFloat( vec4 rgba ){174:175: return dot( rgba,vec4( 1.0, 1.0/255.0, 1.0/65025.0, 1.0/16581375.0 ) );176: }177:178: float viewDepth( float depthBufferDepth ){179:180: return r_DepthFar * r_DepthNear / ( r_DepthFar + depthBufferDepth * ( r_DepthNear - r_DepthFar ) );181: }182:183: #if MX2_QUADPASS184:185: vec3 fragmentPosition(){186:187: float depth=viewDepth( texture2D( r_DepthBuffer,v_BufferCoords ).r );188:189: vec4 vpos4=r_InverseProjectionMatrix * vec4( v_ClipPosition,-1.0,1.0 );190:191: vec3 vpos=vpos4.xyz/vpos4.w;192:193: //debug z coord...194: //195: if( abs( vpos.z-r_DepthNear)>0.00001 ){196: // gl_FragColor=vec4( 1.0,0.0,0.0,1.0 );197: // return vec3( 0.0 );05-08 08:58:32.709 20302-20336/com.monkey2.monkey2game I/MX2: 198: }199:200: vec3 position=vpos/vpos.z*depth;201:202: return position;203: }204:205: #else206:207: vec3 fragmentPosition(){208:209: return v_Position;210: }211:212: #endif213:214: #if MX2_LIGHTINGPASS && MX2_SHADOWTYPE215:216: float shadowColor( vec3 position ){217:218: #if MX2_DIRECTIONALLIGHT219:220: if( position.z>=r_ShadowCSMSplits.w ) return 1.0;221:222: vec4 vpos=vec4( position,1.0 );223: vec2 off;224:225: if( vpos.z<r_ShadowCSMSplits.x ){226: vpos=r_ShadowMatrix0 * vpos;227: off=vec2( 0.0,0.0 );228: }else if( vpos.z<r_ShadowCSMSplits.y ){229: vpos=r_ShadowMatrix1 * vpos;230: off=vec2( 0.5,0.0 );231: }else if( vpos.z<r_ShadowCSMSplits.z ){232: vpos=r_ShadowMatrix2 * vpos;233: off=vec2( 0.0,0.5 );234: }else{235: vpos=r_ShadowMatrix3 * vpos;236: off=vec2( 0.5,0.5 );237: }238:239: vec3 spos=vpos.xyz/vpos.w * vec3( 0.25,0.25,0.5 ) + vec3( 0.25,0.25,0.5 );240:241: float d=texture2D( r_ShadowCSMTexture,spos.xy+off ).r;242:243: if( spos.z>d ) return 1.0-r_ShadowAlpha;244:245: return 1.0;246:247: #elif MX2_POINTLIGHT248:249: vec4 vpos=vec4( position,1.0 );250:251: vec3 lpos=(r_ShadowMatrix0 * vpos).xyz;252:253: float d=RGBAToFloat( textureCube( r_ShadowCubeTexture,lpos ) );254:255: if( length(lpos) > d * r_LightRange ) return 1.0-r_ShadowAlpha;256:257: return 1.0;258:259: #elif MX2_SPOTLIGHT260:261: vec4 vpos=r_ShadowMatrix0 * vec4( position,1.0 );262:263: vec3 spos=vpos.xyz/vpos.w * vec3( 0.25,0.25,0.5 ) + vec3( 0.25,0.25,0.5 );264:265: float d=texture2D( r_ShadowCSMTexture,spos.xy ).r;266:267: if( spos.z>d ) return 1.0-r_ShadowAlpha;268:269: return 1.0;270:271: #endif272: }273:274: #endif275:276: /*277: float mipmapLod( vec2 tc ){278: vec2 dx=dFdx( tc );279: vec2 dy=dFdy( tc );280: float dsqr=max( dot( dx,dx ),dot( dy,dy ) );05-08 08:58:32.710 20302-20336/com.monkey2.monkey2game I/MX2: 281: float lod=log2( dsqr ) * 0.5;282: return max( lod,0.0 );283: }284:285: float mipmapLodCube( vec3 tv ){286: vec2 tc;287: vec3 at=abs( tv );288: if( at.x>at.y && at.x>at.z ){289: tc=vec2( tv.y,tv.z )/tv.x;290: }else if( at.y>at.z ){291: tc=vec2( tv.x,tv.z )/tv.y;292: }else{293: tc=vec2( tv.x,tv.y )/tv.z;294: }295: return mipmapLod( (tc+1.0)*0.5 );296: }297: */298:299: vec3 sampleEnv( vec3 viewVec,float roughness ){300:301: vec3 tv=r_EnvMatrix * viewVec;302:303: if( r_EnvCube ){304:305: float r_EnvTextureMaxLod=11.0;306:307: //#ifdef GL_ES308: float lod=textureCube( r_EnvTextureCube,tv ).a * 255.0;309: if( lod==0 ) lod=textureCube( r_EnvTextureCube,tv,r_EnvTextureMaxLod ).a * 255.0 - r_EnvTextureMaxLod;310: return pow( textureCube( r_EnvTextureCube,tv,max( roughness*r_EnvTextureMaxLod-lod,0.0 ) ).rgb,vec3( 2.2 ) ) * r_EnvColor.rgb;311: //#else312: // return pow( textureCube( r_EnvTextureCube,tv,roughness*r_EnvTextureMaxLod ).rgb,vec3( 2.2 ) ) * r_EnvColor.rgb;313: //#endif314:315: }else{316:317: float p=-atan( tv.y,sqrt( tv.x*tv.x+tv.z*tv.z ) ) / pi + 0.5;318: float y=atan( tv.x,tv.z ) / pi * 0.5 + 0.5;319: vec2 tc=vec2( y,p );320:321: //#ifdef GL_ES322: float lod=texture2D( r_EnvTexture2D,tc ).a * 255.0;323: if( lod==0.0 ) lod=texture2D( r_EnvTexture2D,tc,r_EnvTextureMaxLod ).a * 255.0 - r_EnvTextureMaxLod;324: return pow( texture2D( r_EnvTexture2D,tc,max( roughness*r_EnvTextureMaxLod-lod,0.0 ) ).rgb,vec3( 2.2 ) ) * r_EnvColor.rgb;325: //else326: // return pow( texture2DLod( r_EnvTexture2D,tc,max( mipmapLod( tc ),roughness*r_EnvTextureMaxLod ) ).rgb,vec3( 2.2 ) ) * r_EnvColor.rgb;327:328: //#endif329: }330: }331:332: #if MX2_FORWARDRENDERER || MX2_FORWARDPASS333:334: void emitLinearFragment( vec4 color ){05-08 08:58:32.711 20302-20336/com.monkey2.monkey2game I/MX2: 335:336: #if MX2_SRGBOUTPUT337: gl_FragColor=vec4( pow( color.rgb*color.a,vec3( 1.0/2.2 ) ),color.a );338: #else339: gl_FragColor=vec4( color.rgb*color.a,color.a );340: #endif341: }342:343: void emitColorFragment( vec4 color ){344:345: float fog=clamp( (length( v_Position )-r_FogNear)/(r_FogFar-r_FogNear),0.0,1.0 ) * r_FogColor.a;346:347: color.rgb=mix( color.rgb,r_FogColor.rgb,fog );348:349: emitLinearFragment( color );350: }351:352: #endif353:354: #if MX2_SHADOWPASS355:356: void emitShadowFragment(){357:358: #if MX2_DIRECTIONALLIGHT || MX2_SPOTLIGHT359: gl_FragColor=vec4( vec3( gl_FragCoord.z ),1.0 );360: #elif MX2_POINTLIGHT361: gl_FragColor=FloatToRGBA( min( length( v_Position )/r_LightRange,1.0 ) );362: #endif363: }364:365: #endif366:367:368:369:370: //@fragment371:372: #if MX2_QUADPASS && MX2_LIGHTINGPASS373:374: void emitPbrFragment( vec3 color,float metalness,float roughness,vec3 position,vec3 normal ){375:376: float glosiness=1.0-roughness;377: vec3 color0=vec3( 0.04,0.04,0.04 );378: vec3 diffuse=color * (1.0-metalness);379: vec3 specular=(color-color0) * metalness + color0;380:381: #if MX2_DIRECTIONALLIGHT382:383: vec3 lvec=normalize( -r_LightViewMatrix[2].xyz );384: float atten=1.0;385:386: #elif MX2_POINTLIGHT387:388: // TODO: https://imdoingitwrong.wordpress.com/2011/01/31/light-attenuation/389: vec3 lvec=r_LightViewMatrix[3].xyz-position;390: float atten=max( 1.0-length( lvec )/r_LightRange,0.0 );391: lvec=normalize( lvec );392:393: #elif MX2_SPOTLIGHT394:395: vec3 lvec=r_LightViewMatrix[3].xyz-position;396: float atten=max( 1.0-length( lvec )/r_LightRange,0.0 );397: lvec=normalize( lvec );398:399: float cosangle=dot( -lvec,r_LightViewMatrix[2].xyz );400: if( cosangle<0.0 ) return; //behind spotlight direction401:402: float angle=acos( cosangle );403: if( angle>r_LightOuterAngle ) return; //outside outer cone404:405: atten*=1.0-max( (angle-r_LightInnerAngle)/(r_LightOuterAngle-r_LightInnerAngle),0.0 );406:407: #endif408:409: vec3 vvec=normalize( -position );410: vec3 hvec=normalize( lvec+vvec );411:412: float hdotl=max( dot( hvec,lvec ),0.0 );413: float ndotl=max( dot( normal,lvec ),0.0 );414: float ndoth=max( dot( normal,hvec ),0.0 );415:416: float spow=pow( 2.0,glosiness * 12.0 );417: // float spow=pow( 2048.0,glosiness );418:419: float fnorm=(spow+2.0)/8.0;420:421: vec3 fschlick=specular + (1.0-specular) * pow( 1.0-hdotl,5.0 ) * glosiness;422:423: specular=fschlick * pow( ndoth,spow ) * fnorm;424:425: vec3 light=r_LightColor.rgb * ndotl * atten;05-08 08:58:32.712 20302-20336/com.monkey2.monkey2game I/MX2: 426:427: #if MX2_POINTLIGHT428:429: vec3 lpos=(r_InverseLightViewMatrix * vec4( position,1.0 )).xyz;430: light*=pow( textureCube( r_LightCubeTexture,lpos ).rgb,vec3( 2.2 ) );431:432: #elif MX2_SPOTLIGHT433:434: vec3 lpos=(r_InverseLightViewMatrix * vec4( position,1.0 )).xyz;435: lpos.xy=lpos.xy/lpos.z * 0.5 + 0.5;436: lpos.y=1.0-lpos.y;437: light*=pow( texture2D( r_LightTexture,lpos.xy ).rgb,vec3( 2.2 ) );438:439: #endif440:441: #if MX2_SHADOWTYPE442: light*=shadowColor( position );443: #endif444:445: vec3 frag=(diffuse+specular) * light;446:447: gl_FragColor=vec4( min( frag,8.0 ),1.0 );448: }449:450: #endif451:452: #if MX2_COLORPASS && MX2_DEFERREDPASS453:454: //deferred PBR lighting455: //456: void emitPbrFragment( vec4 color,vec3 ambient,vec3 emissive,float metalness,float roughness,float occlusion,vec3 normal ){457:458: color*=v_Color;459:460: float glosiness=1.0-roughness;461: vec3 color0=vec3( 0.04,0.04,0.04 );462: vec3 diffuse=color.rgb * (1.0-metalness);463: vec3 specular=(color.rgb-color0) * metalness + color0;464:465: vec3 vvec=normalize( -v_Position );466: float ndotv=max( dot( normal,vvec ),0.0 );467:468: vec3 ambEnv=sampleEnv( reflect( v_Position,normal ),roughness );469:470: /*471: vec3 rvec=r_EnvMatrix * reflect( v_Position,normal );472:473: float lod=textureCube( r_EnvTexture,rvec,r_EnvTextureMaxLod ).a * 255.0 - r_EnvTextureMaxLod;474: if( lod>0.0 ) lod=textureCube( r_EnvTexture,rvec ).a * 255.0;475:476: // float lod=textureCube( r_EnvTexture,rvec ).a * 255.0;477: // if( lod==0.0 ) lod=textureCube( r_EnvTexture,rvec,r_EnvTextureMaxLod ).a * 255.0 - r_EnvTextureMaxLod;478:479: vec3 ambEnv=pow( textureCube( r_EnvTexture,rvec,max( roughness*r_EnvTextureMaxLod-lod,0.0 ) ).rgb,vec3( 2.2 ) ) * r_EnvColor.rgb;480: */481:482: vec3 fschlick0=specular + (1.0-specular) * pow( 1.0-ndotv,5.0 ) * glosiness;483:484: vec3 ambDiffuse=diffuse * (r_AmbientDiffuse.rgb+ambient);485:486: vec3 ambSpecular=fschlick0 * ambEnv;487:488: vec3 frag=(ambDiffuse + ambSpecular) * occlusion + emissive;489:490: #if MX2_DEFERREDRENDERER491: //write ambient492: gl_FragData[0]=vec4( min( frag,8.0 ),1.0 );05-08 08:58:32.713 20302-20336/com.monkey2.monkey2game I/MX2: 493:494: //write color/metalness495: gl_FragData[1]=vec4( color.rgb,metalness );496:497: //write normal/roughness498: gl_FragData[2]=vec4( normal * 0.5 + 0.5,roughness );499: #endif500: }501:502: #endif503:504: #if MX2_COLORPASS && MX2_FORWARDPASS505:506: //forward PBR lighting507: //508: void emitPbrFragment( vec4 color,vec3 ambient,vec3 emissive,float metalness,float roughness,float occlusion,vec3 normal ){509:510: color*=v_Color;511:512: const vec3 color0=vec3( 0.04,0.04,0.04 );513:514: float glosiness=1.0-roughness;515: vec3 diffuse=color.rgb * (1.0-metalness);516: vec3 specular=(color.rgb-color0) * metalness + color0;517:518: vec3 vvec=normalize( -v_Position );519: float ndotv=dot( normal,vvec );520:521: vec3 frag=vec3( 0.0 );522:523: #if MX2_AMBIENTPASS524: //ambient color525: vec3 ambEnv=sampleEnv( reflect( v_Position,normal ),roughness );526: /*527: vec3 rvec=r_EnvMatrix * reflect( v_Position,normal );528:529: float lod=textureCube( r_EnvTexture,rvec,r_EnvTextureMaxLod ).a * 255.0 - r_EnvTextureMaxLod;530: if( lod>0.0 ) lod=textureCube( r_EnvTexture,rvec ).a * 255.0;531:532: // float lod=textureCube( r_EnvTexture,rvec ).a * 255.0;533: // if( lod==0.0 ) lod=textureCube( r_EnvTexture,rvec,r_EnvTextureMaxLod ).a * 255.0 - r_EnvTextureMaxLod;534:535: vec3 ambEnv=pow( textureCube( r_EnvTexture,rvec,max( roughness*r_EnvTextureMaxLod-lod,0.0 ) ).rgb,vec3( 2.2 ) ) * r_EnvColor.rgb;536: */537:538: vec3 fschlick0=specular + (1.0-specular) * pow( 1.0-ndotv,5.0 ) * glosiness;539:540: vec3 ambDiffuse=diffuse * (r_AmbientDiffuse.rgb+ambient);541:542: vec3 ambSpecular=fschlick0 * ambEnv;543:544: frag+=( ambDiffuse + ambSpecular ) * occlusion + emissive;545: #endif546:547: #if MX2_LIGHTINGPASS548: //lighting color549: float spow=pow( 2.0,glosiness * 12.0 ); //specular power550: // float spow=pow( 4096.0,glosiness );551: float fnorm=(spow+2.0)/8.0; //normalization factor552:553: #if MX2_DIRECTIONALLIGHT554:555: vec3 lvec=normalize( -r_LightViewMatrix[2].xyz );556: float atten=1.0;557:558: #elif MX2_POINTLIGHT559:560: vec3 lvec=r_LightViewMatrix[3].xyz-v_Position;561: float atten=max( 1.0-length( lvec )/r_LightRange,0.0 );562: lvec=normalize( lvec );563:564: #elif MX2_SPOTLIGHT565:566: vec3 lvec=r_LightViewMatrix[3].xyz-v_Position;567: float atten=max( 1.0-length( lvec )/r_LightRange,0.0 );568: lvec=normalize( lvec );569:570: float cosangle=dot( -lvec,r_LightViewMatrix[2].xyz );571: if( cosangle<0.0 ) return; //behind spotlight direction572:573: float angle=acos( cosangle );574: if( angle>r_LightOuterAngle ) return; //outside outer cone575:576: atten*=1.0-max( (angle-r_LightInnerAngle)/(r_LightOuterAngle-r_LightInnerAngle),0.0 );577:05-08 08:58:32.714 20302-20336/com.monkey2.monkey2game I/MX2: 578: #endif579: vec3 hvec=normalize( lvec+vvec );580:581: float ndotl=max( dot( normal,lvec ),0.0 );582: float ndoth=max( dot( normal,hvec ),0.0 );05-08 08:58:32.721 20302-20336/com.monkey2.monkey2game I/MX2: 583: float hdotl=max( dot( hvec,lvec ),0.0 );584:585: vec3 fschlick=specular + (1.0-specular) * pow( 1.0-hdotl,5.0 ) * glosiness;586:587: vec3 fspecular=fschlick * pow( ndoth,spow ) * fnorm;588:589: vec3 light=r_LightColor.rgb * ndotl * atten;590:591: light=(diffuse+fspecular) * light;592:593: #if MX2_SHADOWTYPE594: light*=shadowColor( v_Position );595: #endif596:597: frag+=light;598:599: #endif //MX2_LIGHTINGPASS600:601: color.rgb=frag;602:603: emitColorFragment( color );604: }605:606: #endif607:608:609: //@fragment610:611: #if MX2_COLORPASS //is this a color pass?612:613: #if MX2_TEXTURED614: uniform sampler2D m_ColorTexture;615: uniform sampler2D m_AmbientTexture;616: uniform sampler2D m_EmissiveTexture;617: uniform sampler2D m_MetalnessTexture;618: uniform sampler2D m_RoughnessTexture;619: uniform sampler2D m_OcclusionTexture;620: #if MX2_BUMPMAPPED621: uniform sampler2D m_NormalTexture;622: #endif623: #endif624:625: uniform vec4 m_ColorFactor;626: uniform vec4 m_AmbientFactor;627: uniform vec4 m_EmissiveFactor;628: uniform float m_MetalnessFactor;629: uniform float m_RoughnessFactor;630:631: void main(){632:633: #if MX2_TEXTURED634: vec4 color=texture2D( m_ColorTexture,v_TexCoord0 );635: color.rgb=pow( color.rgb,vec3( 2.2 ) );05-08 08:58:32.722 20302-20336/com.monkey2.monkey2game I/MX2: 636: color*=m_ColorFactor;637:638: vec3 ambient=pow( texture2D( m_AmbientTexture,v_TexCoord1 ).rgb,vec3( 2.2 ) ) * m_AmbientFactor.rgb;639:640: vec3 emissive=pow( texture2D( m_EmissiveTexture,v_TexCoord0 ).rgb,vec3( 2.2 ) ) * m_EmissiveFactor.rgb;641:642: float metalness=texture2D( m_MetalnessTexture,v_TexCoord0 ).b * m_MetalnessFactor;643:644: float roughness=texture2D( m_RoughnessTexture,v_TexCoord0 ).g * m_RoughnessFactor;645:646: float occlusion=texture2D( m_OcclusionTexture,v_TexCoord0 ).r;647:648: #if MX2_BUMPMAPPED649: vec3 normal=texture2D( m_NormalTexture,v_TexCoord0 ).xyz * 2.0 - 1.0;650: normal=normalize( v_TanMatrix * normal );651: #else652: vec3 normal=normalize( v_Normal );653: #endif654:655: #else //untextured...656:657: vec4 color=m_ColorFactor;658:659: vec3 ambient=m_AmbientFactor.rgb;660:661: vec3 emissive=m_EmissiveFactor.rgb;662:663: float metalness=m_MetalnessFactor;664:665: float roughness=m_RoughnessFactor;666:667: float occlusion=1.0;668:669: vec3 normal=normalize( v_Normal );670: #endif671:672: emitPbrFragment( color,ambient,emissive,metalness,roughness,occlusion,normal );673: }674:675: #else //if not a color pass, must be a shadow pass...676:677: void main(){678:679: emitShadowFragment();680: }681:682: #endif683:684:Failed to compile fragment shader:0:309: S0001: Cannot compare 'float' with 'int'{{!DEBUG!}}>glCompile:monkey.types.Int(type:monkey.types.Int,source:monkey.types.String);C:/Apps/Coding/monkey2_x86_May5/modules/mojo/graphics/glutil.monkey2;212;6332777type:Int=35632source:String="~n#ifdef GL_ES~n#ifdef GL_FRAGMENT_PRECISION_HIGH~nprecision highp float;~n#else~nprecision mediump float"...shader:UInt=2status:Int=0lines:String[]=@0xc85e2008[684]>Rebuild:Void();C:/Apps/Coding/monkey2_x86_May5/modules/mojo/graphics/shader.monkey2;427;6332718Self:mojo.graphics.Shader=@0xcd3533c0chunks:String[]=@0xcd357ec0[3]cs:String="#define MX2_FORWARDRENDERER 1~n#define MX2_LINEAROUTPUT 1~n#define MX2_ATTRIBMASK 7~n~n// **** MX2_RENDE"...vs:String="#define MX2_FORWARDRENDERER 1~n#define MX2_LINEAROUTPUT 1~n#define MX2_ATTRIBMASK 7~n~n// **** MX2_RENDE"...fs:String="#define MX2_FORWARDRENDERER 1~n#define MX2_LINEAROUTPUT 1~n#define MX2_ATTRIBMASK 7~n~n// **** MX2_RENDE"...0:Int=005-08 08:58:32.723 20302-20336/com.monkey2.monkey2game I/MX2: 1:Int=11rpass:Int=1defs:String="#define MX2_RENDERPASS 1~n"vshader:Int=1>Bind:Void(renderPass:monkey.types.Int);C:/Apps/Coding/monkey2_x86_May5/modules/mojo/graphics/shader.monkey2;272;6332717Self:mojo.graphics.Shader=@0xcd3533c0renderPass:Int=7>Validate2:Void();C:/Apps/Coding/monkey2_x86_May5/modules/mojo/graphics/graphicsdevice.monkey2;653;6332678Self:mojo.graphics.GraphicsDevice=@0xcd3554d0>RenderIndexed:Void(order:monkey.types.Int,count:monkey.types.Int,offset:monkey.types.Int);C:/Apps/Coding/monkey2_x86_May5/modules/mojo/graphics/graphicsdevice.monkey2;333;6332677Self:mojo.graphics.GraphicsDevice=@0xcd3554d0order:Int=3count:Int=2304offset:Int=0>RenderShadowOps:Void(viewMatrix:std.geom.AffineMat4f,projMatrix:std.geom.Mat4f);C:/Apps/Coding/monkey2_x86_May5/modules/mojo3d/render/renderer.monkey2;751;6332477Self:mojo3d.Renderer=@0xca192548viewMatrix:std.geom.AffineMat4<monkey.types.Float>=@0xcb05e108:0xcc6a3ecdprojMatrix:std.geom.Mat4<monkey.types.Float>=@0xcb05e0c8:0xcc6995d9ops:std.collections.Stack<mojo3d.RenderOp>=@0xcd34f800viewProjMatrix:std.geom.Mat4<monkey.types.Float>=@0xcb05df44:0xcc6995d9instance:mojo3d.Entity=@0xcad97f08first:Bool=Falsematerial:mojo3d.Material=@0xcd354e30bones:std.geom.Mat4<monkey.types.Float>[]=@0[0]0:std.collections.Stack<mojo3d.RenderOp>.Iterator=@0xcb05de08:0xcc2a10a1op:mojo3d.RenderOp=@0xcd3574d8>RenderDirectionalShadows:Void(light:mojo3d.Light);C:/Apps/Coding/monkey2_x86_May5/modules/mojo3d/render/renderer.monkey2;437;6332177Self:mojo3d.Renderer=@0xca192548light:mojo3d.Light=@0xcad97d88t_rtarget:mojo.graphics.RenderTarget=@0xcd3546e8t_viewport:std.geom.Rect<monkey.types.Int>=@0xcb05e4a8:0xcc68cd8dt_scissor:std.geom.Rect<monkey.types.Int>=@0xcb05e498:0xcc68cd8dviewLight:std.geom.AffineMat4<monkey.types.Float>=@0xcb05e430:0xcc6a3ecdi:Int=0znear:Float=0.100000001zfar:Float=8.10000038splitProj:std.geom.Mat4<monkey.types.Float>=@0xcb05e358:0xcc6995d9invSplitProj:std.geom.Mat4<monkey.types.Float>=@0xcb05e318:0xcc6995d9bounds:std.geom.Box<monkey.types.Float>=@0xcb05e300:0xcc6a1971lightProj:std.geom.Mat4<monkey.types.Float>=@0xcb05e254:0xcc6995d9size:std.geom.Vec2<monkey.types.Int>=@0xcb05e1d0:0xcc689a4105-08 08:58:32.724 20302-20336/com.monkey2.monkey2game I/MX2: hsize:std.geom.Vec2<monkey.types.Int>=@0xcb05e1c8:0xcc689a41>RenderOpaqueForward:Void();C:/Apps/Coding/monkey2_x86_May5/modules/mojo3d/render/renderer.monkey2;242;6332168Self:mojo3d.Renderer=@0xca192548first:Bool=True0:std.collections.Stack<mojo3d.Light>.Iterator=@0xcb05e738:0xcc2e2869light:mojo3d.Light=@0xcad97d88renderPass:Int=21:mojo3d.LightType=1>RenderOpaque:Void();C:/Apps/Coding/monkey2_x86_May5/modules/mojo3d/render/renderer.monkey2;311;6332167Self:mojo3d.Renderer=@0xca192548>Render:Void(target:mojo.graphics.RenderTarget,targetSize:std.geom.Vec2i,viewport:std.geom.Recti,scene:mojo3d.Scene,viewMatrix:std.geom.AffineMat4f,projMatrix:std.geom.Mat4f,near:monkey.types.Float,far:monkey.types.Float);C:/Apps/Coding/monkey2_x86_May5/modules/mojo3d/render/renderer.monkey2;128;427289Self:mojo3d.Renderer=@0xca192548target:mojo.graphics.RenderTarget=@0targetSize:std.geom.Vec2<monkey.types.Int>=@0xcb05e9ac:0xcc689a41viewport:std.geom.Rect<monkey.types.Int>=@0xcb05e99c:0xcc68cd8dscene:mojo3d.Scene=@0xcd353f98viewMatrix:std.geom.AffineMat4<monkey.types.Float>=@0xcb05e96c:0xcc6a3ecdprojMatrix:std.geom.Mat4<monkey.types.Float>=@0xcb05e92c:0xcc6995d9near:Float=0.100000001far:Float=100>Render:Void(canvas:mojo.graphics.Canvas);C:/Apps/Coding/monkey2_x86_May5/modules/mojo3d/scene/entities/camera.monkey2;177;427230Self:mojo3d.Camera=@0xca192388canvas:mojo.graphics.Canvas=@0xca1921c8gdevice:mojo.graphics.GraphicsDevice=@0xcd350700rviewport:std.geom.Rect<monkey.types.Float>=@0xcb05e9ec:0xcc68fc91>OnRender:Void(canvas:mojo.graphics.Canvas);G:/Monkey-Projects/untitled1.monkey2;63;427117Self:myapp3d.MyWindow=@0xca192008canvas:mojo.graphics.Canvas=@0xca1921c8>Render:Void(canvas:mojo.graphics.Canvas);C:/Apps/Coding/monkey2_x86_May5/modules/mojo/app/view.monkey2;734;427028Self:mojo.app.View=@0xca192008canvas:mojo.graphics.Canvas=@0xca1921c8>RenderWindow:Void();C:/Apps/Coding/monkey2_x86_May5/modules/mojo/app/window.monkey2;538;426830Self:mojo.app.Window=@0xca192008bounds:std.geom.Rect<monkey.types.Int>=@0xcb05ecc0:0xcc68cd8d>UpdateWindow:Void(render:monkey.types.Bool);C:/Apps/Coding/monkey2_x86_May5/modules/mojo/app/window.monkey2;204;426731Self:mojo.app.Window=@0xca192008render:Bool=True>UpdateWindows:Void();C:/Apps/Coding/monkey2_x86_May5/modules/mojo/app/app.monkey2;509;426722Self:mojo.app.AppInstance=@0xcd34a098render:Bool=True0:mojo.app.Window[]=@0xcd355290[1]1:Int=02:Int=1window:mojo.app.Window=@0xca192008>MainLoop:Void();C:/Apps/Coding/monkey2_x86_May5/modules/mojo/app/app.monkey2;474;317822Self:mojo.app.AppInstance=@0xcd34a098>Run:Void();C:/Apps/Coding/monkey2_x86_May5/modules/mojo/app/app.monkey2;562;317821Self:mojo.app.AppInstance=@0xcd34a098>Main:Void();G:/Monkey-Projects/untitled1.monkey2;75;14605-08 08:58:32.729 20302-20336/com.monkey2.monkey2game D/Surface: Surface::disconnect(this=0xdadf4e00,api=1)05-08 08:58:32.730 20302-20336/com.monkey2.monkey2game D/Surface: Surface::disconnect(this=0xdadf4e00,api=1)05-08 08:58:32.753 20302-20336/com.monkey2.monkey2game D/MALI: osup_destructor:170: osup_destructor05-08 08:58:32.756 20302-20336/com.monkey2.monkey2game D/Surface: Surface::disconnect(this=0xdadf4000,api=1)if I comment out this line, also, _ground=Model.CreateBox( groundBox,1,1,1,groundMaterial )
then it works and displays a blue screen on the phone showing the fps.
I’m still testing things. Again, this is just the standard template for max3d.
Monkey12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576Namespace myapp3d#Import "<std>"#Import "<mojo>"#Import "<mojo3d>"Using std..Using mojo..Using mojo3d..Class MyWindow Extends WindowField _scene:SceneField _camera:CameraField _light:LightField _ground:ModelField _donut:ModelMethod New( title:String="Simple mojo3d app",width:Int=640,height:Int=480,flags:WindowFlags=WindowFlags.Resizable )Super.New( title,width,height,flags )EndMethod OnCreateWindow() Override'create (current) scene_scene=New Scene_scene.ClearColor = New Color( 0.2, 0.6, 1.0 )_scene.AmbientLight = _scene.ClearColor * 0.25_scene.FogColor = _scene.ClearColor_scene.FogFar = 1.0_scene.FogFar = 200.0'create camera_camera=New Camera( Self )_camera.AddComponent<FlyBehaviour>()_camera.Move( 0,2.5,-5 )'create light_light=New Light_light.CastsShadow=True_light.Rotate( 45, 45, 0 )'create groundLocal groundBox:=New Boxf( -100,-1,-100,100,0,100 )Local groundMaterial:=New PbrMaterial( Color.Lime )_ground=Model.CreateBox( groundBox,1,1,1,groundMaterial )' _ground.CastsShadow=False'' 'create donut' Local donutMaterial:=New PbrMaterial( Color.Red, 0.05, 0.2 )' _donut=Model.CreateTorus( 2,.5,48,24,donutMaterial )' _donut.Move( 0,2.5,0 )EndMethod OnRender( canvas:Canvas ) OverrideRequestRender()'_donut.Rotate( .2,.4,.6 )_scene.Update()_camera.Render( canvas )canvas.DrawText( "FPS="+App.FPS,0,0 )EndEndFunction Main()New AppInstanceNew MyWindowApp.Run()EndI just made a pledge. Things are better for me now so I will increase the next pledge to $30 a month for a minimum of 6 months.
Can I have my hearty poo now?
That looks pretty cool.
Would I be right in saying that a Lambda function is a normal function with the ability to be processed where you write it?
For example, if within the parameter of another function, I needed something to be determined, the result of the Lambda gets passed as the parameter value?
All working fine. Everything updated and built.
A fresh git pull just now and executing updatemx2cc from the command line gives the following error on std module again.
Monkey123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172C:\Apps\Coding\monkey2\scripts>updatemx2ccC:\Apps\Coding\monkey2\scripts>echo off***** Updating mx2cc *****Mx2cc version 1.1.09***** Making module 'monkey' (windows release x86 msvc) *****Parsing...Semanting...Translating...Compiling...Archiving C:/Apps/Coding/monkey2/modules/monkey/monkey.buildv1.1.09/windows_release_msvc/monkey.lib...***** Making module 'libc' (windows release x86 msvc) *****Parsing...Semanting...Translating...Compiling...Archiving C:/Apps/Coding/monkey2/modules/libc/libc.buildv1.1.09/windows_release_msvc/libc.lib...***** Making module 'miniz' (windows release x86 msvc) *****Parsing...Semanting...Translating...Compiling...Archiving C:/Apps/Coding/monkey2/modules/miniz/miniz.buildv1.1.09/windows_release_msvc/miniz.lib...***** Making module 'stb-image' (windows release x86 msvc) *****Parsing...Semanting...Translating...Compiling...Archiving C:/Apps/Coding/monkey2/modules/stb-image/stb-image.buildv1.1.09/windows_release_msvc/stb-image.lib...***** Making module 'stb-image-write' (windows release x86 msvc) *****Parsing...Semanting...Translating...Compiling...Archiving C:/Apps/Coding/monkey2/modules/stb-image-write/stb-image-write.buildv1.1.09/windows_release_msvc/stb-image-write.lib...***** Making module 'stb-vorbis' (windows release x86 msvc) *****Parsing...Semanting...Translating...Compiling...Archiving C:/Apps/Coding/monkey2/modules/stb-vorbis/stb-vorbis.buildv1.1.09/windows_release_msvc/stb-vorbis.lib...***** Making module 'std' (windows release x86 msvc) *****Parsing...Semanting...Translating...Compiling...Build error: System command failed:cl -c -EHs -W0 -MT -utf-8 -bigobj -O2 -DNDEBUG -I"C:/Apps/Coding/monkey2/modules/" -I"C:/Apps/Coding/monkey2/modules/monkey/native" -I"C:/Apps/Coding/monkey2/modules/zlib/zlib-1.2.11/" -showIncludes -Fo"C:/Apps/Coding/monkey2/modules/std/std.buildv1.1.09/windows_release_msvc/build/std_0memory_02databuffer.cpp.obj" "C:/Apps/Coding/monkey2/modules/std/std.buildv1.1.09/windows_release_msvc/src/std_memory_2databuffer.cpp" >tmp/stdout1.txtstd_memory_2databuffer.cppC:/Apps/Coding/monkey2/modules/std/std.buildv1.1.09/windows_release_msvc/src/std_memory_2databuffer.cpp(10): fatal error C1083: Cannot open include file: 'zlib/zlib.buildv1.1.09/windows_release_msvc/include/zlib_zlib.h': No such file or directoryMicrosoft (R) C/C++ Optimizing Compiler Version 19.13.26131.1 for x86Copyright (C) Microsoft Corporation. All rights reserved.Have you had any time to update this to fix what was not working?
Yo. Welcome aboard.
March 7, 2018 at 2:45 am in reply to: ANDROID – 3 Onscreen Buttons. LEFT-RIGHT & JUMP. How do I code it? #13903Thank you. Will test now.
I just donated $50 USD.
I used the donate button on the front page.
Woah. This is very good. Very helpful, indeed.
Thank you.
March 4, 2018 at 8:38 am in reply to: ANDROID – 3 Onscreen Buttons. LEFT-RIGHT & JUMP. How do I code it? #13852Yep. Still clueless.
I totally got all of that.
 - 
		AuthorPosts