Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [instancing]

The tag has no usage guidance.

0
votes
1answer
13 views

Enabling / disabling Static objects in Unity

The Unity docs clearly explain that game objects marked static should not be moved for performance reasons but I can't find any info regarding enabling / disabling. Almost everything in my games ...
0
votes
0answers
56 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 ...
0
votes
1answer
26 views

Spherecast - enabling MeshRenderer of selector target around prefabbed object once hit and disabling Meshrenderer when not hit anymore

I have an interesting problem - I have been looking up for solutions on this but I think there is something I am missing and I require a little more knowledge. I have a scene and the scene has an ...
0
votes
1answer
100 views

Programmatically created instance does not execute any code

I've created a new instance, positioned it, and added it to the scene like this: ...
1
vote
1answer
83 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 ...
0
votes
1answer
45 views

Errors while instancing particles

Im creating a particle system of my own, and I have some draw issues with it. It's the first time I use instancing, so it's probable I have some concept errors. First, I create three buffers: one for ...
1
vote
1answer
241 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 ...
1
vote
0answers
140 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
1answer
34 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 ...
0
votes
0answers
8 views

Accesing (Scriptable)Objects without referencing them in every script

I have a ScriptableObject named Item. Let's say I've made three items with this object. I want to have a way of accessing these three items without referencing them in every script. My idea was to ...
0
votes
2answers
18 views

Is there any way to change the layering of objects in Actionscript 3 without altering the run order?

I'm making a simple platformer in Adobe Animate, and I need the player to be layered in front of the stage because of a gimmick in the game. Unfortunately, whenever I change the layering order, it ...
0
votes
1answer
40 views

Unity prefab functionality without files?

Task Display a UI list Assumptions Most UI parts only get their data during runtime UI parts need to be styled in the editor (= before runtime) UI editing should be done with real time preview in ...
1
vote
1answer
367 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 ...
0
votes
2answers
313 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
292 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 ...
1
vote
0answers
195 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 ...
0
votes
1answer
74 views

How to manage instances of (placed) cards and decks in card games?

This question sounds quite specific, but I mean in general, how do you manage something like a card game when it comes to decks (one for player1, one for player2, ...) and placed cards focused on ...
0
votes
1answer
49 views

Get GameObject which instantiated me in Unity

How can I get a GameObject from another GameObject? If I know, that the GameObject I want to get instantiated(using function Instantite()) the GameObject from which I want to get it. If there is no ...
0
votes
1answer
113 views

Particle system prefab not instantiated

I am trying to instantiate my fire particle system during runtime like this: ...
0
votes
2answers
88 views

In Theory, how much gain should I expect from instancing in OpenGL for small scene with large meshs?

I am trying to implement one-pass stereo rendering in OpenGL for a VR application that I am building. I am implementing this through instancing, so I make one render call ...
0
votes
1answer
215 views

How to put a reference to my player (already instanced) into a prefab that will be instantiated later [duplicate]

I'm making an enemy in my game. He stands at the side of road with a rocket launcher and fires when you get close. It nearly all works fine, except I just need a reference to the players position so ...
0
votes
1answer
62 views

I have problem understand instantiating new objects in Unity at runtime , help please :)

Hi again you fine folks. So I'm making a driving game and there is going to be some cows in the road you have to dodge. Currently I've laid 3 spawnpoints in the form of flat cubes, with the ...
0
votes
1answer
64 views

Unity: Is there any way for a button to call a function of all clones?

I really don't know off hand. I've got a few ideas but I'm not at my PC to test it. like ButtonisPressed > Clone script etc() ...
2
votes
1answer
218 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 ...
3
votes
1answer
195 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 ...
0
votes
1answer
132 views

Instancing mirrored geometry

I'm rendering mirrored geometry by flipping it's world matrix. Before rendering mirrored geometry I set CULL_FRONT rasterizer state (for normal geometry it's ...
0
votes
1answer
135 views

Streaming to VAO VertexBuffer using OpenGL Direct State Access for Instancing

How do i stream to a vertex buffer using Direct State Access? I want to update my vertex buffer of matrices every frame so i can use it in my Shader. This is how i specify my buffer. I do this once ...
0
votes
1answer
299 views

DirectX 11 instance mesh performance

Today my question is a about instance mesh performance in DX 11, the way I do my instancing is the standard way I think, its the same way I did it in XNA. To start with each frame(every 2nd) I build ...
0
votes
2answers
105 views

Game Maker - Create Instance When Health Is 0

I have five objects: obj_Boss, obj_bossHealth, obj_GameOver, ...
1
vote
0answers
817 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
1answer
205 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. ...
0
votes
1answer
920 views

Unity Singleton accross multiple scenes

I have a game where my code is designed to be on a single scene so I've implemented a singleton like that: ...
3
votes
1answer
108 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 ...
5
votes
1answer
863 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
765 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]...
2
votes
1answer
591 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
111 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 ...
3
votes
2answers
870 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 ...
4
votes
2answers
719 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 ...
0
votes
1answer
188 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: ...
2
votes
1answer
833 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 ...
1
vote
1answer
269 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 ...
0
votes
1answer
265 views

Simple switch to instanced draws causes consistent, but incorrect, results

I have dumbed the following code down to "stupid simple" for DirectX and still cannot get any cooperation: ...
-1
votes
1answer
140 views

Do I necessarily need to write a vertex shader to use geometry instancing?

I've quickly read the GPU gem about geometry instancing, there are many wordings and I'm not sure I understand it well. If I understand it well, when you use instancing, if you want to apply ...
0
votes
1answer
740 views

Binding an Instance Matrix with an InputLayout

If I want to bind an instance matrix to a vertex shader, how do I go about it? For example, here is a super-simple VS input: ...
1
vote
2answers
136 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
80 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
0answers
222 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 ...
2
votes
2answers
1k 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 ...
1
vote
0answers
453 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-...