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 Deathdefy · Aug 21, 2013 at 05:44 PM · shaderstrumpyfallback

Shader Fallback Windows Store App

Hey guys,

I'm currently building a game for the windows store. I have a simple shader that always calls its FallBack shader once built into a Windows Store App. The shader works excellently in the editor and also on other devices but just not as a Windows Store App.

  • I have tried changing the the shader target model from 3.0 to both 4.0 & 5.0 with no results.

Shader "Reflective/Bumped Specular" {

 Properties {
     _Color ("Main Color", Color) = (1,1,1,1)
     _SpecColor ("Specular Color", Color) = (0.5,0.5,0.5,1)
     _Shininess ("Shininess", Range (0.01, 1)) = 0.078125
     _ReflectColor ("Reflection Color", Color) = (1,1,1,0.5)
     _PatTex ("Base (RGB) RefStrGloss (A)", 2D) = "white" {}
     _Cube ("Reflection Cubemap", Cube) = "" { TexGen CubeReflect }
     _BumpMap ("Normalmap", 2D) = "bump" {}
 }
 
 SubShader {
     Tags { "RenderType"="Opaque" }
     LOD 400
     
     //CULL off
 CGPROGRAM
 #pragma surface surf BlinnPhong
 #pragma target 3.0
 
 
 sampler2D _PatTex;
 sampler2D _BumpMap;
 samplerCUBE _Cube;
 
 fixed4 _Color;
 fixed4 _ReflectColor;
 half _Shininess;
 
 struct Input {
     float2 uv_PatTex;
     float2 uv_BumpMap;
     float3 worldRefl;
     INTERNAL_DATA
 };
 
 void surf (Input IN, inout SurfaceOutput o) {
     fixed4 tex = tex2D(_PatTex, IN.uv_PatTex);           
        
        o.Albedo = lerp(_ReflectColor, tex.rgb, tex.a ).rgb;
        
        tex.a = 1.0f;
     o.Gloss = tex.a;
     o.Specular = _Shininess;
     
     o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap));
     
     float3 worldRefl = WorldReflectionVector (IN, o.Normal);
     fixed4 reflcol = texCUBE (_Cube, worldRefl);
     reflcol *= tex.a;
     o.Emission = reflcol.rgb * _Color.rgb;
     o.Alpha = reflcol.a * _Color.a;
 }
 ENDCG
 }
 
 FallBack "Reflective/Bumped Diffuse"

}

*** Any ideas?

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 anshul-bhardwaj · Jun 21, 2014 at 05:14 AM 0
Share

I am also getting the same problem. Have you got any solution for this?

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by tswalk · Jun 21, 2014 at 05:33 AM

My guess, is that the device you are testing it on may not actually support SM3 or higher.. the default (and baseline requirement) for Windows Store Apps is SM2.0 4_0_level_9_1... or higher. And is therefore "falling back" to that which is probably compiled for everything under the sun.

So you probably will want to use the following pragma for testing:

 #pragma only_renderers d3d11_9x d3d11
 #pragma target 2.0

note: only_renderers is what I am currently using as I've restricted the shader only for windows devices (and in this case ARM [e.g.: surface RT]).

also, you can actually comment out the fallback while developing with that specific shader.

and finally, what you may need to do, (if you want to offer support for features in higher shader models), is to detect what the hardware actually supports that the game is running on and specify shaders at runtime.

hope that helps some.

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 anshul-bhardwaj · Jun 21, 2014 at 06:09 AM 0
Share

I have windows 8.1, 64 bit. GeForce GT620$$anonymous$$, DirectX runtime version 11.0 It should support S$$anonymous$$3. I am not testing the build for AR$$anonymous$$. I am building for x86. Am I doing something wrong in building the package? Please suggest.

avatar image tswalk · Jun 21, 2014 at 07:17 AM 0
Share

have you tried adding #pragma debug and commenting out the fallback?

also, there seems to already be a shader built in called "Reflective/Bumped Specular"... perhaps try a custom name like "Custom/$$anonymous$$yShaderTest", maybe there is some strange conflict.

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

17 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

Related Questions

Material doesn't have a color property '_Color' 4 Answers

Strumpy Shader Editor - Can't view preview window 1 Answer

A node in a childnode? 1 Answer

What is the best way to deactivate ALL pro-shaders only from a project? 1 Answer

The name 'Joystick' does not denote a valid type ('not found') 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