Template for use with custom render textures?

Node-based Shader Editor

Template for use with custom render textures?

Postby Wadewt » Mon Oct 15, 2018 12:44 am

Hello, I am trying to make a reaction diffusion shader using ASE. You can see an example here: https://github.com/keijiro/RDSystem

The problem is that I need to use a custom render texture which requires the shader to be set up a certain way. The Unity documentation has an example shader for use with custom render textures: https://docs.unity3d.com/Manual/CustomRenderTextures.html

I tried creating a template using the guide from the ASE documentation but I am not very familiar with shader code and was unable to get it working. There's no vertex function in the Unity example shader for instance, and I was unable to figure out what to do.

I would really appreciate any help getting this to work.
Wadewt
 
Posts: 9
Joined: Tue Feb 06, 2018 3:16 am

Re: Template for use with custom render textures?

Postby Amplify_Borba » Mon Oct 15, 2018 1:55 pm

Hello! You're able to author shaders in ASE that make use of custom render textures, simply drag the asset into a Texture Sample node.

If you want to create a Custom Render Texture with an ASE shader, however, you should make sure that you use our Post Process template, as it is the most adequate one to be used as a base for the shader, and you'll also need to have a script on your camera with the OnRenderImage method defined in order to write to the custom render texture.
Within this method you'll need to perform a Blit operation, in which the source texture contains the current image from the frame buffer ( which is one of the parameters of the OnRenderImage method ), and the destination texture will be your Custom Render Texture.

Please let me know if this helps, thanks!
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: Template for use with custom render textures?

Postby Wadewt » Wed Oct 17, 2018 12:50 am

I'm not sure I've quite understood you. Just to make sure we're talking about the same thing: a Custom Render Texture is different to a Render Texture; with a Custom Render Texture you can give it a material which then updates the texture. I believe this does the same thing as you described in your post, you just don't need to do the blitting or writing yourself. And then you can create a regular shader which uses the results of the Custom Render Texture.

I'm just uncertain about how to make my own template that will create a shader that the Custom Render Texture expects.
Wadewt
 
Posts: 9
Joined: Tue Feb 06, 2018 3:16 am

Re: Template for use with custom render textures?

Postby Amplify_Borba » Wed Oct 17, 2018 8:55 am

Apologies for my misunderstanding, you're correct in your last reply that a template will be necessary for this matter, and we'll definitely be adding an official one to the package as soon as possible.

I'll be sure to keep you posted regarding any new developments, thank you for understanding!
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: Template for use with custom render textures?

Postby Wadewt » Thu Oct 18, 2018 12:32 am

Oooo, excellent. I can't wait! Thank you very much. :D
Wadewt
 
Posts: 9
Joined: Tue Feb 06, 2018 3:16 am

Re: Template for use with custom render textures?

Postby Amplify_Borba » Thu Oct 18, 2018 8:48 am

No problem, we'll be sure to get in touch as soon as we have any updates regarding this!
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: Template for use with custom render textures?

Postby Wadewt » Tue Nov 06, 2018 12:05 am

Hello! Just wondering if there's any updates on this. Am very excited for it.
Wadewt
 
Posts: 9
Joined: Tue Feb 06, 2018 3:16 am

Re: Template for use with custom render textures?

Postby Amplify_Borba » Tue Nov 06, 2018 8:45 am

Hey there, we've recently added the necessary templates for this, the Custom RT Init and Update, which are Packed inside the AmplifyShaderEditor > Plugins > EditorResources > Templates > CustomRTTemplates.unitypackage.

There's also a new sample, the Custom Render Texture Rain, which is packed inside the AmplifyShaderEditor > Examples > Custom RT Samples.unitypackage, and requires both Custom RT Init and Custom RT Update templates to be imported into project first.

Apologies for not getting back to you earlier, please let us know if you come across any issues, thanks!
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: Template for use with custom render textures?

Postby Wadewt » Wed Nov 07, 2018 1:44 am

:D Woo, thanks heaps! I'm messing about with it now, shall let you know if I have any questions.
Wadewt
 
Posts: 9
Joined: Tue Feb 06, 2018 3:16 am

Re: Template for use with custom render textures?

Postby Wadewt » Wed Nov 07, 2018 11:16 am

Yay, it works wonderfully. I managed to recreate Conway's Game of Life in a shader. I'm not sure I got the rules exactly right, but it proves the concept! Thanks for the template! :D
Image
Wadewt
 
Posts: 9
Joined: Tue Feb 06, 2018 3:16 am

Next

Return to Amplify Shader Editor

Who is online

Users browsing this forum: No registered users and 47 guests