Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 uchihaballs · Dec 27, 2017 at 04:04 PM · lightingshadersparticlesparticlesystemsurface shader

How to edit the new particle surface shader? / Make it so particles receive light from all angles

I would like to edit the code in the particle surface shader. But it cases Unity to crash. I downloaded the standard asset shaders from unity's website. I first tried only adding the "Particle Standard Surface.shader" file, but that caused unity to freeze (the unity shader compiler used up all CPU power until i force closed it). And the shader didn't work. I tried adding all the standard shader assets, which didn't case a freeze, but now i don't know how to add my own code to that shader. I tried adding the "diffuse wrap" shader code from

.

https://docs.unity3d.com/Manual/SL-SurfaceShaderLightingExamples.html

.

but that gives me 3 errors:

.

  1. "Shader error in 'Particle Standard Surface': CGPROGRAM cannot contain #pragma surface as well as other programs at line 73"

  2. "Shader error in 'Particle Standard Surface': Surface shader vertex function 'vertParticleShadowCaster' #0 parameter has wrong modifier; has no modifier but needs 'inout' at 'VertexInput v' at line 73"

  3. "Shader error in 'Particle Standard Surface': Parse error: syntax error, unexpected TOK_PASS, expecting TOK_SETTEXTURE or '}' at line 74"

.

And i don't know what any of those errors mean. Well i guess know what the first two means, but not why or how to fix.

.

Have never made a particle shader before so i don't even know where to begin. And i can't find any examples online.

.

What i am trying to do with the shader is so the particles receive light from any angle. So light basically "shines" through. If you point a flash light at a sheet of paper, you will see the light from the other side, the paper doesn't completely block the light. I need this because im making a dark top down game where the character has a flash light(spot light) on his gun. Since the camera is from above the particles faces the camera and this is almost 90 degrees away from the light (the light is slightly pointed downwards) which cases the particles to be COMPLETELY unlit. Any ideas of how to fix this? Either by teaching me where to even try to start with editing the particle surface shader or by some other hack or variable to change or whatever.

.

And yes i have tried to make the spot light point even more downwards, but it needs to be at like 45 degrees for it to light up the particles the way i want, And having the light at 45 degrees fucks up the way i want the light to be for everything else (also it stops looking like a flash-light light at that point)

Comment
Add comment
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

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

99 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 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 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 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 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

Shuriken values in shader code? 0 Answers

Control light intensity via shader script 0 Answers

Unity inbuilt distorsion shader? 1 Answer

Limit particle shader / discard from certain worldpos 1 Answer

Particles effect in a progress bar 1 Answer


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