All Activity

This stream auto-updates     

  1. Past hour
  2. Beautiful, @NasimiAsl ! Now if we can make it "animate" by a chosen user speed ( like we're underwater ), that would be PERFECT! <3 Thank you! <3 ~Mythros
  3. Well actually it was on Phaser.AUTO. The problem wasn't the canvas itself, I forgot to add some settings to my webview. It works even on Android 4.4 but without the audio. On Android 5.1 it works just fine. Here is my activity code: package; import; import android.os.Bundle; import android.view.Window; import android.view.WindowManager; import android.view.inputmethod.InputMethodManager; import android.webkit.WebSettings; import android.webkit.WebView; public class MainActivity extends AppCompatActivity { private WebView mWebView; private String GAME_URL = "file:///android_asset/www/index.html"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.activity_main); mWebView = (WebView) findViewById(; WebSettings webSettings = mWebView.getSettings(); webSettings.setJavaScriptEnabled(true); webSettings.setDomStorageEnabled(true); webSettings.setDatabaseEnabled(true); webSettings.setPluginState(WebSettings.PluginState.ON); webSettings.setAllowFileAccess(true); webSettings.setAllowContentAccess(true); webSettings.setAllowFileAccessFromFileURLs(true); webSettings.setAllowUniversalAccessFromFileURLs(true); webSettings.setUseWideViewPort(true); mWebView.setWebViewClient(new MyAppWebViewClient()); InputMethodManager imeManager = (InputMethodManager) getApplicationContext().getSystemService(INPUT_METHOD_SERVICE); imeManager.showInputMethodPicker(); } @Override public void onResume(){ mWebView.loadUrl(GAME_URL); super.onResume(); } @Override public void onBackPressed() { if(mWebView.canGoBack()) { mWebView.goBack(); } else { super.onBackPressed(); } } } Some parts like setPluginState(WebSettings.PluginState.ON); function are deprecated but will post when i find reasonable replacement. My java helper file: package; import android.content.Intent; import; import android.webkit.WebView; import android.webkit.WebViewClient; /** * Created by vlado on 20.9.17. */ public class MyAppWebViewClient extends WebViewClient { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { if(Uri.parse(url).getHost().length() == 0) { return false; } Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); view.getContext().startActivity(intent); return true; } } my manifest file: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="" package="" > <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/Theme.AppCompat.NoActionBar"> <activity android:name=".MainActivity" android:screenOrientation="portrait"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> <uses-permission android:name="android.permission.INTERNET" /> </manifest>
  4. Unable to import babylon

    Thanks guys, I tried what you suggested and it worked!
  5. Today
  6. Game list of phaser games

    Just made my first html5 game while learning phaser (ver 2.8.7): Yellow Out -
  7. get data from Texture

    I dont really get how this is working. It seem like babylon doesnt cache my textures by default, so i have to enable it. The Documentation says I need to create a NameOfYourScene.babylon.manifest file. But I dont have a Scene Name... And the file needs to be in my document root? This seems to be a bit odd to me. Or do I just dont get the concept of this?
  8. Dynamic diffuseTexture path in babylon file

    How would the texture constructor access the observables? Which would make the most sense? The scene or the engine?
  9. @aWeirdo @Deltakosh Wow, cool! It works great, thank you so much.
  10. Grid Material Offset

    *disclaimer* I'm not positive if that will fix it, but like 95% sure.... Thanks though buddy ^_^.
  11. Nope! The particles need to be not visible when behind the ground, like this : But in front of the shadow héhé.
  12. Grid Material Offset

    Thx I ll do ASAP
  13. It is complicated just wanted to learn logic how to refresh the scene after the value of variables is changed.
  14. Sorry but I did not see where the custom_position is used in the scene?
  15. Augmented Reality - Phone Camera ?

    The VRFreeCamera:
  16. should we just initialize VRFreeCamera instant FreeCamera ?
  17. Car Configurator

    just a 800x500 image (plus a short title and an author name )
  18. Morph questions

    Thank you. I'll wait then and I'll try to renegociate my next project
  19. bug with setTextBounds with anchor and scale

    I think setTextBounds is intended to work without altering the object's position. Thus pivot. And the pivot is updated when the text content changes to keep it aligned within the bounds (see example below). If you just need to position the text relative to a box, you're correct that it's much simpler. You can probably just use label.alignIn({x: 0, y: 0, width: 200, height: 100}, Phaser.CENTER);
  20. Nice example. If camera will be like VR. Will it be nicer for VR google.
  21. Car Configurator

    My pleasure. A few little fixes and it's done :)) Let me know if you need more informations, or images, I don't know :))
  22. Nintendo Switch

    any news? haha
  23. Nasimi The Shader Guru

    I think this was close to a working version: Sorry Im having trouble finding some of my older files. I cant find the one with the textures on the same image, but ill keep digging for that one. BABYLON.Effect.ShadersStore["teriableBasicVertexShader"]= "precision highp float;\r\n"+ "// Attributes\r\n"+ "attribute vec3 position;\r\n"+ "attribute vec3 normal;\r\n"+ "attribute vec2 uv;\r\n"+ "// Uniforms\r\n"+ "uniform mat4 world;\r\n"+ "uniform mat4 worldViewProjection;\r\n"+ "// Varying\r\n"+ "varying vec3 vPositionW;\r\n"+ "varying vec3 vNormalW;\r\n"+ "varying vec2 vUV;\r\n"+ "void main(void) {\r\n"+ " vec4 outPosition = worldViewProjection * vec4(position, 1.0);\r\n"+ " gl_Position = outPosition;\r\n"+ " \r\n"+ " vPositionW = vec3(world * vec4(position, 1.0));\r\n"+ " vNormalW = normalize(vec3(world * vec4(normal, 0.0)));\r\n"+ " \r\n"+ " vUV = uv;\r\n"+ "}\r\n"; BABYLON.Effect.ShadersStore["teriableBasicFragmentShader"]= "precision highp float;\r\n"+ "// Lights\r\n"+ "varying vec3 vPositionW;\r\n"+ "varying vec3 vNormalW;\r\n"+ "varying vec2 vUV;\r\n"+ "// Refs\r\n"+ "uniform sampler2D z1b[3];\r\n"+ "uniform sampler2D z1a0[3];\r\n"+ "uniform sampler2D z1a1[3];\r\n"+ "uniform sampler2D z1a2[3];\r\n"+ "uniform sampler2D z1a3[3];\r\n"+ "int getIndex(float v) {\r\n"+ "if( v>=0.0 && v < 0.35){\r\n"+ "return 0;\r\n"+ "}else if( v>=0.35 && v < 0.65 ){\r\n"+ "return 1;\r\n"+ "}else{\r\n"+ "return 2;\r\n"+ "}\r\n"+ "}\r\n"+ "float rangeV(float v, float x, float y){\r\n"+ " return 1.0-max(0.0 , min(1.0 , (v - y)/(y - x)));\r\n"+ "}\r\n"+ "//\r\n"+ "float snoise(vec2 co)\r\n"+ "{\r\n"+ " return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\r\n"+ "}\r\n"+ "vec3 setBaseColor(int i, sampler2D tex[3]){\r\n"+ "if(i == 0){\r\n"+ "return texture2D(tex[0], vUV*60.0).rgb;\r\n"+ "}else if(i == 2){\r\n"+ "return texture2D(tex[1], vUV*60.0).rgb;\r\n"+ "}else{\r\n"+ "return texture2D(tex[2], vUV*60.0).rgb;\r\n"+ "}\r\n"+ "}\r\n"+ "vec3 mixAngles(vec3 color, sampler2D a0[3],sampler2D a1[3],sampler2D a2[3],sampler2D a3[3], float ap[4], int tid){\r\n"+ "if(tid == 0){\r\n"+ "color = mix(color, texture2D(a3[0], vUV*60.0).rgb, ap[3]);\r\n"+ "color = mix(color, texture2D(a2[0], vUV*60.0).rgb, ap[2]);\r\n"+ "color = mix(color, texture2D(a1[0], vUV*60.0).rgb, ap[1]);\r\n"+ "color = mix(color, texture2D(a0[0], vUV*60.0).rgb, ap[0]);\r\n"+ "return color;\r\n"+ "}else if(tid == 2){\r\n"+ "color = mix(color, texture2D(a3[1], vUV*60.0).rgb, ap[3]);\r\n"+ "color = mix(color, texture2D(a2[1], vUV*60.0).rgb, ap[2]);\r\n"+ "color = mix(color, texture2D(a1[1], vUV*60.0).rgb, ap[1]);\r\n"+ "color = mix(color, texture2D(a0[1], vUV*60.0).rgb, ap[0]);\r\n"+ "return color;\r\n"+ "}else{\r\n"+ "color = mix(color, texture2D(a3[2], vUV*60.0).rgb, ap[3]);\r\n"+ "color = mix(color, texture2D(a2[2], vUV*60.0).rgb, ap[2]);\r\n"+ "color = mix(color, texture2D(a1[2], vUV*60.0).rgb, ap[1]);\r\n"+ "color = mix(color, texture2D(a0[2], vUV*60.0).rgb, ap[0]);\r\n"+ "return color;\r\n"+ "}\r\n"+ "}\r\n"+ "void main(void) {\r\n"+ " vec2 r[4];//RANGES\r\n"+ " r[0] = vec2(0.0,10.0);\r\n"+ " r[1] = vec2(10.0,15.0);\r\n"+ " r[2] = vec2(15.0,45.0);\r\n"+ " r[3] = vec2(45.0,50.0);\r\n"+ " vec2 aR[4];\r\n"+ " aR[0] = vec2(0.0,0.2);\r\n"+ " aR[1] = vec2(0.2,0.45);\r\n"+ " aR[2] = vec2(0.45,0.75);\r\n"+ " aR[3] = vec2(0.75,1.0);\r\n"+ " \r\n"+ "const vec3 up = vec3(0.0,1.0,0.0);\r\n"+ " float angle = max(0., dot(vNormalW, up));//ANGLE 0:1\r\n"+ " float el = vPositionW.y; //ELEVATION\r\n"+ "vec2 pos = floor(vUV*60.0);\r\n"+ "int index = getIndex(snoise(pos));\r\n"+ "vec3 z1bc = setBaseColor(index, z1b);\r\n"+ " float ap[4]; //Angle Blend PERCENTAGE\r\n"+ " ap[0] = rangeV(angle, aR[0].x, aR[0].y);\r\n"+ " ap[1] = rangeV(angle, aR[1].x, aR[1].y);\r\n"+ " ap[2] = rangeV(angle, aR[2].x, aR[2].y);\r\n"+ " ap[3] = rangeV(angle, aR[3].x, aR[3].y);\r\n"+ " \r\n"+ "vec3 z1xc = mixAngles(z1bc, z1a0, z1a1, z1a2, z1a3, ap, index);\r\n"+ " gl_FragColor = vec4(z1xc, 1.0);\r\n"+ "}\r\n"; var textureBank = new Array(); var textureLocations = [ //ZONE 1: "./textures/Beach_Rocks_A.jpg",//Zone 1 BASE A "./textures/Beach_Rocks_B.jpg",//Zone 1 BASE B "./textures/Beach_Rocks_C.jpg",//Zone 1 BASE C "./textures/Beach_Rocks2_A.jpg",//Zone 1 Angle 0 Zone A "./textures/Beach_Rocks2_B.jpg",//Zone 1 Angle 0 Zone B "./textures/Beach_Rocks2_C.jpg",//Zone 1 Angle 0 Zone C "./textures/Beach_Rocks3_A.jpg",//Zone 1 Angle 1 Zone A "./textures/Beach_Rocks3_B.jpg",//Zone 1 Angle 1 Zone B "./textures/Beach_Rocks3_C.jpg",//Zone 1 Angle 1 Zone C "./textures/Beach_Sand2_A.jpg",//Zone 1 Angle 2 Zone A "./textures/Beach_Sand2_B.jpg",//Zone 1 Angle 2 Zone B "./textures/Beach_Sand2_C.jpg",//Zone 1 Angle 2 Zone C "./textures/Beach_Sand_A.jpg",//Zone 1 Angle 3 Zone A "./textures/Beach_Sand_B.jpg",//Zone 1 Angle 3 Zone B "./textures/Beach_Sand_C.jpg",//Zone 1 Angle 3 Zone C ]; $.each(textureLocations, function(i,e){ textureBank.push(new BABYLON.Texture(e, scene)); }); teriableBasic = new BABYLON.ShaderMaterial("teriableBasic", scene, { vertex: "teriableBasic", fragment: "teriableBasic", }, { attributes: ["position", "normal", "uv"], uniforms: ["world", "worldView", "worldViewProjection", "view", "projection"] }); teriableBasic.setTexture("z1b[0]", textureBank[0]); teriableBasic.setTexture("z1b[1]", textureBank[1]); teriableBasic.setTexture("z1b[2]", textureBank[2]); teriableBasic.setTexture("z1a0[0]", textureBank[3]); teriableBasic.setTexture("z1a0[1]", textureBank[4]); teriableBasic.setTexture("z1a0[2]", textureBank[5]); teriableBasic.setTexture("z1a1[0]", textureBank[6]); teriableBasic.setTexture("z1a1[1]", textureBank[7]); teriableBasic.setTexture("z1a1[2]", textureBank[8]); teriableBasic.setTexture("z1a2[0]", textureBank[9]); teriableBasic.setTexture("z1a2[1]", textureBank[10]); teriableBasic.setTexture("z1a2[2]", textureBank[11]); teriableBasic.setTexture("z1a3[0]", textureBank[12]); teriableBasic.setTexture("z1a3[1]", textureBank[13]); teriableBasic.setTexture("z1a3[2]", textureBank[14]);
  24. Freeze Rotation

    Thanks, I will try that.
  25. Phaser 3 Beta 4 Released

    What exactly doesn't work? I just ran a few tests fine on an iPhone 5, which isn't far off the 4.
  26. We can render a scene in Babylon.JS reading values like position/scale from form fields. But does it allow to make changes in scene listening real time changes in input fields like $('input').val() var cusotm_position = $('input').val(); canvas = document.getElementById("renderCanvas"); engine = new BABYLON.Engine(canvas, true); scene = createScene(); //draws a mesh at custom_position engine.runRenderLoop(function () { scene.render(); }); $("input").change(function(){ cusotm_position = $('input').val(); delete scene;scene = createScene(); //hangs website for few seconds,need its alternate }); I tried to call scene.render(); on event listener of change in input but that doesn't seem to be doing anything. Is there anything like refrest/update to change to updated variable values. Better if this can be done without removing everything and recreating fresh scene. As delete scene;scene = createScene(); does refresh everything with new variable values but it hangs the website for few seconds.
  1. Load more activity