D3 force layout stable detect - layout

I need to detect the stability of force layout, for example, when it transform coordinates, add a loading animation on the page.
After it finished, then remove the loading animation.
The 'stable' are not that precisely, but should be detect the graph almost stable.
What should I do? Any suggestions or examples?

The documentation says that the stability is felt when alpha goes below the threshold value (default value is 0.1) so you could just listen to this value and workout. I will try to post a fiddle on this soon.

Related

Texture Shows Flickering / Aliasing / Moire Patterns in Godot, Despite Mipmaps

If I load a checkerboard texture into Godot:
And stand far enough back from it, I get strange artifacts called Moiré patterns:
This is a well-known problem in computer graphics which appears whenever you sample a texture that has a higher resolution than the area of the screen it is being rendered onto. (See this article for another illustration and full explanation.)
The usage of mipmaps is a technique to eliminate this problem by making lower-resolution versions of the texture that are then used when the camera is sufficiently far away from the object. So, I went to find out how to enable this in Godot only to find out that it was already enabled by default:
Why then am I still getting aliasing? What can I do to eliminate it?
By default, Godot selects a higher resolution mipmap than what is needed to completely eliminate aliasing. At the cost of making your materials blurrier, the aliasing can be almost entirely removed by increasing the "Texture Mipmap Bias" by one. What this does is tell Godot's rendering engine to pick the mipmap that is half the resolution of the one it would normally pick. The setting can be found as follows:
Go to Project > Project Settings....
Enable "Advanced Settings" to the right of the search bar.
Navigate to Rendering > Textures on the left.
The setting can then be found in Default Filters > Texture Mipmap Bias on the right.
The result:

Do I have to Z Sort or not?

I have written a 3d model viewing program in vb.net, though the question is not language specific.
Everything is working as expected though I have one issue. Partial transparency.
The program allows the user to make the entire model transparent via a checkbox and a slider that changes the alpha values for alpha blending. It also stops the zbuffer check.
This works fine when the model is very transperant but can induce more and more flicker during animation and render errors as the opacity increases. Which i'm guessing is due to out of z-order polygon rendering.
So the question is. Do I need to implement a Sort or painters algorithm for transperancey to work properly or is there any way to use the zbuffer & polygon location etc to avoid sorting everything?
Ps. This does not use api's. It's all software based rendering so OpenGl soloutions etc are no good.

SDL2 + openGL ES 2.0 frame rate performance boost with less CPU load

I am developing on a linux system using latest (at the moment) SDL2 (2.0.8) + openGL ES 2.0 (GLSL 1.0) eventually targeting a raspberry pi 3 board. I have so far done a few things like drawing text with freetype, drawing lines, text boxes (editable), text lists, waveform boxes (all i need to pass to a function is an array of vertices) and other shapes with glDrawArrays(). Now, there are things that need to be refreshed at, let's say, 10 times per sec and others that need 1 time per second. What would be the best approach to skip re-rendering everything at the rate of 10 times per sec? Because obviously openGL works by drawing everything from scratch on every 'frame'. However i know and you know that other approaches exist that include: rendering on top of the screen you already have or taking a screenshot and rendering on top of it only the fast changing things as well as other solutions. What do you thing would be the best approach to skip re-doing everything before calling SDL_GL_SwapWindow() ? How can i take a screen shot and render it on the invisible buffer then render only the fast changing objects and then call SDL_GL_SwapWindow() ?
This is a screen shot of the app so far drawing basic things
Thanks in advance.
i eventually had to realize that i should not have posted the question in the first place but since this is a place where people learn from others i now feel somewhat nicer :) . So, the thing i had to do was to simply stop clearing the invisible buffer (i will call it that for simplicity) and render on top of it only controls that change. Those that change are updated by covering the area that they take by a rectangle and then draw new stuff on that area. I have already done it and the frame rate just 'exploded'. I do not really think that there is a better approach since the way i do it requires no action at all. All i had to do was to add a few if conditions that selectively rendered or skipped every time the execution reached the point where functions iterate through the controls that have to be drawn on screen and therefore decide what to render and what not. However a well thought set of structures is required for every control instead of declaring and defining endlessly global variables which will only makes things confusing and difficult to maintain.
Regards to all.

The image seems no so clear in openseadragon as its origin

I use openseadragon show arts in my web site, but they seem not so clear as its origin. (I do not have so much reputation to post snapshots):
The original one is sharper, and the one rendered by openseadragonone is blurred.
I was thought that it caused by Deep Zoom Composer, which decreased quality when creating DZI image parts, but i was wrong. The part image in DZI directory and the original one are exactly same, and all of them are readered by a browser(IE 10).
Now the reasonable explaination is the randering type of openseadragon cause the difference, is this a bug? or is there an option / argument which can improve rendering effect in openseadragon?
Two possible issues here. Are you on an HDPI (i.e. "retina") screen? If so, there is a bug fix in master that's not on the latest release yet.
Otherwise, it's probably the minPixelRatio. By default OpenSeadragon allows the image to not be entirely full resolution at some zoom levels, to save on bandwidth. You can modify this value by passing minPixelRatio: 1 as one of the options when you create your viewer (the default value is 0.5).
We can continue the discussion in the issue here: https://github.com/openseadragon/openseadragon/issues/646

How do I project lines dynamically on to 3D terrain?

I'm working on a game in XNA for Xbox 360. The game has 3D terrain with a collection of static objects that are connected by a graph of links. I want to draw the links connecting the objects as lines projected on to the terrain. I also want to be able to change the colors etc. of links as players move their selection around, though I don't need the links to move. However, I'm running into issues making this work correctly and efficiently.
Some ideas I've had are:
1) Render quads to a separate render target, and use the texture as an overlay on top of the terrain. I currently have this working, generating the texture only for the area currently visible to the camera to minimize aliasing. However, I'm still getting aliasing issues -- the lines look jaggy, and the game chugs frequently when moving the camera EDIT: it chugs all the time, I just don't have a frame rate counter on Xbox so I only notice it when things move.
2) Bake the lines into a texture ahead of time. This could increase performance, but makes the aliasing issue worse. Also, it doesn't let me dynamically change the properties of the lines without much munging.
3) Make geometry that matches the shape of the terrain by tessellating the line-quads over the terrain. This option seems like it could help, but I'm unsure if I should spend time trying it out if there's an easier way.
Is there some magical way to do this that I haven't thought of? Is one of these paths the best when done correctly?
Your 1) is a fairly good solution. You can reduce the jagginess by filtering -- first, make sure to use bilinear sampling when using the overlay. Then, try blurring the overlay after drawing it but before using it; if you choose a proper filter, it will remove the aliasing.
If it's taking too much time to render the overlay, try reducing its resolution. Without the antialiasing filter, that would just make it jaggier, but with a good filter, it might even look better.
I don't know why the game would chug only when moving the camera. Remember, you should have a separate camera for the overlay -- orthogonal, and pointing down onto the terrain.
Does XNA have a shadowing library? If so, yo could just pretend the lines are shadows.

Resources