Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 Grekomp · Aug 14, 2018 at 01:54 PM · texturerender textureprecision

16bit Precision Custom Render Texture

Hello everyone. I have been trying to implement the Jump Flooding Algorithm in unity, using custom render textures.

The algorithm generates a texture, where each pixel contains the uv coordinates of the nearest seed pixel. It looks something like this: Generated Texture Sample

The texture I'm using is 1024x1024, so the uv coordinates stored in it have to be precise enough to map 1024 values, which makes 8bit per channel not sufficient. I have tried to change the format of the render texture to ARGB float, ARGB 64 and others, but it didn't seem to change anything.

My implementation works fine for 256x256 textures, as this is the limit for 8bit coordinates, but anything higher causes artifacts.

My question is: How can I ensure my custom render texture stores 16bit per channel, or, how to store the uv coordinates in an other way?

jumpflood02.png (61.0 kB)
Comment
Add comment · Show 4
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 RShields · Aug 15, 2018 at 04:52 AM 0
Share

I'm not sure I understand the question, but maybe you're looking for this: https://docs.unity3d.com/ScriptReference/TextureFormat.html

avatar image Grekomp · Aug 15, 2018 at 07:35 AM 0
Share

@RShields Thank you for your response. As I have written in the question, I already tried changing the format of the texture, but it doesn't seem to make any difference. I am not sure if changing the format works correctly, as the preview window always states that the texture is ARGB32.

avatar image RShields · Aug 15, 2018 at 01:43 PM 0
Share

Alright, I assumed Unity would use the texture format to format the PNG but it doesn't. Will Texture2D.EncodeToEXR work?

($$anonymous$$ake sure to use RGBAFloat)

avatar image chadiik · Oct 08, 2018 at 06:50 PM 0
Share

Without changing formats, you can't have 16bit per channel, but by using 2 channels per coordinate, yes.

You're already using 2 components to store 2D coordinates, and if not using the remaining 2, then make use of them as offset multipliers (of 256). So:

(1, 0, 0, 0) is (1, 0) + (0, 0) * 256 = (1, 0)

(1, 0, 1, 0) is (1, 0) + (1, 0) * 256 = (257, 0)

...

and (255, 255, 255, 255) is (65535, 65535), 16bit limit.

0 Replies

· Add your reply
  • Sort: 

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

117 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Texture not rendered on OnePlus One 0 Answers

Assigning UV Map to model at runtime 0 Answers

Strange texture artifacts and dithering on Android 0 Answers

How do create a readout (GUI?) on the surface of an object or plane? 1 Answer

Adding Texture on Prefab 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