Questions tagged [instancing]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
41 views

New to Godot having problem understanding Button Group

I'm having an issue trying to understand the ButtonGroup logic, totally new to GDScript, don't have a clue of what I'm doing. Obviously is wrong. I created a scene that I saved in a folder called &...
  • 113
0 votes
1 answer
46 views

Is there any performance difference between Draw() and DrawInstanced(1)?

The background of the question is, does it make sense to introduce an if case when drawing a mesh for whether there is instancing or not? This is using DirectX 11 ...
  • 185
1 vote
0 answers
36 views

How can I instantiate an object at a certain position?

In my game, the player drives a car and when the car reaches the end of the road, I want a different road prefab to be spawned. I have multiple road prefabs, and want to be able to spawn one when the ...
0 votes
0 answers
18 views

How can I snap a mesh to the grid, on dragging it into the scene, in Unity?

I've got a game that involves voxel-like game object management. Each voxel object snaps to the integer coordinates in Unity's scene, at play time—easy enough to do in the ...
2 votes
1 answer
64 views

deleting and re-referencing nodes with $

I want to delete a scene and re-load it. This code would fail later, because the new "CoolScene" has in fact a different name, something like "@NotSuchCoolName@34", and thus it ...
  • 143
1 vote
0 answers
71 views

Why instantiated Static Mesh gets scaled in Unreal Engine 4? [closed]

Building a project in Unreal Engine 4.26 while trying to increase performance of the videogame I ended up using instances of static meshes where possible. This generated an issue: My instantiated ...
4 votes
1 answer
137 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 ...
2 votes
1 answer
3k views

How to declare per-instance properties for instances rendering on a shader graph?

Unity Version: 2019.4.1f1 Render Pipeline: URP I created a shader using Unity's Shader Graph, and I want to apply GPU Instancing on this shader, but there is no way to declare per-instance properties ...
0 votes
0 answers
227 views

Saving mesh and instance data on the GPU?

I am trying to optimize drawing a large number of voxels by using GPU instancing in Unity. I am currently using Graphics.DrawMeshInstanced in a script Update(), but it occurred to me that I am still ...
1 vote
1 answer
171 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 ...
  • 661
0 votes
1 answer
277 views

D3D11 Instancing - Help with sending instance data using two vertex buffers. First, for position and color and Second, for per-instance Matrix Data

So here is the premise: I have 2 vertex buffers buffers whose data and corresponding definition is as follows: Vertex 1: This one contains the per instance data ...
1 vote
1 answer
320 views

Efficient update of instance data for instance rendering

I started implementing instanced rendering in my 3D engine, but I quickly stumbled upon some issues that I'm not sure whats the best practice to work around. When I setup my scene, I capture the ...
  • 204
1 vote
1 answer
147 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,123
0 votes
2 answers
613 views

How to access the parent of a cloned prefab?

I have a menu that gets populated at runtime with buttons whose text components are based on objects that the game manager has in its databases. At the start, the menu is empty: See that "A" graphic? ...
6 votes
1 answer
978 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 ...
  • 101
0 votes
1 answer
403 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 ...
0 votes
1 answer
35 views

Can't get Instantiate working

I am building a 2D game and I want to fire a bullet from my player whenever the player press certain button. But, When I use instantiate and add force to my rigidbody it won't work. The code is: - <...
0 votes
0 answers
22 views

I Can't spawn buttons in my Grid. why?

Today i was following a tutorial about making a shop, but i got a problem. and i've followed the scripting tutorial, but it seems i can't spawn a button inside the grid when i pressed GetItemButton. ...
0 votes
1 answer
60 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 ...
  • 15
0 votes
1 answer
470 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
1 answer
853 views

Instantiate unity sometimes lags the game some times it doesnt

I have a script that instantiates a object lets say every half a second. THis object is of the type .fbx and has a file size of 53kb, lets call this object A. When ...
1 vote
0 answers
247 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 ...
  • 3,571
0 votes
1 answer
3k 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 ...
  • 230
2 votes
1 answer
2k 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
1 answer
77 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
1 answer
355 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: ...
  • 155
2 votes
1 answer
581 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 ...
  • 139
0 votes
1 answer
54 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 ...
2 votes
2 answers
2k 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
0 answers
345 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,...
's user avatar
1 vote
1 answer
1k 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 ...
  • 113
0 votes
2 answers
27 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
1 answer
54 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
1 answer
1k 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 ...
  • 313
0 votes
2 answers
2k 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
2 answers
1k 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
0 answers
321 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
1 answer
103 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 ...
  • 47
1 vote
1 answer
828 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
1 answer
400 views

Particle system prefab not instantiated

I am trying to instantiate my fire particle system during runtime like this: ...
  • 125
0 votes
2 answers
460 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
1 answer
450 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
1 answer
65 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
1 answer
177 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() ...
1 vote
1 answer
443 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 ...
2 votes
1 answer
224 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 ...
's user avatar
0 votes
1 answer
240 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
1 answer
241 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 ...
  • 145
0 votes
1 answer
630 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
2 answers
469 views

Game Maker - Create Instance When Health Is 0

I have five objects: obj_Boss, obj_bossHealth, obj_GameOver, ...