Blax Posted December 2, 2018 Share Posted December 2, 2018 Folks, hi, again!!! I trying use BJS.DynamicTexture for draw in and next use in custom shader, but shader ignore geometry with shader material if i try set that texture as samplier2D. And do not generate any Errors (( If we switch off DynamicTexture or use simple Texture - all is ok. Sorry, i can't make this case in PG. Try show situation here: // var dataTexture = new BJS.Texture('/accel/static/i/fx/.../name.jpg',scene,true,false,0,function(){loadedTextures--;}); // its work var dataTexture = new BJS.DynamicTexture("dataTx",{width:2048,height:2048}, scene,false,0); // its dosent work // later, when all textures is ready... var shader = new BABYLON.ShaderMaterial("myShader", scene, "/accel/static/js/...", { attributes: ["position", "normal","uv"], uniforms: ["world", "worldView", "worldViewProjection", "view", "projection"] }); shader.setTexture ("dataTx", dataTexture, scene ); myGeom.material = shader; in GLSL fragment uniform sampler2D dataTx; all is ok, if we change DynamicTexture to Texture. Where i make wrong turn? )) Quote Link to comment Share on other sites More sharing options...
Blax Posted December 2, 2018 Author Share Posted December 2, 2018 Try RawTexture and get some shifts to positive Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted December 3, 2018 Share Posted December 3, 2018 can i see your shader ? Quote Link to comment Share on other sites More sharing options...
Blax Posted December 3, 2018 Author Share Posted December 3, 2018 thanks for interest! yes, is very simple and clear and i dont use this texture. Only use (shader.setTexture) dynamic texture bring problem. p. s. i found another way for do what i need, but perhaps it is a bug and Babylonjs community has the meaning cath it? VERTEX precision highp float; attribute vec3 position; attribute vec3 normal; attribute vec2 uv; // Uniforms uniform mat4 worldViewProjection; uniform mat4 world; uniform float time; uniform sampler2D hgTx; uniform sampler2D colorTx; uniform sampler2D dataTx; varying vec2 vUV; varying vec3 vPosition; void main(void) { vUV = uv; vPosition = position; gl_Position = worldViewProjection * vec4(vPosition, 1.); } FRAGMENT precision highp float; // Varying varying vec3 vPosition; varying vec3 vNormal; varying vec2 vUV; // Uniforms uniform sampler2D colorsTx; uniform sampler2D hgTx; uniform sampler2D dataTx; uniform float time; // ==================================================================================== // MAIN // ==================================================================================== void main(void) { vec3 height3 = texture2D(hgTx,vUV).rgb; float height = (height3.r + height3.g + height3.b) / 3.0; vec3 color = texture2D(colorsTx, vec2(0.999 - height,0.15)).rgb; gl_FragColor = vec4(color, 1.0); } Quote Link to comment Share on other sites More sharing options...
Guest Posted December 3, 2018 Share Posted December 3, 2018 This must work. So the problem could be in how you fill your texture? Can you repro in the Playground? Quote Link to comment Share on other sites More sharing options...
Blax Posted December 3, 2018 Author Share Posted December 3, 2018 texture was empty, i only create DynamicTexture object (i think if it is a problem babylon throw any error). But we dont use this only declare it. And i think texture after creation has empty pixels. Not? (oops' sorry if it ))) While i dont know how i can attach shader files in PG.... use shaderStore? And one more...problem (perhaps it limits Babylon.js propagation not only for me) Digital Ocean hosting stable block PG for me (i use 2 ISP and it block both) and i forced use slow-slow VPN for see or make samples in PG. Use PG is hard for me. i'm simple harmless home user on Linux. No spam, viruses, bots and etc. One of my ISP set my IP dynamicly. But... Some times DOcean blocks API DOC too ((( It may be for many peoples? ( Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted December 3, 2018 Share Posted December 3, 2018 make pg with same situation please Quote Link to comment Share on other sites More sharing options...
Guest Posted December 3, 2018 Share Posted December 3, 2018 For DigitalOcean I have no idea who they are Quote Link to comment Share on other sites More sharing options...
brianzinn Posted December 4, 2018 Share Posted December 4, 2018 12 hours ago, Blax said: Some times DOcean blocks API DOC too ((( The !X is a "communication administratively prohibited" (I think ipv4) that Digital Ocean uses. Try 'tcptraceroute or traceroute -T'. Quote Link to comment Share on other sites More sharing options...
Blax Posted December 4, 2018 Author Share Posted December 4, 2018 9 hours ago, Deltakosh said: For DigitalOcean I have no idea who they are PG hosting provider? Hm? )) Quote Link to comment Share on other sites More sharing options...
Guest Posted December 4, 2018 Share Posted December 4, 2018 We are hosted by netlify so this may be their provider Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted December 4, 2018 Share Posted December 4, 2018 may some plugin or extension append on your browser Quote Link to comment Share on other sites More sharing options...
Blax Posted December 5, 2018 Author Share Posted December 5, 2018 13 hours ago, Deltakosh said: We are hosted by netlify so this may be their provider please, see on screenshots - Netlify only "face", "proxy", "agent", "frontside" (i can't find right word). Real network space used of DO. Anyway access problem is sad fact. Perhaps it make netlify who's know? I try enter from work place (one more another ISP) and get same result ((( 12 hours ago, NasimiAsl said: may some plugin or extension append on your browser nop. clear browsers and i try chrome, firefox and exotic falcon )) In weekend i'll try make PG sample. Thank you very much, man's! Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted December 6, 2018 Share Posted December 6, 2018 look this https://get.webgl.org/ this hosted by Digital Ocean Quote Link to comment Share on other sites More sharing options...
Blax Posted December 8, 2018 Author Share Posted December 8, 2018 On 12/6/2018 at 1:02 PM, NasimiAsl said: look this https://get.webgl.org/ this hosted by Digital Ocean ))) i'm talk about server blocking, it is not browser's problem ))) i think problem get chance on dissolve, when many users say about, i can waiting with use VPN. I need PG some times. Anyway, i made sample in PG and get same result https://www.babylonjs-playground.com/#8W86ZM#2 Please, take a look. Quote Link to comment Share on other sites More sharing options...
Guest Posted December 8, 2018 Share Posted December 8, 2018 Your texture is not prepared (nothing was rendered in it). It works if for instance I draw a text in it: https://www.babylonjs-playground.com/#8W86ZM#4 Quote 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.