Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 JoeD · Mar 10, 2013 at 06:17 AM · shadertexturegraphics

How to disable texture perspective correction?

Hi, I'm trying to disable(cancel) texture perspective correction, to simulate 90's game graphics. Does Unity engine has any option or any scripts way for this?

My purpose is simulation by like an early times polygon rough graphics.

SFMPE

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 BenFangiso · Aug 03, 2021 at 03:02 PM 0
Share

I'm a newbie here. I just signed up. I also want to know more about this texture perspective correction. Thank you!

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by Philipp · Mar 10, 2013 at 09:37 AM

There's no option for that, but you can undo the perspective correction in a shader, like so:

 Shader "Custom/AffineTexture" {
 Properties {
         _MainTex ("Base (RGB)", 2D) = "white" {}
     }
     SubShader {
         Tags { "RenderType"="Opaque" }
         LOD 200
         
         Pass {
         CGPROGRAM
         #pragma vertex vert
         #pragma fragment frag
         #include "UnityCG.cginc"
 
         sampler2D _MainTex;
 
         struct vertexInput {
             float4 vertex : POSITION;
             float2 texcoord : TEXCOORD0;
         };
         struct vertexOutput {
             float4 pos : SV_POSITION;
             float3 normal;
             float2 uv : TEXCOORD0;
         };
 
         vertexOutput vert(vertexInput input) // vertex shader
         {
             vertexOutput output;
             output.pos = mul(UNITY_MATRIX_MVP, input.vertex);
             output.normal = output.pos.xyz; // using normal because POSITION semantic isn't visible in fragment shader
             output.uv = input.texcoord * output.normal.z;
             return output;
         }
 
         float4 frag(vertexOutput input) : COLOR // fragment shader
         {
             return tex2D(_MainTex, input.uv/input.normal.z);
         }
 
         ENDCG
         }
     } 
 }
Comment
Add comment · Show 4 · 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 JoeD · Mar 16, 2013 at 11:02 AM 0
Share

Thanks! I'll try this soon.

avatar image Hogge · Jan 16, 2014 at 05:07 PM 0
Share

Great! I'm trying to acheive something like this for my hobby project. Do I apply this script to the camera, or to objects in the game world?

avatar image theteadrinker · May 09, 2021 at 01:50 PM 0
Share

This did not work for me at first. The normal need " : NORMAL" to compile. Also, I had to switch to using w instead of z (for texture coord mul/div), but now it seem to work as expected.

avatar image kamilkocik26 · Aug 03, 2021 at 01:09 PM 0
Share

keeps giving errors and I don't know what type of shader

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

14 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

Related Questions

Black Texture on Initial Load 1 Answer

Tracing in Unity3D 2 Answers

How can I prevent lights overlapping in intensity? 1 Answer

How to blend colors from two texture maps in VFX graph 1 Answer

GPUImage shader convert to unity3d shader 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