#archived-dots
1 messages · Page 277 of 1
Any idea why PhysicsVelocity on player is not changed in this triggereventjob?
It's supposed to make player jump on trigger, but...
it just doesn't nothing
trigger events do happen though
And entitiy indeed gets it's component removed
I think you are modifying the Linear copy on the struct, not the struct itself
hm
So you would need to do velocity.Linear = new float3(...)
I tried to check linear velocity after writing btw
will try it again
bruh, Unity crashed xD
You fell for my trap!
I can understand that in the normal game development sense.
I just want as much VFX and animated characters, both networked in the game as possible, I just want to have some fun creating those systems and putting them together.
But if I would want to make money from the game this is indeed not the way to go.
Anyhow, thanks for the suggestion of the Texture2D.GetRawTextureData<Color32>() I will try to figure out how to make that work.
nope, seems like struct is modified correctly
The documentation for it is pretty good: https://docs.unity3d.com/ScriptReference/Texture2D.GetRawTextureData.html
Basically just modify it, then call Texture2D.Apply
I guess the only explanation then is that some other system is overwriting your physicsvelocity?
nnnope xD
Cosmic radiation it is
I went through it again
literally all mentions of PhysicsVelocity
nothing is modifying it
Physics 2D is not it. I tried switching it off already
Hello everyone, I have a few questions, can anybody suggest a worthwhile approach?
- How do you control game states? Is it a some service with statemachine or full ecs way, want to know some deep details or links with articles)
- How do you use services like FileDownloader? Singleton or some static class with provided service or some other?)
- Just add entities/components of states. And use
RequireSingletonForUpdateto enforce systems to run only during those states.
really nice approach to obtain full power of SystemBase
and keep code clean within system
wait a second
if my job exists
during physics step stage
maybe that's the reason why modifying componentdata array makes no difference
how do I modify entity then?
🤔
It only takes structural changes
Cubes, default material, lit but without shadows.
ok
I figured it
I need to modify PhysicsWorld
modifying component data is useless
in EventTriggerJob
So it turns out... 100% the reason I could not compile to standalone is a UNITY BUG. Unity Devs watch this: https://www.youtube.com/watch?v=r-NTbLDcl6U The UI glitches when I attach a standard component and when I try and build an editor build, its happy, but standalone not. This is disconcerting since I did spend 50 hours tracking this down + 30 hours of fret on top of that over 9 days, and was getting forum backlash by users and mods that I had no clue what I was talking about and UNITY doesn't have bugs like I'm trying to slander the product. No I love Unity and want you to make a better product, don't silence people helping your product get better, please?
An official Unity dev should watch this.
Unity Rules normally. I'd buy stock. I love using it. I love the experimental packages. But Unity sucked for me this past 9 days of over 50 hours of coding on top of 30 hours of fret. I been non stop compiling 2 minutes at a time for hundreds of times, looking up tech documents and stuff for things that...
You can't use EntityCommandBuffer.SetComponent?
I'm guessing you are trying to build while you have a GenerateAuthoringComponent on an IBufferElementData?
Yup
Yeah, no idea why that doesn't work
I wrote manual authoring components for all my IBufferElementData
wait
I can't
if I modify physicsVelocity in ECB
How do you do that?
Yeah, makes sense
You mean write a manual component?
Yes please.
You also cannot change the position, or angular velocity.
Just add thrust and angular acceleration(verbage wrong)
you mean in physics world?
or smth else?
Do I put this in the IBufferElementData file or in its own file and reference it from IBufferElementData?
Remove the GenerateAuthoringComponent from the IBufferElementData, then add the custom monobehaviour authoring component to the entities that need it
HandAuthoring in the above example
Think: A collision changes your velocity, angular rotation. So if you set those hard, you override the changes. You need to change acceleration to counter act em, and slowly regain yourself normally.
So hand authoring is monobehavior
Yes
And ibufferElement references it
No
It's the authoring component. You add it to a gameobject and the conversion system will convert it
Whoa
so Just remove
[GenerateAuthoringComponent]
from IbufferElementdata
and your game object gets that monobehavior you wrote in that picture?
Yes
Removing GenerateAuthoringComponent will invalidate the auto-generated script, and your gameobjects will tell you the script doesn't exist
if I end up being a kachillionaire, ask me for some ph@t L3vvt IRL
I have no idea, I assumed this is a known issue fixed in 0.50
Took me a while to figure out too, I had to go backwards through commits and find one that worked, and then just try random things 
Life will find a way. Cats will find a way faster. Noodle cats already found it and have it stashed with your car keys.
hmm
I wonder how I can implement different (very simple) animations in pure ECS
in OOP I used async actions
which would modify transform for animation
any idea how can I implement similiar behaviour with ability to add a lot of different animations?
The line: DstEntityManager.AddBuffer<hand>(entity); What does that mean?
Is that supposed to be my ibufferelementdata?
Hand ?
DstEntityManager is a property of GameObjectConversionSystem
this is buffer
Hand should be your buffer type
it returns dynamic buffer added to entity
Yep
tyty
Hope it fixes your issue
So one final question
I actually give them item drop loot information in the scene
Is that not possible? Do I have to do it in game?
is there anything unexpected with v.51 when dealing with terrains? Mine doesn't seem to working, no errors, just does the convert and destroy but no trace of terrain or its collider
Add the information to the authoring monobehaviour (in the example HandAuthoring, e.g. give it fields with data, they will appear on the gameobject), and then use that data in the conversion system to set data on your converted entity
Do I need to add both HandAuthoring And ItemDropBufferElement?
Or just handauthoring
Can you post your buffer? I'll write you an example
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Sorry for shipwreck comments
mostly just a few ints/floats/bools
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Thats what I have so far
You prolly want to copy/pasta the second file
I think I just add the data types public on the authoring
My question was more: When I attach to a (gameobject to be converted to) entity in scene, do I need both authoring and itembufferelement?
Or just one or the other
I didn't convert the whole thing, but this should get you an idea of how it works: https://hastebin.com/ugemojuqow.hs
You then add the authoring component, set the data and it will be added to the converted entity
You a boss
I just hope it's actually fixed in 0.51
Good luck working with them
aw, it can't too bad xD
I mostly worry about implementation though
Just a quick Q, not worked with entities since the 0.17'ish days so I am a bit rusty.
My case is that I want to build a fairly complex set of interrelated entities, should I shoehorn it into a conversion workflow or use a monobehaviour that constructs my entities using the entitymanager instead? Are there other recommended ways to create entities now?
https://docs.unity3d.com/Packages/com.unity.entities@0.51/manual/conversion.html
The generation process that consumes GameObjects (authoring data) and generates entities and components (runtime data) is called conversion.
This process is the preferred way of authoring ECS data```
Read the whole thing, its useful. But Unity says this is the preferred way, so I guess that would be a good start for you.
if you have premade scene -> go conversion is probably best
SubScenes are perfect for this
if you want to spawn entities off prefabs - you can also use GO conversion
Unity has utility classes for prefab making
This one? GameObjectConversionUtility
but in some niche case you might want to create entities by yourself from scratch
which is also option
can't help, haven't touched it for a while
Alright, got it!
I'll give SubScenes a try, my main issue there lies with re-usability, but maybe I'm able to set up a few base converting gameobjects at the root of my SubScene that combine into the entities I want.
you can use all power of reusability of GameObjects
while authoring your scenes
Huh, then that might be my solution, I just assumed that they were sort of like regular Unity Scenes.
Where's the best place to learn about working with subscenes?
The docs and then the samples I guess?
docs, idk about samples
never found them much use, except for physics
Got it, thanks mate!
@rotund token sir, I found your old forum post about tweening perfomance in ECS
Does it have a continuation?
yeah
you posted some benchmarks on allocating a lot of memory for tweening
but I'm looking for either ready solution for tweening or for a way to make one myself
There's a good chance I haven't used tweening since whatever that post was
been a while since I popped into here. been in the graphics dungeons
anyone know if MaterialPropertyBlock can take native arrays?
Or if any of the Graphics.DrawMeshInstanced() methods can take a native array property block?
hey o/ no idea, I just read it a bunch of times as feature request. guess it hasn't arrived yet if you are asking
Yea. Im trying to find some hook but there just isnt any. I've been chipping away at my own 2d lighting engine.
Because unity's URP is hot garbage
why's that?
Doesnt use instanced lighting for one. So each and every light is rendered individually.
Well, it does batch the lighting if you set it up properly but if I go to that length, I might as well render them manually
in deferred too?
i dont think unity's URP 2D lighting supports deferred lighting. There was no option
does 2d/3d urp differ? they added deferred rendering in unit 2021 for urp
yea, it's a completely different renderer for 2d urp vs 3d urp
God im so rusty, I have no clue how these new partial system base things work
And i dont know if 0.51 on 2021 even works...
Wow, that's actually pretty good.
Ya know, now that I actually see the lambda outputs for Entities.ForEach(), I trust it a hell of a lot more.
am I the only one that feels like scripting language with dots would be awesome?
also is there somewhere I can get a list of all engine api that can be safely used in dots
List of engine API that can be used in dots
so nothing?
if by dots you mean like jobs, then yeah pretty much nothing?
there are some wrappers like meshdata etc
but pretty much everything requires main thread sync with unityengine
what in particular are you looking for?
Just wondering if they are planning us to be able to use engine api calls in multithreaded ecs systems
Job threads are completely isolated outside of the initial scheduling and completion.
There's no calling methods pulling additional data from inside a running job. Not intentionally in any rate.
You can do some funky things with raw native array pointers but that's pretty much it
Like if i Have some heavy math calculations will there ever be a day i can just pass the results to some engine api and do what I need to do directly instead of having to jump through hoops to use threads
is that the plan for ecs in the future or no?
You do the heavy math crunching inside a job then once it's completed, pass it to the engine.
you need to be a lot less abstract with your questions
Like that's the rendering data property block construction. While the math is pretty simple, i still need to pass it via .ToArray() to a MaterialPropertyBlock that is then cmd.DrawMeshInstanced()
On the main thread, passing the data between method calls is very cheap so dont worry about that.
Ok for example, you know how you can now use the physics api in jobified systems? Are they planning to make this work with the entirety the unity api? Will there be a day I dont have to use oldschool componets etc.
to be fair, aren't unity kind of phasing out the concept of property blocks with their srp batcher*?
Graphics buffers are still extremely cutting edge. God i wish I can use it without the rendering system exploding.
This is GPU instancing, not SRP batching.
that's a completely different physics system
Physics currently only has the raycast system that is jobified.
And that's a black box of magic. Everything else is main-thread.
oh yeah thats a good point i guess, they exposes raycasts
No other option other than a material property block sadly.
oh i'm aware
if you're using graphics.drawmeshinstanced
i just mean that their new 2022.X apis etc kind of go away from this so looking at adding support for things like NativeX is probably not high on their todo
I dont even want to think about 2022. That's years from now
sooner than you might think!
if 0.50 is any indication, pretend as if it's late 2020
surprise, it's already half way through 2022 😄
Hrm, material property blocks can take compute buffers which accept native arrays... no native array access though
if buffers accept native arrays you can just switch into indirect drawing
Doing that now. It's fucked a lot of the data handing so hrm
yeah, indirect drawing is a bit of pain
but it's so much faster
you have total precise control over drawing
Someone know something about NetCode? I try to sync VR Rig (3 objects).
My first idea:
- All of these objects are different Predicted object.
- For the all objects I can send separately input (by InputSystem)
But there is a problem: - The
CommandTargetComponentcan link only to single Entity - This means that I can create only one
ICommandDataper client (right?)
The second solution is create parent with ICommandData for data (2x controllers + camera). Prediction for owner / server works correctly but it doesn't work for other client (ICommandData is not replicated?). Can I add GhostAuthoringComponent to childs (head and hands) too?
What is the best solution to solve the problem?
not super familiar with VR these days (been ~3-4 years since I touched it)
but what is the reasoning for the player 3 separate ghosts? instead of being 1 ghost that controls all 3 parts
children of ghosts can be synced
is there any way to make entities have more proccessor power friendly collision (in rigid bodies), even if it is at the cost of some realism, i have some plans that are going to have 100s of entities colliding at once, and currently from testing that causes severe lag
Now I can see that in GhostAuthoringComponent I can setup components. But I need to understand it better.
that's weird
i can have 100s collide fine
hmm just when i went to vacation entites 0.51 releases. is it safe to update or should i wait?
i would assume 100s by eye, the real amount is unknown for now
i usually run simulations up to 20-40k physic objects before really breaking down
woah
it's really how close your collisions are though
just spheres nuzzling
if all your collisions in a tiny area, it ain't going to work
perhaps it is my hardware just being bad though, ill quickly grab my gpu and cpu specs
this is my cpu
this is my gpu
dont think the area is that close, how close is too close?
Are you testing in editor?
just kinda nuzzling
yes
ill check the build later, but for now ill test the first things
nice, im getting about 10 fps higher, making it bearable
also this is how close they are, incase this is too close
thats very close
oh, unfortunate
that's a lot of collisions/frame
(also make sure you turn off integrity checks for physics)
ah, so is there any way to make collisions less acurate then, cause if they clip through eachother it doesnt really matter too much
yup i did
personally i advise running your fixed update at 50% in editor vs buil
overhead makes it much easier to run into fixed update spiral of death
not really certain what that means, but the spiral thing sounds terrifying, and ye ill mess around with the physics fixed update thing
by default updates at 60fps
by halve it i mean run it at 30fps
the problem with fixed update is, if your fps drops below 60fps
then you need to run more than 1 update/frame
which then makes your fps even lower
which means you need to update even more/frame
ah, my fps is almost always below 60fps so that makes sense
and the death spiral begins
that explains a lot
yeah run your fixed update < your fps
ok, which tab would i find that under btw
just get a reference to FixedStepSimulationSystemGroup in OnCreate of a system and set the timestep to 1/30f or something
oh ok, i swear there is a way to do that in the editor, although perhaps im thinking of non-dots
guessing physx aint entities?
code pasting here is considered evil for some reason
you will have to screenshot it
sec i figured it out last night
or paste bin
really, impressive?
public FixedStepSimulationSystemGroup()
{
float defaultFixedTimestep = 1.0f / 60.0f;
RateManager = new RateUtils.FixedRateCatchUpManager(defaultFixedTimestep);
}```
see
how?
i outsmarted the bot
what witch craft do you know?
tell?
you just can't have indents for some reason
🤷♂️
lol
super annoying but at least i know how to work with it now
good job!
its funny but last i read on this discord
and thanks!
screenshotting code is against the rules ^_^
yup lol
but they made it the easiest way to share...
good job unity discord bots
and guessing it is only #archived-dots and no other channels?
i doubt it but who knows
and cause #archived-dots is a relatively small channel gussing it will probably take a while for them to get around to fixing it
i literally read no other channel
lol, eh im pretty sure it is only this channel, when i go to code beginner and general to help people sometimes, ive had no issue with auto deleting code snippets
anyway i should get off my ass and go for a run on this cold evening
hopefully that helps
good job!
also just making certain, i put that in a system base, not a monobehaviour or a componentsystem right?
It is not this channel only. It is specific pieces of code that makes the bot go haywire.
Yesterday a guy posted a 100 line Struct with an Equals method in it. It was that method that got it blocked, the rest of the code was fine.
In #💻┃code-beginner you only have simple code and that is fine to post. Might be the lambda that wrecks it, but I don't know.
oh ok, that would make sense
i was just showing how the fixed step system works
i forgot my comment about the code got deleted
i.e. its just hardcoded in the constructor instead of reading any setting
you just get the FixedStepSimulationSystemGroup via world.getexistingsystem
in OnCreate
and change the update to whatever you want
ok, im pretty sure i get that now then, thanks a bunch!
ooh also question, im very new to shadergraph and stuff, and i plan to mess around with it, does shader graph work with entities?
they are unrelated, and yeah, they work together
awesome yay!
Hello everyone, where can I find documentation on the BuildConfiguration asset which is required for DOTS projects?
I want to pass a launch argument but don't know how it's supposed to work.
It seems like Run Settings -> Extra Arguments aren't available in System.Environment.GetCommandLineArgs();
AFAIK the components details aren't documented yet. The manual for com.unity.platforms isn't helpful and redirects to a page on the entities manual, which started to explain things on the topic, but still noy into details component by component
https://docs.unity3d.com/Packages/com.unity.entities@0.51/manual/ecs_building_projects.html
One interesting thing to note in this page is that these components are overrides of the main build and player settings
So maybe you can fallback to the legacy way of command line arguments ... ?
tbh it's a fairly active channel.. there's a mod around here somewhere, maybe could fix it
Are certain things currently a bit wonky in 0.51
Just testing with a fresh project in 2020.3.34f1 with latest Entities etc
But i'm getting some odd things, such as the Subscene not showing any options in the inspector
I havent experienced any issues with base entities on 2021.3 so far. No clue about HR.
Also previously ( before 0.5 ) objects added to subscenes were automatically set to 'Convert To Entity' in the inspector ( i think it said in brackets 'by scene' ).. this doesn't seem to be the case, i have to manually tick ConvertToEntity
god i would actually love it if you could have gomeobjects in subscenes :S
just remove the GO from the subscene and you should have a game object
that subscene looks wrong anyways. there should be a checkbox to close it
try recreating the subsceen?
yeah, another oddity
basically - i removed the subscene from my scene, and then manually dragged it in, now the inspector is blank
it happend to me before. try changing to another scene and back
Bunch of errors also, not seemingly related to my ( thus far very basic ) ecs code
Maybe some stupid package version problems
Was just curious if it was anything obvious that other people have experienced
No issues with this set
maybe Burst, upgrading that
Ah shit, you're right, i didn't
first time i open the project its always broken
skipped right past the popup that says "restart editor after burst change"?
i already had burst installed but no entities.. forgot it had prompted me for restart
haha yeah
@robust scaffold no issues with 2021 so far?
none right now. Everything is code gen'ing properly
Im mainly doing URP shader things but the small dip into entities is fully functional
custom realtime gi thing?
2D lighting
oh i have a related question. i think one of my urp shaders now is broken because i convert the object to an entity (gameobject on a tilemap). the shader needs the world position of the entity. how do i pass that property ?
Draw mesh instanced procedural is breaking everything
thats what Im trying to do as well
Well, okay. There's the easy way, which i know works, and there's the performance way, which doesnt
are you making your own shader with manual drawing (draw mesh [instanced]) or is this a material?
shadergraph material
oh, then it's really easy. There should be a node directly called world space position. The shader already knows where it's at
all good after restart - thanks for the reminder!
i do use the worldspace node. everything worked with gameobjects but not with entities. hmm maybe i have a diffrent problem alltogether then
shouldnt matter, it's a built in shader property. mul(unity_ObjectToWorld, v.vertex) It should work regardless.
is it that the world space position is not accurate?
thats good to hear. atleast im not going down the wrong debugging path then 🙂
Atm i cannot really tell what the problem really is. somehow the shader is either not drawn, drawn somewhere else or drawn below sth. (i havent had the chance to debug it yet. it just now occured). I just figured since its the only property that could cause problems it might be position. guess its not then.
Hybrid renderer?
yes
IIRC, hybrid render also uses draw mesh instanced procedural as its rendering system. Does that object have a scaling or even positional change to it? Does it render if you set the transform to 0 with 1 scaling?
that is how it looks after putting the tilemap into a subscene.
and this is how it should look
Does the tilemap object have the grid component?
alright, hrm. Tilemap rendering is custom implementation. It uses the texcoord0 data in the vertex to indicate what tile should be rendered. Hybrid renderer may not be able to recognize this and thus breaks the encoded data
hmm but its gameobjects brushed onto the tilemap. its not tilemap internal sprites.
this is the object with the shader
i didnt see the warning before. might have sth to do with it.
main tex? Shadergraph right?
It should have a main tex built in but if not, just add a texture2d property called "_MainTex", make sure the name and the compiled property is called that
im not the one making those shaders so i dont know what exactly happened there. there is no maintex
Alright, it's real simple. Go to the shader graph.
Make sure the reference is "_MainTex", exact spelling and capitalization
Then use that texture as the tex2d sampler source
or, screenshot the shadergraph please, just the inspector and properties list if the shader itself is copyrighted
let me change branches to where the problem actually occurs
It's just modifying whatever the source texture for the sprite to _MainTex as the reference name.
ah looking at the shader it seems like he creates the texture himself in the graph out of noise. so thats probably why there is no _MainTex by default?
rofl. that graph is far too big and too chaotic to screenshot ^^ artist workflows 😄
That's pretty normal, especially with water/terrain generation texture.
So do i need to create a MainTex property anyways?
Possibly. I dont know what your shader is doing but that sprite you added to the renderer wont be doing anything without it
hmm still same problem though.
No error but the tilemap still is rendering wrong?
sry still waiting for the possible errors... first startup after branch change takes ages... iteration speed sucks right now.
Yea, im on a bare bones project so all changes measure in 2 seconds or less compiling. It's so nice
Have you set up the assembly definition files so the entire project doesnt need to be recompiled if one part of it changes?
yes alot. dont wanna know what it would be like without them rofl
so no errors or warnings anymore. still not rendering
ill check the frame debugger if i find sth
Did you hook the texture with the main tex to anything?
I doubt it'll help, frame debugger pre-2022 changes is pretty bad
no i didnt
It should be hooked onto something, is there anything inside the shader graph that is requesting a default texture?
Yes
it only controls the alpha of the generated noise
If that is what the sprite you placed into the sprite renderer is suppose to do, that is what you want
the sprite inside the sprite renderer will be placed into the texture you label as _MainTex in the reference name. So change the one that is intended for that.
If the sprite is an alpha map, thats the texture you want. If it's a normal map or color map, change the appropriate texture.
im getting so confused now. my understanding would be that this is the maintex
but it is not used in the shader at all
still it somehow got drawn when it was a gameobject?
Alright, the main tex then isnt being used at all then. That isnt being drawn so undo everything as you can safely ignore that error
the framedebugger shows the shader:
but it doesnt render anything obviously
thats how it looks after the change of the alpha texture referenc
e
That grass block is not rendering?
so its sth about that main tex attribute
yes it didnt render at all. now after i changed the alpha texture to the main tex the same drawcall produces this black ground
Find the texture named Texture2D_[stuff] and replace it with _MainTex
Spitballing here, i dont exactly know what's going on here
didnt change anything. thats supposed to be the shadow texture based on the name in the graph
i really appreciate your spit though
are you sure it's a world position issue?
What makes you think it's that?
no now i think its a maintex thing
short of going step by step through the shader, i dont know what to do
i really dont understand the shader anymore. can i somehow render that noise pattern to the maintexture property first and then output it?
how is the texture even being rendered? You mentioned tilemap earlier.
grass_top is the object that is not rendering. IMO its just a gameobject pinned to a tilemap location. doesnt use tilemap renderer. it gets converted to an entity just like normal gameobjects
grass top is instanced? Is there a post processing effect that does it?
sry im not sure whether it is instanced or not. no post processing afaik
where do i check if it is instanced? frame debugger?
yea, it can say instanced in the draw mesh area
or you can check the rendering features list
Is there a post processing feature that is doing something to that object?
its not instanced. its batched. 3 draw calls for the whole screen atm.
i cant find any
hrm, does just one tile render, disconnect anything that is handling duplicating it to fill the screen with it
dont know if artist did hide some somewhere though
there is nothing handling it. its all seperate objects atm (its bad but it evolved from tilemaps to this...)
there is worldgen comming so that wont be an issue in the long run.
oh hrm... what happens if you completely disconnect the shader on grass top and replace it with a solid color
does it render a solid color
ill try. but it most likely will work. since the shader rendered black on the right positions when i changed the AlphaTex to MainTex
changed the shader of that one tile.
and the intended is having that green grass generated from the noise map instead of white?
yes i dont think the main texture is needed at all because the edge is already rendered by the grass_bottom
hrm, then there's something broken inside the grass texture generation then
so the main texture is actually just plain white and some noise on top
try individually hooking up each part of the shader to the output. If it doesnt look right, you found the problem
holy shit, i just spent the past 4 hours debugging my own shader and finally fixed it
Forgot to indicate a keyword in the compiling of it. My god
it's my own shader made from scratch by my own sweat and blood and it still took 4 hours
shader code looks so hard to me. ill probably never dive into it :S
it's a lot like DOTS code if you remove any ability to debug it.
but you dont need to recompile if you change it, it hot reloads
yes i can now somehow read it quite fine but writing it is sth diffrent
ECS really helped getting into the mindset
it's like a IJobEntityBatch struct. vertex shader contains per chunk code and fragment is per entity
except now you do it per vertex and per pixel
And you pack everything into tex coords for data needed in pixel code
issue comes from matrix transformation. Real pain debugging that
thats a really good explanation.
v2f
SV_
Who comes up with those names?
Vertex 2 fragment
What does that mean
It's the data you pass from the vertex stage to fragment stage
microsoft
pixel
Oh right
Isn't it called a pixel shader in GLSL?
I think I read something like that
same as microsoft, they call it a pixel shader as well in the docs but fragment apparently due to ancient tradition
Ok apparently a fragment may or may not be a pixel
I think it's fragment in opengl and pixel nearly everywhere else
You're right: https://docs.microsoft.com/en-us/windows/uwp/gaming/glsl-to-hlsl-reference#comparing-opengl-es-20-with-direct3d-11
Unity uses HLSL variable declaration yet GLSL samplers and naming. I dont know anymore
they use ShaderLab syntax for declaration
and HLSL for actual code part
Also, while we're talking of shaders:
Unity.Transforms.LocalToWorld.Value is a float4x4, yet it seems that it could be a float3x4 as I can't find any usage of the w component of any of its float4 columns.
Is it a float4x4 to make interoperability with rendering code easier as there seem to only be square matrix types in HLSL and probably also in everything else in the GPU world?
The W is used. The local to world inside shaders are actually the C#'s local to world transposed. It should actually be float4x3
It's float4x4 because of that transpose without needing a new variable type.
But 4x3 is 3 columns and 4 rows
3x4 then. Matches hlsl docs
Whatever the local to world TRS in C#, it's transposed to become the unity_LocalToWorld variable in shaders to obtain world position.
Not quite, the TRS has fillers for the W value.
That is identical to what I'm doing in that matrix generation (skipping rotation).
and in 2D, hence position is only a float2 instead of float3
But are they ever accessed after assignment?
the W value? Well yes, that 1.0f following the translation / position assignment is important.
it does something, setting it to 0 results in nothing getting rendered
Well, you need to pack in translation into the matrix as well.
vectors are float4s?
What does that have to do with anything? Quaternions are float4 for example
But quaternions are different
They're not a vector in 3D space
translated to a 3x3 rotation matrix, he's proposing that translation can be an extra column or row below it.
I read that they're 4 independent rotations
Was just using an example why size doesn't translate to space
It's 4x4 for matrix operations
i think the question is why TRS matrix is a 4x4, and not a 3x4
@robust scaffold thanks again for helping. i got it to render. it was indeed the maintex issue.
nice
I'm asking why LocalToWorld.Value is 4 columns and 4 lines and not 4 columns and 3 lines
If vector was instead a float3, a 3x4 can be multiplied with vector to obtain world position
vertex
You can't multiple a 3x4 matrix together
oh yea, MVP and such
Oh right
I'm trying to port a project to Entities 0.51 under 2021.3.4f1.
Running into lots of 'Unity.Entities.Editor' errors/missing namespace.
Already try to downgrade a few dependencies and fix some of them, but can't find anything for Packages/com.unity.entities/Unity.Entities.Editor
I tried to clear the cache, but that doesn't work either
Does anyone know a solution?
Upgrading major versions is very tricky. Honestly, it might be better to create a completely new project in 2021 then port over scripts one at a time
Damn, since that package manager came out, it's a mess!
I'm good to start a new repo.
It's not even a major upgrade, it was a 2021 project in 0.17 that I'm upgrading to 2021 to entities 0.51
oh, try restarting the editor?
oh upgrading from 0.17 to 0.50 (0.51) is a bit of a pain
have you checked out the upgrade guide at a bare minimum?
Editor for entities was rolled into Entities itself, dont need it anymore as a separate package
yeah its com.unity.dots.editor or something though and what he's highlighting seems to be regular entity package so bit confusing
maybe its a conflict? in which case yeah definitely remove the old editor package
it's definitely a conflict with** com.unity.dots.editor**
I have modified the manifest.json and packages-lock.json while deleting the packages, but so far without success
Is my approach the right one?
Search for namespaces in old APIs, downgrade some packages and cross my fingers.
I don't see any attention given to make sure that the dependencies work together.
Just manifest.json is enough. can you screenshot/post what you have in that file??
{
"dependencies": {
"com.unity.2d.animation": "7.0.6",
"com.unity.2d.common": "6.0.3",
"com.unity.2d.psdimporter": "6.0.4",
"com.unity.2d.sprite": "1.0.0",
"com.unity.2d.spriteshape": "7.0.4",
"com.unity.2d.tilemap": "1.0.0",
"com.unity.2d.tilemap.extras": "3.0.2",
"com.unity.burst": "1.8.0-pre.1",
"com.unity.entities": "0.51.0-preview.32",
"com.unity.ide.rider": "3.0.14",
"com.unity.render-pipelines.universal": "12.1.7",
"com.unity.modules.animation": "1.0.0",
"com.unity.modules.imageconversion": "1.0.0",
"com.unity.modules.physics": "1.0.0",
"com.unity.modules.physics2d": "1.0.0",
"com.unity.modules.screencapture": "1.0.0",
"com.unity.modules.tilemap": "1.0.0"
}
}```
That's my manifest. 2021.3 LTS for a 2D
"com.unity.burst": "1.8.0-pre.1",
highly recommend using 1.7.2 over this
i love cutting myself
indeed I'm using "com.unity.burst": "1.8.0-pre.1"
yea, I noticed. I just restart editor every time. Reminds me of 1.7.1 burst eh
will try with 1.7.2
invalid cache isn't fixed by editor restart
only by deleting your burst cache
oh, oof
burst thinks it's up to date but compiles old version
i only got 1 burst job right now thats running so havent noticed anything wrong. Might as well downgrade then
ever make a code change and it isn't reflected? or it throws an exception that shouldn't be possible
yeah thats the cache bug
took me like 8 hours to get a reliable repo and then unity 3 weeks to fix it
was a huge pain
oh wow, you much better coder than me
lets just say
our build machines were failing 10% of the time
switching branches and breaking our workflow really badly
wow
imagine running code checks before merging. I just force push to the repo every time
switching branches to run unit tests burst would not always detect a job has changed
and maybe a component changed sizes
anyway if you only have 1 job you probably won't run into issues
and 1.8 will be out before you probably do
but anyone else who has a lot of jobs and ever had funky burst things happen, yeah that's probably why
was it in earlier versions too?
yes
i believe ~1.6.5+
at least we didnt notice it in 1.6.4 but did in 1.6.6 (never tried 1.6.5)
im on 1.6.6 and had some stupid stuff happening. had to clear caches a few times cause i couldnt locate the error
yeah thats 99% the cache bug
1 more reason to go to 2021 asap
you can upgrade on 2020.3
I believe 1.7.2 is available for 2019 and above
Fixed a really convoluted bug that could manifest in Burst returning out of date cached libraries, which would manifest as random exceptions in Burst jobs/function-pointers (users deleting the BurstCache would workaround the bug).
it's this specific change log in 1.7.2 so look out for it in 1.8~
Still got The type or namespace name 'DOTSEditorWindow' could not be found
thanks
I had missed the line with the solution, Discord is not really my cup of tea 😇
@rotund token you did help me out with generic systems once. i still have a screenshot on how you make burst register the generic jobs 🙂 again thanks for that! however my need is such that i cannot know which Concrete Type is used in the implementation. It is defined in a graph in editor. So i cannot write a concrete instance of a generic system to register the job. and i also cannot register the job via assembly attribute because again i dont know which implementation will be chosen in the graph.
I have a working solution but it seems to block me from using IJobEntityBatch. I have to use IJobFor and do manual chunk iteration.
- question: is manual chunk iteration much worse? does unity do some neat stuff in IJobEntityBatch? (i dont need batching. chunk granularity is fine)
- question: is there some other way to get IJEB-jobs to register?
- question: is manual chunk iteration much worse? does unity do some neat
stuff in IJobEntityBatch? (i dont need batching. chunk granularity is fine)
all IJobEntitybatch is doing is manual chunk iteration under the hood
- question: is there some other way to get IJEB-jobs to register?
i don't really understand why IJobFor would work and IJEB wouldn't?
welcome to unity discord code deletion
remove all indents and it seems to work for me
umm what 0.o
anyway i did read it, i have no idea how/why that is burst compiling
thats the thing that scares me. if id change it to IJobChunk it wouldnt work
burst would complain
yeah i dont see why burst would compile that as a ijobfor either
what version of burst are you on?
is it still 1.6.x?
1.6.6
can you upgrade to 1.7.2
and test it
i suspect burst will tell you it's not compiled
if it breaks im fucked
i suspect it's editor only compiled which 1.7.x will no longer do
1.7 goes through same path for editor and builds now
if it breaks id need to codegen everything...
atm i dont have to compile my graph into some code. i can just convert some scriptable objects which contain codegened Icomponentdata type references
Maybe thats why my iterationtimes are so atrocious
Cause burst somehow really scans whole assembly for generics
im not a fan of codegen in general
hence why i avoided it completely for my ai/graph
me neither. but i wouldnt know how to solve it without codegen if i couldnt make generic systems without knowing types beforehand
using Unity.Entities;
using UnityEngine;
[assembly: RegisterGenericComponentType(typeof(Consideration<#CLASSNAME#PointData>))]
[CreateAssetMenu(fileName = "#CLASSNAME#.asset", menuName = "UtilityAI/PointGenerator/#CLASSNAME#")]
public class #CLASSNAME# : PointGeneratorScrObj
{
public override Type GetComponentType => typeof(Consideration<#CLASSNAME#PointData>);
}
public struct #CLASSNAME#PointData: IComponentData { }```
this is basically all im letting my designer generate. The Type is then used in MakeGeneric to create an instance of a Generic System
no issues il2cpp?
scripting backend is on mono in editor. Il2cpp builds did work if i remember correctly.
well editor is always mono
just wondering about il2cpp builds - the only thing that seems to have more issues with generics than burst 😬
ah i wasnt sure if entities changed that somehow
atm i cant build. my artist is still converting his stuff to subscenes conversion. when thats done it'll be the first time ill do sth with build configs.
since i heard you need to use build config asset if you use subscenes
you do
hmm how do you people handle the case with lineOfSight and lineOfFire. if the projectile to shoot has a width then a raycast to check LOS would not be enough to avoid the Projectile hitting corners. Collidercasting against all enemies seems expensive though. first check LOS then LOF?
a lot of times projectiles just don't have width
when they do, i don't think a sphere cast is going to break the bank in most games
in theory i could have some hundred spherecasts in a frame. probably fine but i wonder if i should first filter out the enemies i dont even hit with raycasts
it really depends on the granularity you care about
you could just use 4 raycasts if you projectiles radius is less than the thinnest collider you have
oh thats a nice trick to keep in mind (im in 2D Topdown so 2 is enough). but my current game has some bigger "projectiles"
Just noticed they've added SetName to command buffer, don't think it used to be possible
i think was only possible on EntityManager
Be nice if it auto-named all gameobjects and children when it converted to prefab inside an authoring component / subscene
just for debug purposes
I believe set name uses burst discard?
Taking a crack at singleton. Getting this error:
InvalidOperationException: SetSingleton<NumTacs.GameBoard.GameBoardData>() requires that exactly one NumTacs.GameBoard.GameBoardData exist that match this query, but there are 0.
I'm SetSingleton(boardData) on authoring during Convert call. And in OnStartRunning trying to cache GetSingletonEntity<GameBoardData>().
Error fires during Convert.
I'm SetSingleton(boardData) on authoring during Convert call
is that actually doing anything?
And in OnStartRunning trying to cache GetSingletonEntity<GameBoardData>().
where are you loading your converted data from?
if it's a subscene they load async so there is no guarantee it'll be loaded first frame (it won't be)
it doesn't throw any complaints, like if you use Debug.Log without using WithoutBurst
in better news
you can turn off this crap now with DOTS_DISABLE_DEBUG_NAMES
names are actually available in builds now
you have to turn them off
[0.19.0] - 2021-03-15
- Names assigned to entities are now available by default in all builds, not just within the Editor. To strip Entity debug names from builds, define
DOTS_DISABLE_DEBUG_NAMESin your project's build configuration.
Oh turns out if I just have one entity that runs in the conversion, the System GetSingleton will get it even if I never SetSingleton! Nice.
obviously strings are not great, i guess it adds overhead really
normally i use #if UNITY_EDITOR when using SetName, but that was previously, when using EntityManager
i'm pretty alone in this but i think any use of setname leads you down a bad path
its an obvious sign you're not thinking about things as data, but as objects still
anyway, it'd be nice if it gave the option to auto-name gameobj hierarchies during conversion for debug
well yes and no
if you have a complex hierarchy, it's a thousand times quicker and easier to deal with at the early stages when names are visible
i haven't used setname in over 2 years and not once have i thought this would be useful
one prefab i have for example is like 30 entities, all with the same name Entity(3:23) etc
not useful
that's because you enjoy pain 😛
thats like the complete opposite of what I do
i spend most of time writing tools to reduce pain for development
well say for example, you have a complex hierarchy, with joints and various other components..
and you're trying to figure out, okay how did ecs handle the conversion..
how and what did it unparent, which entities are joints and which are meshes, which are connectors ( those additional entities that physics joints create ) etc
it's a mess, if all you have are a list of entities
So here's my prefab:
Here's the dots representation of that:
which entities are joints and which are meshes
the components tell you that - not the name
anyway as I said, i'm somewhat alone in this opinion
yeah i mean i totally get it, the whole idea is to move towards sequential data layouts and away from the comforts of traditional hierarchies etc.. i do like the option during authoring/debug tho, for stuff like this
Now I want you to stop naming prefabs and look them up by component type instead. 😜
you mean gameobject prefabs?
apart from that is in object world, i pretty much never lookup prefabs / config by name
we have 3,624 prefabs in the project
there's no way i can remember the name of them
especially if someone else named them
we have 10,244 scriptable objects
nearly always search via data t:X
etc
search window is great for this
hehe 😄 I get your point. I just don't see any downside of naming something so why even take a stance against it?
or that it leads down a bad path. i can't think of any negative effects really.
It's perception - if I see SetName throughout someone's code I do not think someone has switched from thinking in object to a more data focused design focus yet.
Let's say I'm looking at a code sample from a resume for a potential candidate and throughout I see the use of SetName.
What I'm now thinking is there is a good chance we'll need to provide a few extra months of training to get them comfortable with data driven design.
Now would I not hire someone because of SetName? Of course not. It's a note I'll make and bring up in an interview. They don't know it but they're already on the backfoot 🙂
That and SetName is mostly used with runtime entity creation which is generally bad.
i dunno man, that's really judgemental. like you can't know just from that if someone needs training. like my enemies and player have the same spellcaster entity. filtering that is impossible through components alone. am I better now because I use tags instead of a name? and AFAIK SetName is removed from builds so what does it matter if the editor has more meta data that someone can find useful?
I tried SetName when trying to figure out the stupid collider baking stuff but SetName only works out of the box in like specific instances and its just a massive pain in the ass more than anything XD
🤷♂️ everyone has biases, I just try to be aware of mine.
You'd be better off adding tag components imo
AFAIK SetName is removed from builds so what does it matter if the editor has more meta data that someone can find useful?
it's not
fyi, I don't use setname 🙂 i just don't judge
^
ok, that's really dumb. why would I need names in builds?
does the entity hierarchy inspector even work for builds? i never tested this
why? to have 2 different archetypes that are essentially the same?
superfluous tagging is even worse than setname because that can't be fixed with a simple compiler directive
I have nothing against people using SetName.
I just find that its usually not worth the effort, at least for me.
When I'm looking for things that are more OO-like, e.g. Player entity is a big one, or singletons, then usually they have a tag anyway so they can be queried.
So I just search for that instead of giving them a name.
I'd prefer if there was an option to SetName automatically at runtime in playmode but I dunno how that'd work
I use names to know which entity to click on in the DOTS Hierarchy window
Is it possible to add types (IComponentData and Systems) during runtime?
Wat? You mean dynamically compile C# code?
Yeah, exactly
Umm, I don't think so... It's definitely not something that's intentionally supported by Unity.
There is a package here that supports Roslyn https://assetstore.unity.com/packages/tools/integration/roslyn-c-runtime-compiler-142753#description if thats what you're after.
Has nothing to do with DOTS though and it has platform limitations.
Yeah, thats the package I'm using. I'm not worried about the compilation part, more like getting the types into the system update loop for example
It will be very silly if I can just do the normal .AddSystem() or whatever
mmm, it should work that way, but I have no idea how if it'll work with burst.
This is more of a compiler specific question, I'd recommend asking the guys on the Burst forum, if anyone knows, they'll know.
But seems like you're in "try it and find out" territory with that one lol
Yeah for real. Good point about Burst I bet thats probably not possible with the asset you linked. Well I'll report back
does calling a method through an interface hide the functions behind the interface from burst compiling?
I dont think it should but im not certain my funcions are burst compiled. cant find them in the inspector
its all bursted or it's not
if whatever is calling it is burst compiled your method is burst compiled
otherwise it's not
unless you're talking about function pointer calls?
no i am talking about a Processor struct with methods inside which i call from a burstcompiled job. i just cant find the job in the burstinspector.
rider tells me its burstcompiled though
(but it doest tell me that the functions inside the Processor are burstcompiled)
anything you call from a burst compiled job will be burst compiled
you can't find the job in the burst inspector?
i cant. neither can i find any of my AI jobs. basically all my Systems with Generics dont show up i think
that would imply burst isn't compiling them =S
but its shown as burstcompiled in profiler at runtime
in editor or build?
did you try 1.7.2 yet? it has much better detection of this stuff
both
no i didnt. ill upgrade in the next few days but have to merge together a few branches first. cant right now
not suggesting you stick with it
just to install it to see if it pumps you any warnings
true. guess ill try
Compilation was requested for method ... but it is not a known Burst entry point. This may be because the [BurstCompile] method is defined in a generic class, and the generic class is not instantiated with concrete types anywhere in your code.
Thats the warning i get starting the game in editor now
My whole architecture is doomed... damn it
thats what i'm curious about
aren't you code gening this?
can't you just code gen the attribute for burst as well?
(i only saw your job code for like 3 seconds before discord deleted it so this is from memory of that)
id need to codegen the attribute based on how the designer authored the graph
just generate every combination then?
far too many possible :S
oops sry no answer to your comment
I have discovered I need the 2022 batch rendering group API. And I also need entities. Has anyone tried 0.17 with 2022.2 alpha?
Code gen in 0.50 is nice but I can write my own jobs manually. I could roll my own ECS with a pile of native arrays but I really need to refamilarlize myself with DOTS. Does 0.17 compile?
The weirdest thing about this is that in burst 1.6.6. it worked. it was burst compiled and in 1.7.2 it isnt anymore
you really need to check in builds it works with 1.6.6
i know you say it does
but i don't see why it would =S
entities works in 2022.1, i believe it would work in 2022.2
(with small changes)
but yeah other packages wont work (hybrid renderer in particular)
im sure it did. i profiled it in a build
but i dont think you care
but yeah the batch api is what i was talking about the other day for you - probably made no sense what i was saying if you weren't aware of it
then just generate them on need
anytime you encounter a new one while playing in editor just generate it
i love that idea. i dont want to traverse the graph whenever the designer changes sth and generate all needed combinations. your way sounds way less overhead
Yea. I spent the day looking into it and how it works. Suddenly I don't think I can continue without it. It's time for my lighting system V3.
Because currently small object meshes must me merged with a global shadow caster mesh and then that must be reuploaded to the GPU every frame since the positions of the vertices must change. If I can instead use the batch rendering group to instead do so, that will be revolutionary
yeah it looks fantastic. i haven't played with it much except to understand how to utilize it due to being stuck on lower versions.
it's nice to feel like there's something to look forward to though when it comes to rendering because it seemed like unity was slipping a bit
no indents manarz 😄
oh man even really short snippets are deleted. i though only for long ones i need to care
copy into notepad, shift tab shift tab, a few times
I generate needed instances of Systems in a Factory in Conversion. Basically this:
sysType = typeof(ConsiderationSys<,,,,,,,>);
constructedClass = sysType.MakeGenericType(considerationType, parentOutputType,
axis[0].componentTypeRef.GetComponentType,
axis[1].componentTypeRef.GetComponentType,
axis[2].componentTypeRef.GetComponentType,
axis[3].componentTypeRef.GetComponentType,
axis[4].componentTypeRef.GetComponentType,
axis[5].componentTypeRef.GetComponentType
);```
should be enough to codegen those systems right there
there you go
phew. way easier fix than i expected. thank you so much
there was a thread somewhere explaining why unity decided to not let burst resolve the generics itself. it was something about having to traverse the whole codebase and finding all possible concrete types. i dont know enough about compilers for it to make much of it. i wonder if that is what burst actually somehow did in 1.6.6 for me. I have (had?) reaaaaally slow compile times
is it possible to retrieve the entities created from joint components during conversion ( ie inside Convert )?
for example trying this returns the gameobject entity not the entity generated from the joint component:
Debug.Log("JOINT = " + conversionSystem.GetPrimaryEntity(t.GetComponent<Joint>()));
i guess i'll have to work around it
can you just query it in destination world?
i guess it depends what you're trying to do with it
basically i'm just creating a component, which stores an array of each 'bone' entity, and the corresponding joint entity
so it's kindof easier to do that during prefab conversion
i can do it with some logic, for example for each bone, loop through all joint entities and find the one that references that bone entity inside it's Physics Body Constrained Pair component.. but it could be cleaner/easier to just directly grab the primary entity if that was possible
ive been messing around with the dof limit joints thing, and i cannot get it to work, no matter what i try, as such im wondering would it be ok if i just set the rotation and position to be whatever i want it to be
or will the physics engine not like that, or will it be bad for performance?
i remember reading that it's possible to emulate what config joints to with drive and TargetRotation by basically setting/updating the low/high limits on the physics joints Constrained Axis structs, if that's what you mean
i dont know what that means im afraid
Regards just having a good conversion from joint to physics joint, it seems to work for me ok
what im attempting to do is recreate rigid body constraints, which according to the dots manual and samples, should be using a dof limit thing, that wont work for who knows why
alright so what have you tried so far
dof limits used in the sample scene, someones custom designed dof limit, a mod of the sample scene, a mod of the mod of the sample scene one,
so far none work
either i get weird errors, or they just dont do anything, currently im gonna try just brute forcing the rotation and position every frame to be what i want, cause it seems to be the only option that has a chance of working
sorry if i sound a bit upset, i tend to get fustrated at the lack of info about dots stuff
the joints do work, maybe you need to do some testing with a really simple setup
it's cool, it can be frustrating, but it's possible
my setup is a cube, that i want to rotate in the z axis, and cant move, and cant rotate any other ways, dont think i can get simpler
agreed
are you using a gameobject with ConvertToEntity ticked yeah?
what?
( or building entirely from code )
could you do a simple step-by-step of what your game is doing when you hit Play
to do with the cube currently, nothing
ie 1 - Instantiate(myPrefab) etc etc
oh ok
it istantiates a bunch of spheres, which hit the cube eventually
the cube should rotate, in a similer fashion a gear would,
usually i would use rigidbody constraints, and while im converting to dots, im trying to get the same thing to happen basically, but constraints seem to be a whole lot harder to do and to get information about in dots
what method are you using to convert the spheres and cube to dots
the component
although the spheres get instantiated once the prefab is converted to dots
which component do you mean
the entity component
i know there is some fancy method with subscenes, but only a few parts of my game need dots, so for now im just manually dragging on the component when it is required
could u show which entity component i'm not really sure what u mean tbh
Ahh sorry ok
its ok lol
could you show what your cube looks like, the components that are on it
joints and whatever
well when i said cube, i didnt want it to seem to fancy, it is kinda 4 cubes combined to look like a gear, but hopefully that shouldnt affect it, and ye ill send the screenshot
here's literally a one minute setup showing a sphere falling and hitting a cube, which has a fixed position free rotation joint on it:
https://gyazo.com/7f3414759f8f644214937313b77fe663
here are the screenshots, and thank you i shall try that out
link pls?
ok
so what to do with your setup is:
oh ok
remove all the convert to entity components and the physics shapes
and physics bodies
ok
select all the spokes of the cog, and just apply BoxCollider to them all
the parent object, apply a Rigidbody component
ok
add a ConfigurableJoint to the parent
ok
Set it like this:
basically just zero out the Anchor values, and set those Locked/Free fields
wait
oh?
also click ConvertToEntity at the top of your parent:
oh ok, guessing that is like a simpler way of converting it without using the component?
ok thanks, ill try all that and report back!
alright
yas it works! i have gears now and they spin so nicely!!!!
and i even skipped one of your steps cause i had a feeling i could get away without it, and i was right i could, surprisingly
nice
yup it looks exactly like that thanks so much!
probably change from Free to Fixed on the axis you don't want to spin, i figured you'd work that out
yup i did lol
@robust scaffold I need to make a correction to the fix of yesterday. The main problem with the shader was the alpha channel. the UV coordinates of the alpha texture where fucked up because the texture was packed in a sprite atlas. thus everything got transparent. in my chaotic debugging it seems like i randomly changed the alpha texture to an unpacked one and thought it was the maintex making the diffrence.
This is a related Bugreport: https://issuetracker.unity3d.com/issues/shader-graph-uv-node-uses-whole-sprite-atlas-uvs-instead-of-individual-sprite-when-entering-the-play-mode
Weird design choice TBH
How to reproduce: 1. Open the attached project's Scene labeled "Main" 2. Observe the Sprite Atlas animated Sprite 3. Enter the Play ...
sry for ping but this seems good to know about
I still dont get why it worked for gameobjects though
Huh, good to know. I actually use Sprites so this might come up for me.
This is using sprite atlas v2 right?
i used V1. but since Unity stated it is by design i assume V2 behaves the same
not sure what blocked me from using V2. maybe i should switch too
anyone encountered this error when updating to 2021 and entities 0.51? :
(0,0): Burst error BC1310: The pointer arguments may alias with each other where it was expected that they do not alias.
While compiling job:
Unity.Entities.JobEntityBatchExtensions+JobEntityBatchProducer`1[[Unity.Entities.Tests.EcsTestSetComponentValueTo10, Unity.Entities.Tests, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]], Unity.Entities, Version=0.0.0.0, Culture=neutral,.....
restart unity and if it still exists, uhhh
it shouldnt
it does 😦
im using the apple silicon editor version so that might be why nobody else encountered it yet
no idea if that could lead to different aliasing logic than the normal Editor
2022 has a new loading screen:
There was several changes to fix burst compiling on apple devices in 1.7.2 and 1.8.0, dont know if they had them both.
im on 1.7.2 since tertle said they fixed the burst cache error only on this version
why are you on 2022 now 😮 always one step ahead of compatability? 😄
as mentioned yesterday, i need the batch renderer group experimental API in 2022. I need to efficiently render small object shadows without having to constantly rebuild my shadow caster mesh.
ah i see. how much is broken in 2022?
well, lets see
ah first time opening it? good luck!
i know the source generator definitely wont work so i'll need to toggle it off
come on bot
well, 0.51 doesnt work
😦
well it was a long shot, i guess i have to stick with 0.17 with a fixed job package
i hope it wont take ages to get entites back to newest official releases... i fear its after 1.0
0.51 seems kind of borked, pretty sure they said they pushed it out too early
It works though?
I don't think so, it had a ton of issues. I guess it depends on the project
I dont see anything wrong with it... i only had 1 system and 1 job.
u sure you dont wanna find another solution to the shadow problem instead?
ah ok 😄
Nah, Entities will take months to years to catch up to 2022. I aint waiting around for that.
Why do you need 2022 support?
batch renderer group
Huh, jobs at least compiles in 2022
fuck, no
yea, jobs uses some code gen internally and that is borked in 2022. Shame
I thought I remembered reading something about it having some issues, is it safe to upgrade then?
oh well, i guess i'll roll with IJob and IJP
https://forum.unity.com/threads/experimental-entities-0-51-for-unity-2021-is-available.1296198/
IL2CPP doesnt work and changes to code gen'ed scripts might require closing unity, deleting the code gen folder in the cache, and restarting
I've had the code gen issue myself occasionally. And I just toggled the project to use mono.
otherwise it works pretty well
Do mono builds works for ECS? I thought I remember reading ages ago it doesn't work
Never checked again
it works, just not as "fast" as il2cpp. Mono will always be rock solid in terms of stability. Just not the fastest
I'm probably confusing it with something else then
stupid maths question:
how do i do Quaternion.Inverse, but in dots
lower case 'quaternion' doesn't have inverse
when i look up stuff i normally take for granted, like 'find the inverse of a quaternion':
go to the method declaration and then copy paste?
how do i do that?
I don't think that part is open sourced
i just get a stub from metadata when i 'go to declaration' in VS
hrmmmmmm, nothing is rendering for me in 2022 for a empty project with a single quad.
the camera though works, just not scene view
Oof, guess not
Convert from lowercase quat to uppercase, use this method, then convert back to lowercase
there not be some drawbacks to that over using pure math or Unity.Mathematics?
the cast from lower to upper and back again might result in non-vectorizable code. Check the inspector.
Depending on how they're packed in the struct
This is fun. I have to basically turn off urp, make any scene changes, then turn it back on and i have no clue why
what if you switch to 3d view?
URP off
BRG doesnt seem to actually depend on a rendering system. So I might just stick with built in for now
Yea, no issue with building and running
The scene view camera is just fucked. Fun
It's the universes way of telling you to go back to 2021 and continue your journey fixing the dots thing 😛
i refuse
between a rock and a hard place
Are your performance requirements that tough that you need the new API?
no, but i like looking at my per frame player loop times
well kinda, there's a current performance limit of 500 lights on a single view screen currently, which is sad.
The limit is 8000. 500 is not even anywhere close to it
That's why I only ever go for 499 lights in my design, so I have room for 1 more in case I need it
i want at least 2000 while maintaining 60fps rendered at once to camera
That's a lot of lights
there can be many more just not in view
i want a bullet hell like game with every single projectile is a light renderer
So a light hell game, I dig it
this is with pixel perfect circles. If i reduce the rendering resolution to 1/10 the dimensions (so 100x less pixels rendered), i can maintain about 8,000 light sources on the screen at 350fps. But I want full screen resolution lighting
clearly, improvements are required
a shot in the dark here but i don't suppose using VFXGraph particles would circumvent the limit no?
I believe particles are just cookie overlays on main camera texture that dont use depth textures. The lighting depth texture generation isnt the issue, it's the rendering with shadow blockers that takes so much performance.
if there was no shadow blockers and it was just a direct application of a spherical light into the camera, 8000 lights can render at 350 fps as well no issue
none of those lights reach a shadow caster so it renders CPU limited
pain
Found the issue for the urp renderer at least
Disable post processing. Seems to break the scene view
just realized Unity.Mathematics.math.inverse() does this
same with math.mul() for multiplying quaternions ( or float4x4 etc )
i had written this but not really sure if it was fully 'correct':
Has dots any workaround for using inherited authorings inside ConversionSystem? Say i have BaseAuthoring and two inheritors, so i want to write ConversionSystem which will work with any inheritor.
@covert lagoon Shaders actually pull float3x4s for local to world and similar matrices that are populated into 4x4 slots on the GPU.
Im digging deep into the rendering engine
Local to world scalar matrices are converted first to float3x4s (equivalent packed structs) then sent to the GPU
At least SRP shaders do so.
can't you just write an authoring component as a base, and then others that inherit from it, or is that not what you mean
it exactly what i do. But also i have GameObjectConversionSystem that wants to work with base component (with all inheritors generically). But i can't use abstract classes/interfaces with lambda ForEach, so i see only possibility is to duplicate or inherit conversion system
you can use generics in jobs
there is no jobs in use in conversion systems
i mean it can be, if you handle huge amount of data, but those system mostly works with gameobjects and theirs monos
can't you have authoring component
with virtual Convert?
No. there is a need to work with query, not individual entities. All simple conversion i keep in IConvertGameObjectToEntity comps or just [GenerateAuthoringComponent]
other scary thing you could try: reflections xD
you do query through Transform component to get literally all convertable objects
Last thing i want to do, because there are tons of reflection use in my project lol 🙂