• 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
Question by Exalia · Aug 23, 2013 at 09:09 AM · androidrenderingportingwireframe

Wireframe Rendering on Android

I've used GL.wireframe to set up wireframe rendering on PC however this function literally does nothing on my tablet. I assume the guys over at Unity haven't put this in yet which is fine but does anyone know how I would be able to achieve the same effect without it?

Thanks

EDIT :

Since I have found a method of achieving a wireframe. However this only works by attaching the script to objects of low complexity. I would prefer for a similar effect to be done on all objects in the scene simultaniously

 using UnityEngine;
 using System.Collections.Generic;
 
 public class WireFrameCD : MonoBehaviour
 {
     Mesh LastMesh;
     Material LastMaterial;
     string lineshader = "Shader \"Unlit/Color\" { Properties { _Color(\"Color\", Color) = (0, 1, 1, 1)   } SubShader {  Lighting Off Color[_Color] Pass {} } }";
 
     public void OnEnable()
     {
         var mesh = gameObject.GetComponent<MeshFilter>().sharedMesh;
         var renderer = gameObject.GetComponent<MeshRenderer>();
         LastMaterial = renderer.material;
         LastMesh = mesh;
         var vertices = mesh.vertices;
         var triangles = mesh.triangles;
         var lines = new Vector3[triangles.Length];
         int[] indexBuffer;
         var GeneratedMesh = new Mesh();
 
         for (var t = 0; t < triangles.Length; t++)
         {
 
             lines[t] = (vertices[triangles[t]]);
 
         }
         GeneratedMesh.vertices = lines;
         GeneratedMesh.name = "Generated Wireframe";
 
         var LinesLength = lines.Length;
         indexBuffer = new int[LinesLength];
         var uvs = new Vector2[LinesLength];
         var normals = new Vector3[LinesLength];
 
         for (var m = 0; m < LinesLength; m++)
         {
             indexBuffer[m] = m;
             uvs[m] = new Vector2(0.0f, 1.0f); // sets a fake UV (FAST)
             normals[m] = new Vector3(1, 1, 1);// sets a fake normal
         }
 
         GeneratedMesh.uv = uvs;
         GeneratedMesh.normals = normals;
         GeneratedMesh.SetIndices(indexBuffer, MeshTopology.LineStrip, 0);
         gameObject.GetComponent<MeshFilter>().mesh = GeneratedMesh;
         Material tempmaterial = new Material(lineshader);
         renderer.material = tempmaterial;
     }
 
     public void OnDisable()
     {
         gameObject.GetComponent<MeshFilter>().mesh = LastMesh;
         gameObject.GetComponent<MeshRenderer>().material = LastMaterial;
     }
 }
Comment
Krishx007

People who like this

1 Show 10
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 Sajidfarooq · Aug 23, 2013 at 09:10 AM 0
Share

Just use Vectrocity.

avatar image Exalia · Aug 23, 2013 at 09:19 AM 0
Share

I'll have a look at this thanks.

avatar image Exalia · Aug 23, 2013 at 09:23 AM 0
Share

You have to pay for this this isn't a solution... I take my thanks back X_X

avatar image Exalia · Aug 23, 2013 at 11:27 AM 0
Share

Has anyone got a real solution for this?

avatar image Sajidfarooq · Aug 23, 2013 at 01:16 PM 0
Share

You never said it had to be a free solution. Vectrocity is a tool that every other Unity developer depends on. Its certainly a solution, just not free.

Show more comments

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

20 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

Related Questions

Problem with light banding on Android 0 Answers

No Camera Rendering when switching between cameras developing for Android 0 Answers

How is the porting (PC->Android/iPhone) done? 1 Answer

Unity 5.2: Profiling Empty Scene - Very high Graphics.PresetAndSync 2 Answers

[Android] Call .jar function on render thread using JNI 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