Forum Discussion
Anonymous
11 years agoChanging materials in realtime
I have a script that just cycles some gameobjects (roughly 20) through different materials on key press.
In the editor the materials change instantaneously and smoothly with no lag. When I do a build and run direct to Rift, any time I change materials there is a 1 second hiccup where the screen freezes. It runs at a constant 75fps before and after switching materials. Anyone know of a workaround that might prevent this?
I thought it could be caching the materials but the lag never changes.
In the editor the materials change instantaneously and smoothly with no lag. When I do a build and run direct to Rift, any time I change materials there is a 1 second hiccup where the screen freezes. It runs at a constant 75fps before and after switching materials. Anyone know of a workaround that might prevent this?
I thought it could be caching the materials but the lag never changes.
3 Replies
Replies have been turned off for this discussion
- cyberealityGrand ChampionDoes this happen if you disable the OVR Camera and just build with a regular camera?
- BaseDeltaZeroHonored GuestIts because when you run the build it doesnt have the materials loaded into video memory yet.
you could have a frame where all materials are seen so they load into memory.
There might be a way to do this with scripting, but i havnt found a way yet - AnonymousJust wanted to post an update that this wasn't an Oculus issue. I tried adding a cube with each material to "pre-cache" the materials and that still didn't fix it. Had the same problem with a normal non-OVR build.
It was either referencing the length of my materials array every switch, or a debug.log statement at each switch, or a combination of both. After caching the array length in a variable and removing the debug.log statements there is no delay.
What was really confusing me was why it wasn't happening in the editor, which I guess may point to it being the debug.log times 30.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 5 years ago