Jump to content


  • Content Count

  • Joined

  • Last visited

About PizzaLYJ

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. @Nockawa Thanks to your contribution. Now it works perfectly. @Nabroski Thanks to your advice. I will learn to use it.
  2. Hi @Nockawa Thanks to your contribution. Excuse me, I am not native English speaker, so does you mean that you will pending this issue? Because the latest version will cause the behavior of scale unexpected.(http://babylonjs-playground.com/#OWCCR#28)
  3. Hi everyone, When I let a Canvas2D primitive to scaling and rotating at the same time, the result of primitive performing is unexpected for me. Like the below code (http://babylonjs-playground.com/#OWCCR#27): let rectGreen = new BABYLON.Rectangle2D({ parent: canvas2d, id: "rectGreen", width: 100, height: 100, rotation: Math.PI * 1 / 4, marginAlignment: "h: center, v: center", fill: BABYLON.Canvas2D.GetSolidColorBrush(new BABYLON.Color4(0, 1, 0, 1)) }); let rectRed = new BABYLON.Rectangle2D({ parent:
  4. Hi @Nabroski, Thanking for your reply and the hint. Now I use onGenerated event trigger to waiting a procedural texture ready and then setting Sprite2D. http://babylonjs-playground.com/#20MSFF#55 Looking great! Thank you.
  5. Hi all, I try a case: creating a custom procedural texture and using the texture to apply two Sprite2Ds. One Sprite2D attaches to ScreenSpaceCanvas2D, the other one attaches to WorldSpaceCanvas2D. The result is the texture can display at ScreenSpaceCanvas2D but the other one cannot at WorldSpaceCanvas2D. Here is my sample code at the playground: http://babylonjs-playground.com/#20MSFF#54 So, is there something limitations on showing custom procedural texture at WorldSpaceCanvas2D? Thanks.
  6. Hi all, I want to create a Sprite2D and it's image can make some effect like grayscale. So I consider using CustomProceduralTexture to implement it. My pseudo code is like below (the shader is just basic one not grayscale): let sampleTexture = new BABYLON.Texture("img/sample.png", scene, true, false, BABYLON.Texture.NEAREST_SAMPLINGMODE); BABYLON.Effect.ShadersStore["TestPixelShader"] = "precision highp float;\n" + "varying vec2 vUV;\n" + "uniform sampler2D sampleTexture;\n" + "void main(void) {\n" + "gl_FragColor = texture2D(sampleTexture, vUV);\n"
  7. Hello everyone, I am newbie in BabylonJS. When I study the playground example of Sprite2D, I have a question about invertY setting at Texture and Sprite2D class. The texture constructor sets invertY to false at the line 5, and the Sprite2D constructor sets invertY to true at the line 11. Does it mean that player.png caches in texture like the below, so the Sprite2D constructor needs to set invertY to true? And why Texture invert a picture automatically? Thanks.
  • Create New...