AmplifyCreations / AmplifyShaderEditor-Feedback

4 stars 0 forks source link

SRP Object Nodes #110

Closed Dawie3565 closed 4 months ago

Dawie3565 commented 1 year ago

Note Unity has "Object node that returns Object scale and position ASE has Node "Object Scale" that returns the object scale

ASE - Object Scale (Object position in world space) New ASE - Object Position (Object scale in world space)

from SRP api 14x an higher Unity's also adds: World Bounds Min (Minimum value of the renderer bounds in world space) World Bounds Max (Maximum value of the renderer bounds in world space) Bounds Size (Size of the renderer bounds)

New ASE - Object Bounds

TYPE.Vec3 WorldBoundsMin WorldBoundsMin = SHADERGRAPH_RENDERER_BOUNDS_MIN;

TYPE.Vec3 WorldBoundsMax WorldBoundsMax = SHADERGRAPH_RENDERER_BOUNDS_MAX;

TYPE.Vec3 BoundsSize BoundsSize = (SHADERGRAPH_RENDERER_BOUNDS_MAX - SHADERGRAPH_RENDERER_BOUNDS_MIN);",

Dawie3565 commented 1 year ago

Bump for higher priority multiple users requested this node for object bounds in 14x and higher

Dawie3565 commented 1 year ago

Note SG changed the node name from Oject Position to Object

Dawie3565 commented 6 months ago

Bump priority to ASAP per users request.

New node for Object Bounds see comments in original issue posted.

//////////////////////////////////////////////////////////////////////////////////////// /ase_srp_cond_begin:>=140004/

define SHADERGRAPH_RENDERER_BOUNDS_MIN shadergraph_RendererBoundsWS_Min()

define SHADERGRAPH_RENDERER_BOUNDS_MAX shadergraph_RendererBoundsWS_Max()

/ase_srp_cond_end/

//////////////////////////////////////////////////////////////////////////////////////// /ase_srp_cond_begin:>=140004/ float3 shadergraph_RendererBoundsWS_Min() { return GetCameraRelativePositionWS(unity_RendererBounds_Min.xyz); } /ase_srp_cond_end/

//////////////////////////////////////////////////////////////////////////////////////// /ase_srp_cond_begin:>=140004/ float3 shadergraph_RendererBoundsWS_Max() { return GetCameraRelativePositionWS(unity_RendererBounds_Max.xyz); } /ase_srp_cond_end/

Dawie3565 commented 6 months ago

Bumped to 1.9.3.4 so workflow can be coordinated with changes in URP templates at the same time

diogovtx commented 5 months ago

Notes from duplicate issue (#269):

Render bounds are available in unity 2022.3 or higher (>=14x) Renderer bounds can only be used in SRPs and if SG is imported. https://docs.unity3d.com/Packages/com.unity.shadergraph@14.0/manual/Object-Node.html

diogovtx commented 4 months ago

FINALLY done.

Unity_7BRgVKnvC3

Will be included with v1.9.3.4 and requires URP/HDRP 14.0.4 or higher.