Projector questions

Node-based Shader Editor

Projector questions

Postby mossman » Fri Jan 18, 2019 9:52 pm

Hello,

I saw the projector example, is very useful. I created a custom shader derived from this example. But I have two questions.

It is possible that the projection has a intensity attenuation by the distance like the light of a spotlight?

It is possible make that the projector only projects in the front side of the destination mesh?

Thanks
mossman
 
Posts: 40
Joined: Sun Dec 10, 2017 3:58 pm

Re: Projector questions

Postby Amplify_Borba » Mon Jan 21, 2019 4:40 pm

Hello, the Falloff Texture is already responsible for attenuation of the projection, and you can further modify this node setup and / or change the texture in order to get a different or more noticeable effect:

Image

The other question is quite tricky, and the following solution is not very elegant and might not work for all situations:

Image

Image

We've tweaked the ProjectLight sample shader in order to limit the projected area, which seems to be working decently for the standard sphere, and further increases the complexity of the shader. It would be a complicated endeavor to figure out how to achieve a correct display for all types of meshes, but it might just be possible.
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Amplify_Borba
 
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am

Re: Projector questions

Postby mossman » Mon Jan 21, 2019 7:03 pm

Hello,


Many thanks for the quick response. All the test that I made with this solution are good.

Also I will try other approach.
mossman
 
Posts: 40
Joined: Sun Dec 10, 2017 3:58 pm

Re: Projector questions

Postby mossman » Tue Jan 22, 2019 2:54 pm

Hello,

I tried various approach to get the backface culling but your approach is better for now.

The result is nice with all the meshes that I test.

Now I am trying to make that objects nearest to projector culls the projection on the objects farest to projector.

This image illustrates the problem. The brown cube does not occlude the projection in the grey plane.

Image

Thanks
mossman
 
Posts: 40
Joined: Sun Dec 10, 2017 3:58 pm

Re: Projector questions

Postby Amplify_Borba » Tue Jan 22, 2019 3:30 pm

I'm afraid that won't be possible through a shader, at least not to my knowledge.

As it states in the documentation, "A Projector allows you to project a Material onto all objects that intersect its frustum.", so you'd have to either adjust its far clipping plane so that the frustum won't intersect with unintended geometry, or alternatively use the Ignore Layers parameter and set the geometry you don't want to be affected in an ignored layer.
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Amplify_Borba
 
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am

Re: Projector questions

Postby mossman » Fri Jan 25, 2019 9:52 pm

I think the same. I reviewed the source code of Projector component to understand how works but the code is incomplete. I is a shame.

Thanks for all.
mossman
 
Posts: 40
Joined: Sun Dec 10, 2017 3:58 pm

Re: Projector questions

Postby Amplify_Borba » Mon Jan 28, 2019 4:34 pm

No problem, please don't hesitate to get back in touch if you come across any further issues or questions!
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Amplify_Borba
 
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am


Return to Amplify Shader Editor

Who is online

Users browsing this forum: No registered users and 22 guests