Questions tagged [instancing]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
16
votes
4answers
5k views

Using instancing for everything?

Instancing improves performance (significantly) when rendering multiple (hunders? thousands?) copies of the same mesh at once. But how much overhead does it have when rendering exactly one copy with ...
8
votes
3answers
595 views

OpenGL Fast-Object Instancing Error

I have some code that loops through a set of objects and renders instances of those objects. The list of objects that needs to be rendered is stored as a std::map>, where an object of class ...
7
votes
2answers
2k views

Particles/instancing groups in an Entity/Component system

I've been playing with an entity/component/system design recently, and I've come across a couple of stumbling blocks. Instancing Let's say I have a few hundred "things" (asteroids, chickens, ...
6
votes
1answer
383 views

instancing and GPU skinning

I'm trying to render a large number of identical rigged entities with independent animation. Compared to standard skeletal animation, I can't compute the pose of each entities and send it to the GPU ...
5
votes
1answer
1k views

Can instantiated objects have different material/texture?

While I have some experience with simple 2D games, I am new to more process-demanding 3D games. One basic question that has been concerning me recently and for which I am having difficulties to find a ...
5
votes
2answers
1k views

Is glDrawArraysInstanced in OpenGL parallel when drawing those instances?

Is glDrawArraysInstanced in OpenGL parallel when drawing those instances? I cannot figure out by referring to its reference and numerous online tutorials. [Update]...
5
votes
2answers
913 views

Instanced rendering with ARB_vertex_attrib_binding

I'm trying to separate the vertex format specification from the vertex data. I was able to do that for the mesh vertices successfully. For instanced rendering I wanted to further separate the instance ...
4
votes
1answer
91 views

Data structure for collecting entities for instanced rendering

My game, a citybuilder, has many simple entities that rendered via glDrawArraysInstanced. A large city has over 600,000 entities, but most of those entities are one of a few hundred meshes. Every ...
3
votes
2answers
2k views

Draw selected instances of VAO (glDrawArraysInstanced)

I'm using glDrawArraysInstanced to draw multiple instances of a tree at different positions to generate a forest. Is there a way to draw selected instances? For example: I got 100 trees with ...
3
votes
1answer
1k views

OpenGL poor performace with instanced drawing

I'm just started learning OpenGL and this is my first project besides tutorials. I'm trying to load a huge enginering model: The data is structured in a way that I thought I could use instancing for ...
3
votes
2answers
2k views

Implementing Geometry Instancing in DirectX

I have a project that I'm doing in Managed DirectX (DX9) where I want to render lots of grass. My current method (many draw calls) is slow, but I've heard Geometry Instancing can fix that. I know ...
3
votes
1answer
140 views

Mesh-level acceleration structures for collision detection when mesh instances can be rotated, scaled and/or resized

Short version: in the mid-phase or narrow-phase of collision-detection, does any acceleration structure organizing the mesh's vertices (e.g. AABB-trees, Octrees, Quadtrees) work for the mesh's ...
3
votes
2answers
1k views

Instantiation of a GameObject not working for a threading reason

I receive the following error "INTERNAL_CALL_Internal_InstantiateSingle can only be called from the main thread." "Constructors and field initializers will be executed from the loading thread ...
3
votes
3answers
5k views

How to Bind Multiple Shapes/Models to One Vertex Buffer?

If I have two Vertex Arrays, one for Square, and one for Triangle; what is the best way to bind them to the VertexBuffer? What are the patterns used to write multiple vertices to the VertexBuffer? ...
2
votes
1answer
218 views

Can GPU overload cause rendering inaccuracies?

It was supposed to be a continuous tube, made out of 5000 instanced rings of 60 cubes each (12 triangles each) on my integrated laptop intel GPU card using OpenGL 3.3. That was what I got. The ...
2
votes
1answer
669 views

How should I share variables between instances/classes?

I'm making a game using LOVE, so everything is programmed in Lua. I've been experimenting with using classes and object orientation recently. I've found out that a nice system to use is having most of ...
2
votes
1answer
1k views

How to expose a child node’s texture from the parent in Godot

I built a simple scene that I instanciate at will. Simply a KinematicBody2D as root, containing a Sprite and a ...
2
votes
1answer
2k views

Draw call optimization for multiple meshes in DirectX11

I have a large scene in a B3D model, which includes about 120 meshes as in the following pictures: large B3D scene http://s22.postimg.org/d1h75hr0v/Untitled.png Each mesh contain a vertex buffer ...
2
votes
1answer
724 views

Performance of instantiating many prefabs as children of one prefab in unity

Is there any performance difference between [instantiate multiple prefabs] and [put all prefabs under a single parent prefab and then instantiate that parent prefab] in scene. Hope you understand what ...
2
votes
0answers
143 views

Instancing meshes messing up scene lighting

I've been rendering a scene (some objects over a large field of grass) to test shadow mapping which is working fine. But when I use instancing to "gain" performance, I not only get a decrease in ...
1
vote
1answer
388 views

Why don't my generated instances update when I change their prefab?

I’m making an Editor tool -- a ScriptableWizard -- that instantiates a prefab on a grid. But I find that when I update the prefab, the instances don’t update. When I instantiate prefabs ...
1
vote
1answer
790 views

No performance gain from instanced rendering?

I recently worked through this tutorial about instanced rendering. At the end it promises to draw a huge amount of instances of one model without performance drops. So I tried some simple instanced ...
1
vote
2answers
2k views

How (update,set, apply) dynamically color on a model of a XNA project?

I encounter a problem for set a background color on my model instantiated. I can change the texture but not change color. Is there a parameter for change the color ? Or change the opacity ? I am ...
1
vote
1answer
267 views

Instantiated Object returns Null outside Start method

I'm attempting to access an instantiated 'goalTemp' GameObject from a different function inside the same script. I'm getting the information in the Start method, assigning the GameObject find/get ...
1
vote
1answer
263 views

What is GPU instancing and what are its differences in comparison to standard instancing?

I have been reading a lot of debate on a new feature that will be in Unity 5.4: GPU instancing. I understand the importance of instancing in general, both in terms of saving memory and draw calls. ...
1
vote
2answers
209 views

What's a good way to programmatically manage a cloneable entity?

Say you have missiles or rockets that a player can fire. What's a good way to programmatically manage the cloning of a base rocket, for example? I can think of 2 ways to do it: Player has a ...
1
vote
1answer
61 views

Change object's location at instantiated moment

I'm trying to instantiate object(scene) and set it's spawn position at the spawn time. Here's the code I wrote: ...
1
vote
1answer
696 views

DX12 Passing an Instance Buffer

I'm trying to take the DX12 Cube Demo that comes with VS2017 Community and draw three cubes instead of one. Unfortunately, the VertexShader doesn't seem to be getting my instance data. In my ...
1
vote
1answer
344 views

Instantiation taking too long?

I have a game where there are about 4 empty objects that are my object "spawners". I have two scripts attached to all of them, one that will keep spawning objects from ...
1
vote
2answers
171 views

Instancing effectiviness

At about how many instances would instancing become effective? DirectX dynamic buffers seem to take a little more out of the fps than an immutable one would. So obviously you wouldn't want to make a ...
1
vote
1answer
88 views

Per instance world matrix is 0.0f/NaN

I'm trying to draw some cubes with Hardware Instancing. However they don't get displayed. So I debugged my code, and found the source of the problem: In my VertexShader, the var that has the per ...
1
vote
2answers
1k views

When should I use instancing versus a constant buffer?

I've heard something about instancing and understood it's useful for drawing the same object many times with slight changes. It's faster because you call the draw function once per frame and update ...
1
vote
1answer
970 views

XNA: Instancing Cubes, Each Side Different Texture

I am trying to make thousands of instanced cubes, each with a unique texture on each side. Am I going to have to split each cube into 6 instanced faces, or can I unwrap it in such a way the the ...
1
vote
1answer
43 views

Efficiently rendering lots of the same mesh in Unity3D, but with different colors?

I'm working on a tile based game, where grass is spreading from tile to tile, so soon lots of grass appear on the board. Instancing is on, so the FPS is kind of good, even with 300k triangles (1 ...
1
vote
0answers
125 views

Unity Graphics.DrawMesh equivalent for Physics?

I'm working on something where the same graphics mesh is rendered multiple times in the scene. The problem with this is that each of those graphics items have a physics mesh which isn't there in the ...
1
vote
0answers
193 views

Uniform arrays do not work on every GPU

I am trying to implement instanced rendering for objects that repeat, so I came up with idea I could simply group objects that loaded same model files, create array with their Model matrices and so on,...
1
vote
0answers
294 views

Why are my cached (in an array) gameobjects disappearing?

First, some context: I am developing a chunk loading system for unity. I load all the chunks as prefabs from disk to an array as a cache. When I need to load a chunk, I instantiate it from the cache ...
1
vote
1answer
341 views

Monogame/XNA Hardware Instancing problem

Here's a youtube video of my problem. https://youtu.be/1zB4q9_sNQI Look at how the hideous cube kinda slides into the terrain and rotates weirdly with the world and from above its vanished into the ...
1
vote
0answers
1k views

Rendering thousands of circles in pyopengl

I am interested in rendering animated 2D vector graphics in python using PyOpenGL. As an initial test, I am trying to render thousands of pixel-perfect circles drawn using shaders. Here is the current ...
1
vote
0answers
235 views

How can I keep vertex order the same on every Instantiate()?

While trying to resolve another question, I have discovered that if I Instantiate() from a prefab, the order of the mesh vertices (and therefore triangles) is inconsistent between instances. This is ...
1
vote
0answers
546 views

Help with instancing: seg fault with glVertexAttribDivisor

I'm trying to get the basics of instancing in OpenGL 3.3 and failing miserably. I'm starting with the Jason McKesson's Depth Buffering tutorial, then modifying it so that only the horizontally-...
1
vote
0answers
538 views

Microsoft XNA code sample wont work with blender model [closed]

I downloaded this code sample and integrated it into my game http://xbox.create.msdn.com/en-US/education/catalog/sample/mesh_instancing It works with the model that they supplied, but throws and ...
1
vote
2answers
616 views

SharpDX instancing with D3D11

Could anybody provide working code using SharpDX with D3D11, which does instancing and uses SharpDX's content pipeline? I have several problems there. I came to understand that one should use a ...
0
votes
1answer
51 views

Affecting all instances of a GameObject at once

I want all instances of a prefab to change their velocity when one of them is clicked, and I think having each object constantly check a variable with a coroutine might not be the best solution. How ...
0
votes
2answers
1k views

Unity - Instantiate 2 copies at same time?? (Asteroids clone) C#

I haven't been at my computer learning code or game dev in a few months and am just starting again. I am trying to make a game very similar to Asteroids. In 3d but fixed camera from above so basically ...
0
votes
2answers
3k views

Batching elements

I don't understand exactly how batching works. What I have understood: Batching is useful to regroup similar elements together and draw them in one draw call (performance++), currently drawing an ...
0
votes
1answer
217 views

error X4016: SV_InstanceID semantic cannot be used with 10Level9 targets

I'm using a variant of the D3D12 UWP template that comes with VS2017 Community Edition and I have two related questions: When I add this italicized and bolded code to the vertex shader signature, I ...
0
votes
2answers
820 views

Unity - DontDestroyOnLoad - FindObjectsOfType(GetType()).Length is always returning 1

I'm trying to have an object with the DontDestroyOnLoad property. I want an object with NetworkIdentity to persist across scenes, so I can have a holder script for ...
0
votes
1answer
212 views

Transformation problems with hardware instancing in DirectX 11

I'm getting some wonky geometry in my application when trying to use instancing. I'm not sure if I'm doing the mapping of my per instance data wrong. This is how my mapping looks like: ...
0
votes
1answer
234 views

OpenGL C++ Drawing particles instanced performance

In my 2D Game Engine I'd like to reduce the amount of draw calls. I used to do a draw call for every particle, which yields worst performance. I've tried instanced rendering in OpenGL but my ...