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
1
Question by sanathshekar · Dec 15, 2016 at 08:23 AM · texturecharactercontrollertexture2dreadpixelsreading data

Reading Negative Values from EXR texture format

Hi All,

So I have an EXR texture file with different color values stored in each pixel. Now some of these values are negative values also (e.g. -0.03, 1, -3.123). When I try accessing these values in Unity C#, I use the Texture2D.GetPixel() method and store it in a Color datatype variable. However, when I try printing out the values from each pixel, there are no negative values. All values are clamped to between 0 and 1. When I tried Color32 datatype, the values are clamped from 0 to 255. The color values (RGB) are used for position (XYZ). So having all positive is a big issue.

It is not possible for me to normalize my pixel values to between 0 and 1 because to do so I must have a fixed minimum and a fixed maximum value. Unfortunately, the pixel values change each frame and therefore it is not possible to normalize the range. And if it is possible at all, I think it will be too costly performance wise.

Now, I am certain my EXR texture holds negative value because when I imported the texture into NUKE, the color picker in Nuke is able to show the negative vector values.

How can I go about accessing the negative values of an EXR texture/image file or any image format? I am posting this after many search on google and the forums. These are some of the posts by others having similar queries but I am not able to progress further with these...

1) http://answers.unity3d.com/questions/1220547/signed-full-precision-textures.html 2) http://answers.unity3d.com/questions/16913/reading-a-color-from-an-image.html 3) https://forum.unity3d.com/threads/negative-float-values-in-render-to-texture.199885/

I thank you guys in advance for any help rendered. I look forward to a solution that will benefit everyone who is facing similar issues.

Cheers!!

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 weatxyz · Sep 09, 2017 at 11:57 PM 0
Share

$$anonymous$$y situation is very similar to this. $$anonymous$$y texture has xyz postion data for geometry, and just like the OP has stated, only positive values are drawn.

I looked through all the above posts but none of them helped. I did find one post that said using RGBAFloat supports negative numbers, but that option doesn't exist in Unity 5.6.1 which is the version I'm on.

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

6 People are following this question.

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

Related Questions

ReadPixels returns RGBA(0,0,0,0) 0 Answers

Texture2D.ReadPixels working on Editor, but not on Build? 0 Answers

Texture.Apply() Crashes at Resolutions under 1920x1080 1 Answer

Using Screenshot as Texture 4 Answers

GUI texture to change texture when hovered over or clicked? 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