Procedural texture with shaders

Hello! I would like to create a texture using shaders. I have a vague idea how one should do it: create a framebuffer, render to the framebuffer applying shaders, store the data from the framebuffer into the texture. However, I’m not sure how to do it in a concrete manner. Can someone offer some guide on this, please?

P.S. I know how to render to texture using offscreen viewport and camera.

Theres a manual in the SDK, press F1 or use the text search in the top right. Using that you will find the same information as on this page:

Thanks for the answer. I’ve already read that manual pages. However, it only talks about shaders and does not mention how to render texture using shaders. I mean, I do not want to render texture every frame. I want to apply shaders once and save the result as a normal, static texture.

Sure it mentions using textures. To get a texture back from the GPU do the same as the screenshot utility - or if you want to use it on the GPU side see the render to texture example.

Thank you. Can you give me links to render to texture example and screenshot utility, please? I’ve found only this link

New Project → JmeTests

Thank you.

Ok, I’ve managed to do it via render to texture. The core part of the code goes like this

        picture = new Picture("picture");
        Material material = new Material(assetManager, "MatDefs/SimpleColor/SimpleColor.j3md");
        material.setInt("Size", 512);
//        material.setColor("Color", ColorRGBA.Blue);

So, I set a material with a custom shader on a picture. Is it a correct way to do it?