Tag Info

New answers tagged

3

Yes, generally, games are a single main loop. Games in Java may have a separate main loop for each menu/screen/mode due to Java's idioms, but that of course does not solve your animation wait problem. For things like the problem you are running into, consider using events. e.g., when your animation system finishes playing an animation, it can send out an ...


0

You can also combine approaches from other answers (esp. splitting work into chunks, and finding bottlenecks in code) with implementing the most CPU-intensive tasks in asm.js - it's (a subset of) JavaScript, and it's fast on Fx and Chrome (and IE support is coming later).


3

which means I can only see half the model You can never see the "back" half of the model :P The following is a high-level overview listing some of the LOD considerations for this type of game. 100% of it may not apply to your game and/or KSP. Also, I haven't specified any implementation details for Unity, since I don't know them yet; rather than define ...


1

The issue is that you need a LOD algorithm. LOD stands for level of detail and it means essentially your sphere is only as big as it needs to be in each situation. When you are far away it uses fewer polygons. When you are zoomed in close, maybe only part of the sphere is in memory, and that visible section has a lot more detail than usual. There's lots ...


5

gameObject is case-sensitive. If you're using Unity 4.x, you should be able to disable a renderer like so: this.gameObject.renderer.enabled = false; If you're using Unity 5.x, the shortcut to .renderer has been removed. Instead, you'll need to call: this.gameObject.GetComponent<Renderer>().enabled = false; Note too that you can also get away ...


0

Setting the glClearColor, as Josh Petrie said, is only necessary to do every frame if you do not know if another part of your program is changing it. Although, usually you would be drawing your own background, which would cover the entire background, so the color should not matter. (Of course, you still need to clear the screen every frame to prevent ...


1

In LibGDX Doc Gdx.gl.glClearColor(0, 0, 0, 1); and batch.setProjectionMatrix(camera.combined); is setting in render() method at a time. I use this definitions in create() method at once, and it is running perfect. So why should i use this definitions in render() method? is't it a performance loss? The clear color is part of your OpenGL ...


0

Edit: As usual, I've not paid attention and answered a GL question with DirectX code; sorry... Although the API differs, the idea is very much the same. It will technically qualify as a performance loss, but it may be unavoidable. Ideally, you only want to notify the video card of changes to "whatever is current". Since you are in complete control of the ...


1

Research the new-ish tessellation stages. LOD and complex curved surfaces are both easy to implement with a hull shader. LOD example: A terrain, composed of 2 triangles, can be subdivided and the tessellation factor simultaneously used to select the appropriate mip for the displacement map. In this way, peaks of mountains would retain their height, but ...


2

This technique is called LOD (Level of Detail). Look it up and you will easily find several references on the internet. How many levels of detail you use is completely up to you. It depends heavily on the camera's point of view, how many objects are within your viewport at the same time, and how many are so far away they are just barely visible. Using ...


1

The second image appears to have been taken from inside the building. If so, all of the triangles are reversed and you are only seeing the faces that should be culled. Likewise, faces that should be visible are being culled. Ordinarily, meshes are drawn from the outside-inward so, when you are inside, looking outward, the triangles that were clock-wise from ...


1

It's a problem with sorting order of the objects. Why are both shaders in "Transparent" queue? You could just change the ground shader's queue to "Geometry" and fix the problem. Do you use transparency on the ground objects? If you really need the transparent queue, you could set the queue to things like "Transparent+1" to force it render later than other ...



Top 50 recent answers are included