Comments (9)
There is some evidence from only THIRTEEN YEARS ago that just doing a FindObjectsWithTag may not be as bad as it sounds, in practice (which would remove the state that needs to be maintained). It seems to be efficient provided you don't use tags for too many GOs, which he suggests people typically dont. Do you use tags much in your projects?
https://forum.unity.com/threads/findgameobjectswithtag-efficiency.3612/
from crest.
Ok i'm being much more sensitive to the layer situation now on latest/master. It only throws errors if the layer is missing and actually required in the scene.
I also removed the Terrain layer which renders the sea floor height - I know of at least one team that is just rendering Default layer geometry into this, and this works for the example scene, so I'm going with this too.
That means that the main scene in the example content only requires 2 layers - for the animated waves and for the foam (the ocean uses the Water layer but this is built-in and the right layer for the job).
While I think it would be possible to explore some stuff we discussed above (switching to tags for instance), I don't currently have plans to do so and don't see a very clear/easy path to doing so, and will therefore close this issue for now. If you have thoughts, let me know.
from crest.
Saw the ocean needs a layer also. That's 5 layers now.
from crest.
Yeah, this comes up now and then, theres another team in a similar situation and I'm becoming increasingly aware of the squeeze. It's a shame that the number of layers is so small, and that physics and rendering share layers. But thats the constraints we have i guess!
It's there for flexibility so you can assign the layer to whatever objects you want to render into the various data like water shape, foam, dynamic sim, etc. If you're not using any of these you can probably remove the relevant layer (i've not done a huge amount testing in this direction so it might need one or two things unpicked but it should be easy to make it work with only the layers you want/need).
However I get the point and this kind of functionality could perhaps be achieved using tags. Scriptable render pipelines may change this up as well, which is something i plan to do research into soon. I'll leave this open and post back when i have any thoughts or progress, or perhaps someone else looks at it in the meantime.
from crest.
Ya layer design sucks but I don't see it changing anytime soon.
Off the top of my head I'm thinking something like the Unity navmesh system does. Have the systems in question take a list of source objects. Be it bounds, meshes, whatever it is they actually need to know about. Then you can build whatever higher level abstractions you want. Tags seem like a good default choice there. Teams like mine would prefer to just build the collections from existing logic that we have.
from crest.
Yeah im thinking along the same lines.. In my past experience I haven't loved doing this kind of thing because theres the state to manage/update when new objects get created, and when stuff gets destroyed you dont want to hang on to references and prevent stuff getting GC'd. Or maybe im making a mountain out of a mole hill. I'll put it on my list to experiment with this stuff soon and find a nice pattern.
from crest.
I think it would involve more work then appears at first glance. It also looks like it wouldn't be too much work to just add work arounds where needed per project until a better overall solution hits. Big picture I don't see this as a show stopper for real teams.
from crest.
I mostly see tags used by third party assets. They do seem like an ok integration point assuming that in context they won't be a performance issue. And they aren't a limited resource which is a big plus.
One potential downside I guess is stuff created at runtime. And I say potential just because I have no idea of the possible issues there not having used tags in a long time.
from crest.
In preparation for a new release i've just gone through the initial setup thing with the layers and its clearly demanding layers that are not necessarily needed (like the dynamic wave sim layer even when the sim is disabled), so i'll look at addressing this.
from crest.
Related Issues (20)
- Local / movable spectrums or crest shapes HOT 3
- Foam / wake vibration when approaching whirlpools HOT 20
- Pressing the Windows Key in the editor disables underwater rendering HOT 3
- Wake / foam artifacts when moving the camera quickly HOT 11
- Delayed LOD / tile enabling when using large clipping areas HOT 5
- Depth Cache not populated - Exported Image is Black HOT 8
- Water interaction is not visible when moving camera away from the sea level HOT 1
- Underwater broken with XR multi-pass rendering HOT 1
- No caustics, no shadow data and/or constant shadowing on iOS
- Error of Does not exist some Classes. HOT 1
- Sporadic gaps / precision errors in tiles. HOT 35
- SphereWaterInteraction and RegisterDynamicWavesInput do not work correctly inside a flow area HOT 11
- Activating flow in the material when oceanrenderer is running does only work in editor HOT 2
- FindObjectsSortMode HOT 3
- Enable Shader API does not function without changing underwater appearance HOT 20
- Enable Shader API causes artifacts HOT 4
- Planar Reflections issue with non-standard shaders using transparency HOT 13
- Premature tile culling during extreme camera maneuvers above the ocean HOT 1
- Portal feature broken with Unity Recorder 360 View
- Directional lights that are not active on any layer change the color of subsurface scattering HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from crest.