royibernthal Posted June 4, 2018 Author Share Posted June 4, 2018 I could, but are the rest of the stuff in particleSystem.isReady() even relevant to the shader compilation? If so, out of curiosity - which? Also, please notice in my previous reply that I'm not even able to trigger the shader compilation. Quote Link to comment Share on other sites More sharing options...
Guest Posted June 5, 2018 Share Posted June 5, 2018 You can see that the effect if created here: https://github.com/BabylonJS/Babylon.js/blob/master/src/Particles/babylon.particleSystem.ts#L691 so calling _getEffect() should work (All code is there) And isReady should be enough: https://github.com/BabylonJS/Babylon.js/blob/master/src/Particles/babylon.particleSystem.ts#L853 Quote Link to comment Share on other sites More sharing options...
royibernthal Posted June 5, 2018 Author Share Posted June 5, 2018 You're referring me to normal particleSystem while I'm referring to GPU. Please take a min to read my replied and to take a look at the PG I made Quote Link to comment Share on other sites More sharing options...
Guest Posted June 6, 2018 Share Posted June 6, 2018 I could argue: Please take a minute to read the code which is available on GitHub but I won't go down this easy road Anyway, my response still applies, only file links change=> You can see that the effect if created here: https://github.com/BabylonJS/Babylon.js/blob/master/src/Particles/babylon.gpuParticleSystem.ts#L512 so calling isReady should be enough (until it returns true): https://github.com/BabylonJS/Babylon.js/blob/master/src/Particles/babylon.gpuParticleSystem.ts#L292 Quote Link to comment Share on other sites More sharing options...
royibernthal Posted June 10, 2018 Author Share Posted June 10, 2018 On 6/6/2018 at 7:35 AM, Deltakosh said: I could argue: Please take a minute to read the code which is available on GitHub but I won't go down this easy road Sorry if I sounded rude in my last reply. I did by the way read the code on GitHub, hence my previous questions about how things work internally. On 6/6/2018 at 7:35 AM, Deltakosh said: Anyway, my response still applies, only file links change=> You can see that the effect if created here: https://github.com/BabylonJS/Babylon.js/blob/master/src/Particles/babylon.gpuParticleSystem.ts#L512 so calling isReady should be enough (until it returns true): https://github.com/BabylonJS/Babylon.js/blob/master/src/Particles/babylon.gpuParticleSystem.ts#L292 I still don't understand why we need to emulate emitter and texture instead of directly calling the internal functions that trigger compilation, an explanation would be nice if/when you have time. Anyway, let's just do that, I guess it doesn't make much of a difference. Here's an updated PG, I don't think the effect is being compiled. What am I missing? http://www.babylonjs-playground.com/#7UJDBL#7 Quote Link to comment Share on other sites More sharing options...
Guest Posted June 11, 2018 Share Posted June 11, 2018 You need emitter and texture because of this: https://github.com/BabylonJS/Babylon.js/blob/master/src/Particles/babylon.gpuParticleSystem.ts#L299 And your code was wrong it is particleTexture and not texture: http://www.babylonjs-playground.com/#7UJDBL#8 Quote Link to comment Share on other sites More sharing options...
royibernthal Posted June 11, 2018 Author Share Posted June 11, 2018 On 6/11/2018 at 7:53 PM, Deltakosh said: And your code was wrong it is particleTexture and not texture: http://www.babylonjs-playground.com/#7UJDBL#8 My bad, thanks. On 6/11/2018 at 7:53 PM, Deltakosh said: You need emitter and texture because of this: https://github.com/BabylonJS/Babylon.js/blob/master/src/Particles/babylon.gpuParticleSystem.ts#L299 Looking back at my replies I wasn't clear, so I'll try to rephrase. My question was: In this case where I only need to precompile, why emulate texture and emitter and call particleSystem.isReady() rather than call this._recreateUpdateEffect(); this._recreateRenderEffect(); and wait for this._updateEffect.isReady() && this._renderEffect.isReady() so that I don't need to emulate texture and emitter? In practicality this doesn't make a difference but I'm just curious. http://www.babylonjs-playground.com/#7UJDBL#11 Assuming the latter is also viable, I noticed I simply don't see anything for it in compiledEffects even though isReady() returns true, same as when emulating texture and emitter: http://www.babylonjs-playground.com/#7UJDBL#8 I recall you told me something about it at some point, I can't remember what. 1) Does the compilation of GPU particle system effect use a different function than all other effects? I tried to log name in Engine/createEffect() and I don't see any hint of a GPUParticleSystem related effect. 2) Is it possible to create a completely empty texture for temporary purposes like in this case? If so, how do I do that? Quote Link to comment Share on other sites More sharing options...
Guest Posted June 12, 2018 Share Posted June 12, 2018 Well you are right regarding _recreateUpdateEffect and _recreateRenderEffect: you can call then and then wait for each effect to be ready. it is perhaps a little bit more hacky The problem is that onBeforeShaderCompilationObservable is called before the shader gets compiled and thus before it is added to the _compiledEffect Regarding a temp texture, you can create a 1x1 RawTexture I guess royibernthal 1 Quote Link to comment Share on other sites More sharing options...
royibernthal Posted June 13, 2018 Author Share Posted June 13, 2018 Got it, thanks for all the answers Sorry again if I sounded rude before Quote Link to comment Share on other sites More sharing options...
Guest Posted June 13, 2018 Share Posted June 13, 2018 no worry 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.