Josh Posted May 16, 2013 Share Posted May 16, 2013 Open the shader in the script editor by double-clicking its icon in the Asset Browser. When the shader is first opened, by default the OpenGL2 fragment shader source code will be displayed. Right-click in the code area to display the popup context menu and choose the Select All menu item. Copy the entire text, then select the OpenGLES2 fragment shader source in the left-hand tree display. Clear the code area of any text, then type the following at the top of the code area:precision highp float; Paste the clipboard contents from the OpenGL 2 fragment shader below this line. Repeat the same process, copying the OpenGL 2 vertex shader source to the OpenGL ES 2 vertex shader. Don't forget to add the precision qualifier at the top of the code. You can test your shader by selecting the Debug > Run menu item while one of the OpenGL ES 2 shader sources is displayed. Re-publish your project for mobile and it will run. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
xtreampb Posted June 9, 2013 Share Posted June 9, 2013 can we use the pre-processor definitions in the shadder to determine if we are compiling for desktop or mobile, like we do in lua or C++? Quote bool Life() { while(death=false) { if(death==true) return death; } } I have found the secret to infinite life Did I help you out? Like my post! Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.