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 CgShady · Jun 23, 2012 at 12:03 AM · textureruntimesizeproceduralsubstance

Substance Dynamic Texture Size

One of the key benefits of Substances or Procedural Materials as Unity refers to them, is to be resolution independent. Now I would really appreciate if I could set the target texture size at runtime. This would let me do some math based on client CPU, GPU and Screen Size do determine how big the textures need to be.

I can't find the property in the procedural material class. Does it mean it cannot be set at runtime ? Am I missing something ?

Comment
Add comment · Show 1
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 Fattie · Jun 23, 2012 at 09:56 AM 1
Share

Claver nickname !

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Jerc · Jul 10, 2012 at 07:01 AM

You can modify the resolution at runtime using "MySubstance.SetProceduralVector("$outputsize" ,new Vector4(9,9,9,9));"

9 being actually 2^9 = 512, so 10 will be 1024, etc.

It's not documented but it's there :)

Comment
Add comment · Show 1 · 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 CgShady · Aug 19, 2012 at 04:27 PM 0
Share

I tried that. Nothing happens when I call for .SetProceduralVector("$outputsize", new Vector4(9,9,9,9)); When I query .GetProceduralVector("$outputsize");, I always get the same values as prior to trying to modify them. And, if I call for .RebuildTextures() after that, I crash Unity.

I am running Unity 3.5.5f3

Any idea ?

avatar image
0

Answer by NicolasLIATTI · Sep 21, 2012 at 12:38 PM

Hi,

You should try this:

 if (GUI.Button(new Rect(10,10,60,20), "256x256"))
 {
     ProceduralMaterial substance = renderer.sharedMaterial as ProceduralMaterial;
     if (substance)
     {
         substance.SetProceduralVector("$outputsize", new Vector4(8.0f, 8.0f, 0.0f, 0.0f));
         substance.RebuildTextures();
     }
 }
Comment
Add comment · Show 1 · 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 cjubb · Apr 17, 2013 at 11:38 AM 0
Share

You also have to make sure that "Output Size" is checked when publishing. To enable this check box you must make the Substance material's output size relative to it's parent (not absolute).

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

6 People are following this question.

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

Related Questions

Are extremely high load times for Procedural materials normal? 0 Answers

How do I animate procedural textures? 4 Answers

Substance - How do you set the random seed of procedural material at runtime 0 Answers

Assigning Textures to Terrain at Runtime 2 Answers

How does unity manage dynamic substance textures? 0 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