Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by I9ball · Aug 28, 2012 at 05:26 PM · animationmaterialproceduraljerky

Jerky Procedural Material Animation

I am trying to animate a procedural material "Electric Liquid". I was able get the material animated but the animation is jerky (looks like a "framerate" of under 10) while the frame rate in the stats window shows well above 200.

I also looked at the Procedural material animation update rate, and even that was above 40+.

I know the animation can be smooth as silk and beautiful, but how do i get it there? What am I doing wrong?

There are very few objects in the scene.

Thanks

 using UnityEngine;
 using System.Collections;
 
 public class liquidEnergyAnimC : MonoBehaviour {
 
     public ProceduralMaterial substance;
     public float flow = 1;
 
     void Start()
     {
        substance = renderer.sharedMaterial as ProceduralMaterial ;     
     }
 
     void LateUpdate()
     {   
        flow = flow + (2 * Time.smoothDeltaTime); 
        substance.SetProceduralFloat("Flow", flow);
        substance.RebuildTextures();
     }
 }
Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Banister88 · Sep 06, 2012 at 03:24 PM 0
Share

Having this same problem, did you figure it out?

avatar image I9ball · Sep 13, 2012 at 01:05 AM 0
Share

No not yet... I may need to abandon the animated texture all together. Transport portals just don't look right with static maps.

Wait a $$anonymous$$ute, do we need to pre-render the sequence of images with the procedural materials, then just run it as a normal animation? Domt really know enough about Unity to say for sure.

Let's keep each other posted if we find solutions.

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Banister88 · Sep 13, 2012 at 02:44 AM

We figured this out, for everyone interested. The reason that the animation was jerky (for us any way) was that the value that we were exposing and using (via the .SetProceduralFloat(..)) was in the beginning of our node graph in substance designer. So what happened was that we would increase/decrease the value for that float in code, then the substance generator would have to push it all the way down the render pipe, performing all the math and calculations that come with that. So, we had our artists get creative and figure out a way to move it towards the output node in substance designer. So now, that float variable is one of the last nodes to be calculated by the substance, before it outputs, making it so that most of the work is done before hand! Therefore, the texture generation is significantly faster and the animation plays very, very smooth. I'm the programmer, not the artist, so I'm not sure what kind of tricks were used in order to perform the operation later on in the graph, but that is what solved the problem. The farther a node is from the output, the more things need to be performed on this node, making it longer to generate the texture (and when moved in code, appear jerky). Hope this helps!!

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image I9ball · Sep 29, 2012 at 02:14 AM 0
Share

excellent find! appreciate the info! I'll get to work on the solution. thanks!

avatar image Stealth_vicious · May 02, 2014 at 09:58 PM 0
Share

O$$anonymous$$ i know this is and old topic, but trying to do the same thing myself, using the code above i get it to work only playing in game mode and adding the "Electric_Liquid" back into the "Substance" box. its there before i go into game play mode but gets replace by "none (Procedural $$anonymous$$aterial)" after i enter it. I'm Pretty new to working with Unity but would really like to get the to work

Edit: the console is telling me this when i enter game mode "NullReferenceException: Object reference not set to an instance of an object liquidEnergyAnimC.LateUpdate () (at Assets/liquidEnergyAnimC.cs:17)"

avatar image
0

Answer by ThermalFusion · Sep 06, 2012 at 05:28 PM

Try using RebuildTexturesImmediately function instead of RebuildTextures.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Banister88 · Sep 06, 2012 at 05:50 PM 0
Share

I've tried that, same thing.

avatar image I9ball · Sep 13, 2012 at 01:07 AM 0
Share

Yep same issue, in the case of immediate it stutters the runtime completely ins$$anonymous$$d of just the texture. :(

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

10 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Material transition through animation 3 Answers

Can I make animations snap to a frame? 1 Answer

Manual UV-Mapping of a Primitive Cube 1 Answer

Array breaking when pushing floats into it via a for loop. 2 Answers

How to create physics based animation character like in (GANG BEASTS)? 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges