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 Piroman · Jul 15, 2013 at 08:18 PM · shaderlightmeshfilterilluminationvertexcolor

Shader for Global illumination via vertex array

Hello, dear Unity community

I'm new to shaders, but hope someone can help me. I think that solution for this theme can be found via shaders (If there is some other solution, please tell me).

What we have:

  1. We have a static geometry mesh consisted of different objects.

  2. We have an array of vertices that looks like:

    .....

    v -48.1629 81.8135 0.0000 126 126 126

    v 6.3909 77.2903 0.0000 124 124 124

    v -32.4754 -6.6671 23.8640 104 104 104

    v -53.9047 81.9580 0.0000 126 126 126

    v 8.2705 74.2350 0.0000 124 124 124

    v -51.8147 79.4345 0.0000 126 126 126

    v 10.5213 72.1797 0.0000 123 123 123

    [v-vertex][xpos][ypoz][zpoz][rcolor][gcolor][bcolor]

    ......

This array describes light intensity and color in each point for the whole scene (For the simple scene more than 90 000 vertesies. The vertices of this array lay on or near the surface of the geometry that we have to light up.

  1. I've written a parser for this array, that creates a Unity3D mesh from this array (now for 65K vertices, but soon I'll rewrite script that will create needed count of mesh objects for the whole array). Also I faced the problem to assigne vertex colors for the mesh.colors(mesh.colors[i].r = r;) But I think will solve these problems soon.

  2. So we have the geometry that we should light and the information about the light in the meshFilter component.

What we need and what way to chose?:

  1. Render the whole scene with a specific shader that uses that light info and then overlay the image rendered from camera?

  2. How to transfer that light information to the shader? And how to use it? )

  3. The solution has to be without unwrapping objects.

  4. Or to write a shader and assign it to all objects in the scene?

Any ideas?

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

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

change front color or back color programmatically 0 Answers

How to make projector/light shader "alpha enabled"? 2 Answers

Multiple Light Shader 'Light Box' Bug 0 Answers

Getting vertex data from lighting function in shaders. 1 Answer

Shader which supports vertex colors and pixel lights? 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