Was wondering if there is a way to see which asset, entity or even material that is attempting to find a deleted texture?
All I get is:
launch.js:8069 attempting to use a texture that has been destroyed.
Was wondering if there is a way to see which asset, entity or even material that is attempting to find a deleted texture?
All I get is:
launch.js:8069 attempting to use a texture that has been destroyed.
I am not sure about that, but after the latest engine release I started getting that error myself on a project of mine.
I am not sure it’s an engine bug though or something I did, need to test more.
Do we have a list of the engine releases?
Not sure when the last occurred … if I can grab that info I can - maybe - track back on my ‘check points’
Please also check against older engine versions. If there is an engine bug from the release, they will be fixed as high priority.
hmm … yes ok - I haven’t been around that yet (dont I have to download the whole repo for then to upload on local server?),
You can use use_local_engine
in the launch tab with old engine versions on our code server.
See:
Thanks, it was able to execute - can take it from here
So is there an issue/bug with the new engine for you?
Water reflection:
PlayCanvas | HTML5 Game Engine (new repo)
@mvaligursky Would you be able to take a look at this tomorrow please?
@yaustar had a quick look, and this PR introduced the error … possibly by triggering some resize or something, not sure https://github.com/playcanvas/engine/pull/3124
{thx for update - and I have just noticed that things are ok again (as well)} … wait, that was premature
Hope the last repo will get ok for now, but what to do if I want to export by an older engine release? - still the same as above but without the ‘launch … debug=true’?
Maybe like this: Publishing With Custom Engine
To me it feels the water project might have a bug in it … when screen resizes, the water render targets get recreated, but it seems they’re not set on cameras / layers till frame later, and so one frame the engine renders with destroyed buffers … and we get these errors:
attempting to use a texture that has been destroyed.
and this when resizing the window
launch.js:8069 ERROR: FRAMEBUFFER_INCOMPLETE_ATTACHMENT
ok
Hello - So now I have tried to alter my project to not being dependent on the Water Reflection-shader.
And I am therefore using a compromise. This includes the Warp Sprite example: https://developer.playcanvas.com/en/tutorials/warp-a-sprite-with-glsl/
At this post in the forum, you reference this:
A quite good approach for coders on my level, and I have already changed two chunk-structures in other projects quite succesfully - just not with this one where I am stuck (using this as chunk inspiration: https://github.com/playcanvas/engine/blob/master/src/graphics/program-lib/chunks/normalMapFast.frag):
var Warp = pc.createScript('warp');
Warp.attributes.add('wavelength', { type: 'number', default: 1 });
Warp.attributes.add('amplitude', { type: 'number', default: 0.05 });
// initialize code called once per entity
Warp.prototype.initialize = function() {
var m = this.entity.model.meshInstances[0].material;
// Replace the opacity texture chunk:
// https://github.com/playcanvas/engine/blob/master/src/graphics/program-lib/chunks/opacity.frag
m.chunks.normalPS =
/* "uniform sampler2D texture_opacityMap;\n" +
"uniform float time;\n" +
"uniform float amplitude;\n" +
"uniform float wavelength;\n" +
"\n" +
"void getOpacity() {\n" +
" vec2 uv = $UV;\n" +
" uv.y += sin((uv.x + time) / wavelength) * amplitude;\n" +
" dAlpha = texture2D(texture_opacityMap, uv).$CH;\n" +
"}\n\n";*/
"uniform sampler2D texture_normalMap;\n" +
"\n" +
"void getNormal() {\n" +
"vec2 uv = $UV;\n" +
"uv.y += sin((uv.x + time) / wavelength) * amplitude;\n" +
"vec3 normalMap = unpackNormal(texture2D(texture_normalMap, $UV));\n" +
"dNormalMap = addNormalDetail(normalMap);\n" +
"dNormalW = dTBN * dNormalMap;\n" +
"}\n\n";
// Replace the emissive texture chunk:
// https://github.com/playcanvas/engine/blob/master/src/graphics/program-lib/chunks/emissive.frag
// Since the opacity chunk is included before the emissive chunk, we don't need to declare
// time, amplitude and wavelength here.
m.chunks.emissivePS =
"uniform sampler2D texture_emissiveMap;\n" +
"\n" +
"vec3 getEmission() {\n" +
" vec2 uv = $UV;\n" +
" uv.y += sin((uv.x + time) / wavelength) * amplitude;\n" +
" return $texture2DSAMPLE(texture_emissiveMap, uv).$CH;\n" +
"}\n\n";
m.update();
this.timer = 0;
};
// update code called every frame
Warp.prototype.update = function(dt) {
this.timer += dt;
// Set our custom uniforms for our chunks
var m = this.entity.model.meshInstances[0].material;
m.setParameter('time', this.timer);
m.setParameter('amplitude', this.amplitude);
m.setParameter('wavelength', this.wavelength);
m.update();
};
ok - so I try to use diffuseMap alongside the normalMap (which is better from: https://github.com/playcanvas/engine/blob/master/src/graphics/program-lib/chunks/normalMap.frag)
My forked Warp-project:
https://playcanvas.com/editor/scene/1144797
(@LeXXik ->> you might also be interested in saving your example as useful? … cf above: It/Water reflection now produces 2 errors instead of 1 only - on beforehand, thanks)
Do you know who made the vert and frag-chunks?
I hate to land in a place between ‘unknowing’ and ‘seeming lazy’
-> I am neither, and have several times been both learning, and trying out shader-languages.
As far as I know the chunks are openGL right? And as such the code/our code, does not look like this:
The chunks are in GLSL language.
Your best bet here is to look at the engine repo chunks and the examples in the engine examples page. eg https://playcanvas.github.io/#graphics/post-effects.html