-
Content Count
77 -
Joined
-
Last visited
About KevinBLT
-
Rank
Advanced Member
- Birthday 05/06/1994
Profile Information
-
Gender
Male
-
Location
Germany / Kassel
Recent Profile Visitors
1324 profile views
-
Hello, I don't know if this is something that could be merged into github but we had some projects (and therefore customers) that were highly loaded with objects, thus a bit slow in rendering. The camera inertia was then to long lasting to control the camera if you know what I mean. This is what I've changed to handle this: // Inertia var engineDelta = Math.min(this.getEngine().deltaTime,100), inertiaFactor = Math.min(1,16.66666 / engineDelta); if (this.inertialAlphaOffset !== 0 || this.inertialBetaOffset !== 0 || this.inertialRadiusOffset !== 0) { this.alpha += (this.beta <= 0 ? -this.inertialAlphaOffset : this.inertialAlphaOffset) / inertiaFactor; this.beta += this.inertialBetaOffset / inertiaFactor; this.radius -= this.inertialRadiusOffset / inertiaFactor; this.inertialAlphaOffset *= this.inertia * inertiaFactor; this.inertialBetaOffset *= this.inertia * inertiaFactor; this.inertialRadiusOffset *= this.inertia * inertiaFactor; if (Math.abs(this.inertialAlphaOffset) < BABYLON.Engine.Epsilon) this.inertialAlphaOffset = 0; if (Math.abs(this.inertialBetaOffset) < BABYLON.Engine.Epsilon) this.inertialBetaOffset = 0; if (Math.abs(this.inertialRadiusOffset) < BABYLON.Engine.Epsilon) this.inertialRadiusOffset = 0; } // Panning inertia if (this.inertialPanningX !== 0 || this.inertialPanningY !== 0) { if (!this._localDirection) { this._localDirection = BABYLON.Vector3.Zero(); this._transformedDirection = BABYLON.Vector3.Zero(); } this.inertialPanningX *= this.inertia * inertiaFactor; this.inertialPanningY *= this.inertia * inertiaFactor; if (Math.abs(this.inertialPanningX) < BABYLON.Engine.Epsilon) this.inertialPanningX = 0; if (Math.abs(this.inertialPanningY) < BABYLON.Engine.Epsilon) this.inertialPanningY = 0; this._localDirection.copyFromFloats(this.inertialPanningX / inertiaFactor, this.inertialPanningY / inertiaFactor, 0); this._viewMatrix.invertToRef(this._cameraTransformMatrix); BABYLON.Vector3.TransformNormalToRef(this._localDirection, this._cameraTransformMatrix, this._transformedDirection); this.target.addInPlace(this._transformedDirection); } It rotates by the given inertia amount depending on the time that proceeded during the renderings. The var engineDelta = Math.min(this.getEngine().deltaTime,100) is to avoid big camera jumps on frames that last longer than 100ms. In our project the render loop doesn't run continuesly. If someone likes to test this and/or push it into babylon I would be glad to have contributed a small thing :-) If not it's also completely okay as it's only needed in our project(s)! ;-) Best regards Kevin
-
Instance.dispose() - Should be removed from ShadowGenerator?
KevinBLT replied to KevinBLT's topic in Questions & Answers
Ah that's why the ghost shadows will stay in my case. Becaue the shadow map doesn't get updated very often. So, good to know. For now I will have to remove them manually. Thanks and keep us on track. -
Hello, is it the correct behaviour that instances that are being disposed doesn't get removed from ShadowGenerator.getShadowMap().renderList ? I have the refreshrate set to 0 and only render with shadow on demand. if (_renderShadow && this._manuallyShadowRender) { this._shadowGenerator.getShadowMap().refreshRate = 1; this._scene.render(); this._shadowGenerator.getShadowMap().refreshRate = 0; } else { this._scene.render(); } Is this a problem i this case? I just want to know (maybe it's a bug). Shouldn't ShadowGenerator check the Mesh.isDisposed attribute? Have a nice day Kevin
-
-
Thank you. I didn't find this in the documentation
-
Hey, just a small question. What am I doing wrong, that text is not filled in my case? var text2D_X = new BABYLON.WorldSpaceCanvas2D(scene, new BABYLON.Size(sizeTX, 12), { id: "Measure - " + sizeX, worldPosition: new BABYLON.Vector3(0, 0, BB.minimumWorld.z - 6), worldRotation: BABYLON.Quaternion.RotationYawPitchRoll(0,Math.PI/2,0), enableInteraction: true, children: [ new BABYLON.Text2D(checkRound(sizeX).toString() + "cm", { fontName : "6pt Arial", marginAlignment : "h: center, v: bottom", fontSuperSample : true, }), ] }); Thanks
-
This is fantastic! Can I use this with the current Babylon version? I don't understand these exactly: renderTarget.onBeforeRender = function () { for (var index = 0; index < renderTarget.renderList.length; index++) { renderTarget.renderList[index]._savedMaterial = renderTarget.renderList[index].material; renderTarget.renderList[index].material = renderTarget.renderList[index].helperMaterial; } } renderTarget.onAfterRender = function () { for (var index = 0; index < renderTarget.renderList.length; index++) { renderTarget.renderList[index].material = renderTarget.renderList[index]._savedMaterial; } } Why do you have to do something with private members ? Or is this just a temporary workaround? Also, would it be possible to keep the lines the same thickness independet from the camera distance? You're really a shader god!
- 9 replies
-
- edgesrenderer
- worker
-
(and 3 more)
Tagged with:
-
I know. However, how would I start an implementation? Do I absolutely need TypeScript? To do a contribution? And also another question: Wouldn't the edgedetection be possible via shader?
- 9 replies
-
- edgesrenderer
- worker
-
(and 3 more)
Tagged with:
-
Hello everyone, I would like to know if it was possible to do the work of "Edges Renderer" in a worker thread? It's working really well for our projects but for some objects it can take really a lot of time in which the scene is completely stopping to respond. Any suggests?
- 9 replies
-
- edgesrenderer
- worker
-
(and 3 more)
Tagged with:
-
-
You saved me from a lot of pain, thanks!
-
Ah... this doc was exactly what I needed. I love you all! And Babylon of course!
-
Has this problem been solved? I also need dynamic texture with transparent background.
-
Hello, after using csg there are two edge lines that shouldn't be there I think. http://www.babylonjs-playground.com/#1MH4BF Can this be corrected somehow? Thanks!
-
This works for me! I think I will have to do a csg union for all meshes at first to get every correct edge. Thanks. With this parameter it's working