Skip to content

Commit

Permalink
fix gpu instanced properties
Browse files Browse the repository at this point in the history
  • Loading branch information
z3y committed Oct 31, 2024
1 parent a75d85d commit 978284d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Docs~/pages/live-preview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Image from "next/image"
# Live Preview

Live Preview updates all constant properties like Color, Float while working on the shader for preview in the scene view.
It does not work with other materials.
It only works with the imported material subasset.
This is similar to shader locking or baking which optimizes the shader by reducing the need for material properties.

![Image](/generated-material.png)
Expand Down
4 changes: 3 additions & 1 deletion Editor/Targets/Vertex.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
Varyings vert(Attributes input)
{
Varyings varyings = (Varyings)0;
UNITY_INITIALIZE_OUTPUT(Varyings, varyings);

#if !defined(UNITY_PASS_META)
UNITY_SETUP_INSTANCE_ID(input);
UNITY_TRANSFER_INSTANCE_ID(input, varyings);
#endif
UNITY_INITIALIZE_OUTPUT(Varyings, varyings);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(varyings);

VertexDescription vertexDescription = VertexDescriptionFunction(input, varyings);
Expand Down

0 comments on commit 978284d

Please sign in to comment.