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 Paul Ripley · Oct 01, 2013 at 09:50 AM · lightingparticlesshurikennormalmaptangent

Is there a way to rotate Shuriken particles and have working normal maps?

Hi there, I've just been testing out Shuriken using a particle material that has a tangent-space normal map.

The billboard particles look ok if they aren't rotated, but if I change their Start Rotation to 180 degrees, it now looks as if the light source has been has been rotated by 180 degrees. If you let the start rotation be random, then each particle appears to be bit by a different light source.

It is my understanding that the apparent light direction shouldn't change on the particles - is there a way to stop this happening, or is it just that you can't rotate normal-mapped particles?

Comment
Add comment · Show 3
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 Acr1m · Oct 01, 2013 at 10:53 AM 0
Share

I can't really give you a clear answer >.< But I can provide a solution! If you spawn them as actual objects, then they will for sure update the light on their textures. Now, I'm not exactly sure what you need... so I'm gonna provide an example where you hit a "trap" and then it spawns a bunch at an area and they start to travel before dying after a set time.

Here's the code for how to do it. (You'll have to apply this on an empty GameObject or somn with the "Is Trigger" set to True, in a Collider Component.

 using UnityEngine;
 using System.Collections;
 
 public class Trap : $$anonymous$$onoBehaviour
 {
     public GameObject ShurikenPrefab;         //Fill this in with the shuriken prefab
     public GameObject ShurikenSpawnPoint;     //Fill this in with the object you want these to spawn at from the Scene
     public float RandomSpawnRange = 5;         //This is subject to change (for tweaking in editor)
     public int NumberOfShurikens = 50;         //You can change this in the Inspector tab while in the Editor for tweaking
     public float Lifetime = 5;
     
     void OnTriggerEnter(Collider other)
     {
         //spawns a ton of shurikens (shuriken movement is handled within it's own "Controller" script)
         for(int i = 0; i < NumberOfShurikens; i++)
         {
             GameObject go = GameObject.Instantiate(ShurikenPrefab, new Vector3(
                 (ShurikenSpawnPoint.transform.position.x + Random.Range(0f, RandomSpawnRange)),
                 (ShurikenSpawnPoint.transform.position.y + Random.Range(0f, RandomSpawnRange)), 
                 (ShurikenSpawnPoint.transform.position.z + Random.Range(0f, RandomSpawnRange))), 
                 Quaternion.identity);
             Destroy(go, Lifetime);
         }
     }
 }

You'll have to make a Shuriken prefab to plugin to the script. Quad's are better than planes, cuz they are only 2 tris, ins$$anonymous$$d like 50 or wutever the planes are.

Here's the script for the shuriken prefab. If this isn't plugged in there, the thing won't fly :/ or spin...

 using UnityEngine;
 using System.Collections;
 
 public class ShurikenController : $$anonymous$$onoBehaviour
 {
     public Vector3 ShurikenTranslateVector;
     public Vector3 ShurikenRotateVector;
     
     void Update()
     {
         //applies the Translate Vector to the shuriken every frame
         transform.position += ShurikenTranslateVector;
         
         //applies the Rotate Vector to the shuriken every frame
         transform.localRotation += ShurikenRotateVector;
     }
 }
avatar image Paul Ripley Acr1m · Oct 01, 2013 at 12:41 PM 0
Share

Hi Acr1m, Your solution doesn't really apply in my case, as I'm trying to specifically get the lighting to work on billboard particles that have been spawned from Unity3D's Shuriken particle system.

These particles are much more light-weight than having to spawn multiple game objects, and much more render-efficient too!

avatar image Acr1m · Oct 02, 2013 at 01:28 AM 0
Share

moved this over to a comment ins$$anonymous$$d, in order to clear out the answer section so somebody with a "real" answer can help you out :P

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

15 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

Related Questions

Converting vortex effect from legacy to Shuriken 1 Answer

Shuriken values in shader code? 0 Answers

Normal maps problem 1 Answer

Vanish the Shuriken particle system clone 1 Answer

Particle system does not re-emit until Start Lifetime elapsed 4 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