Material(string) is Obsolete

Home Forums Books Mastering Unity 2D Game Development Material(string) is Obsolete

This topic contains 1 reply, has 2 voices, and was last updated by  Simon (darkside) Jackson 2 years, 7 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #8975

    Fran

    Hi everyone,

    At the end of chapter 6, I have got the following warning when I run the game:

    Shader warning in Plane/No zTes’: Shader is not supported. Are you creating a fixed function shader using Material(string) constructor?

    How I could update that method to avoid that warning message? Does anyone know a workaround for that?

    Thanks in advance!

    #8977

    Hi Fran

    Thanks for reaching out. Your query really had me scratching my head for a while as I had done a fix for this issue but couldn’t find where I had written it up, until I found it.

    Basically, the original book was written in the 4.x timescales. Once Unity 5 came out, changes were optionally needed as a few warnings appeared but didn’t stop anything from running. That was until they changed the Shader pipeline and prevented using Shader strings (as used on Page 110).

    There is a post which I keep up to date on the forum titled “Unity 5 Support” which details any and all changes required to run the project on Unity 5 (I have to keep it up to date as Unity keep changing things on me :D)

    The particular update you are looking for is detailed here:
    https://darkgenesis.zenithmoon.com/DarkGenesisForums/topic/unity-5-support/#post-7972

    This walks you through changing the shader segment from a text based material shader to a shader resource (basically taking the text and creating an actual shader file with the same code) and then referencing the new shader in code.

    Hope this helps and good luck on your game coding adventure.

    Be sure to check the rest of that thread regarding Unity 5 updates.

    Simon (Darkside) Jackson
    @SimonDarksideJ

Viewing 2 posts - 1 through 2 (of 2 total)

The forum ‘Mastering Unity 2D Game Development’ is closed to new topics and replies.