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
1
Question by Thaggis · Dec 24, 2014 at 05:46 PM · shadercghlsldirect3d

How do you change Point Size in Direct3d 11 shader?

I'm rendering a point cloud using MeshTopology.Points. I wrote a simple vertex shader that can change the point size during play and that worked fine until Direct3D 11. I have to use D3D11 because I'm using the Rift DK2. Does anyone know the right shader code to make this work in Unity 4.5.5 and D3D11?

Comment
Add comment · Show 2
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 Thaggis · Dec 29, 2014 at 02:09 PM 0
Share

Is this something that's changed with Unity or the way Direct3D / HLSL works?

avatar image rich2701 · Jan 29, 2016 at 07:41 PM 0
Share

Bump, did you ever find a solution to this?

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Michal_ · Jan 31, 2016 at 02:37 PM

Point sprites aren't supported on DX11 (or any other modern API for that matter). You have to create quads from points manually. There are several way how to do this on DX11. It was recently discussed here. This is the relevant part:

  1. Emit a quad for every vertex in geometry shader (textbook solution, not necessarily best/fastest)

  2. Create quads from points in tesselator

  3. HW Instancing

  4. The old fashion way. Works on every hw. Create 4 identical vertices with different uvs for every particle. You also have to store "offset vector" in second uv set for every vertex. That offset will tell you where to move that vertex in vertex shader so that all 4 vertices will form a quad. First vertex will move to lower left corner, second one to upper left corner of the quad etc. You will simply use something like this in vertex shader: position += cameraRightVector * offset.x * particleSize; position += cameraUpVector * offset.y * particleSize;

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

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

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How can I get correct lighting on a low poly water shader? 1 Answer

Shader - Object Depth 0 Answers

Why color not rendering in my shader? 0 Answers

Access to svPosition in fragment shader 1 Answer

Can a CG shader fail to work on hardware? 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