# How can I get shaderMaterial output texture

**URL:** <https://forum.babylonjs.com/t/how-can-i-get-shadermaterial-output-texture/39949>\
**Category:** Questions\
**Tags:** material, shader\
**Created:** [April 17, 2023, 1:43pm UTC](https://forum.babylonjs.com/t/how-can-i-get-shadermaterial-output-texture/39949 "2023-04-17T13:43:14Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![zzh505968568](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/zzh505968568/32/31483_2.png) [@zzh505968568](https://forum.babylonjs.com/u/zzh505968568)\
**Post date:** [April 17, 2023, 1:43pm UTC](https://forum.babylonjs.com/t/how-can-i-get-shadermaterial-output-texture/39949/1 "2023-04-17T13:43:14Z")

</div>

I have encountered some problems.  
I want to implement a function of graffiti on complex models,  
so I think I should record the last `shaderMaterial ` rendering result texture. This result texture should record each pixel’s RGBA information and and be used next time.  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/4/e/4ebd4ab54289d7c6bf70cc2e0315f5e392e80ea9.png)  
I found some instances below, but it doesn’t seem feasible：

- [https://playground.babylonjs.com/#YYCIUU#4](https://playground.babylonjs.com/#YYCIUU#4)
- [Get current frame buffer texture for shader material](https://forum.babylonjs.com/t/get-current-frame-buffer-texture-for-shader-material/17443)  
how I can implement it.  
It would be best if you could give me an example demo.  
🙏 🙏 🙏

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [April 17, 2023, 3:57pm UTC](https://forum.babylonjs.com/t/how-can-i-get-shadermaterial-output-texture/39949/2 "2023-04-17T15:57:41Z")

</div>

I am not sure to understand what you are trying to do.

Please, describe your use case and we could think about the best way to do it ?

---

<div class="post-metadata">

**Author:** ![phaselock](https://avatars.discourse-cdn.com/v4/letter/p/da6949/32.png) [@phaselock](https://forum.babylonjs.com/u/phaselock)\
**Post date:** [April 18, 2023, 12:52am UTC](https://forum.babylonjs.com/t/how-can-i-get-shadermaterial-output-texture/39949/3 "2023-04-18T00:52:08Z")

</div>

> [@zzh505968568](#):
>
> I want to implement a function of graffiti on complex models,

Is this [PG](https://www.babylonjs-playground.com/#9MPPSY#5) close to your needs ?

---

<div class="post-metadata">

**Author:** ![zzh505968568](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/zzh505968568/32/31483_2.png) [@zzh505968568](https://forum.babylonjs.com/u/zzh505968568)\
**Post date:** [April 18, 2023, 1:23am UTC](https://forum.babylonjs.com/t/how-can-i-get-shadermaterial-output-texture/39949/4 "2023-04-18T01:23:51Z")

</div>

Sorry, maybe I didn’t express clearly.  
The model has its own uv map as shown below, I want to get the texture processed by ShaderMaterial, This texture should be based on uv map.  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/4/e/4ebd4ab54289d7c6bf70cc2e0315f5e392e80ea9.png)

---

<div class="post-metadata">

**Author:** ![zzh505968568](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/zzh505968568/32/31483_2.png) [@zzh505968568](https://forum.babylonjs.com/u/zzh505968568)\
**Post date:** [April 18, 2023, 1:34am UTC](https://forum.babylonjs.com/t/how-can-i-get-shadermaterial-output-texture/39949/5 "2023-04-18T01:34:15Z")

</div>

I learned that Post Processes is bound to the camera, as follows:

 ![A17T0977-0001 (5)](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/3/0/30c7e62eeb333f0d1d9110006bf7466eee6b8006.jpeg)  
but I want a texture based on model，like UV map, as follows:  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/4/e/4ebd4ab54289d7c6bf70cc2e0315f5e392e80ea9.png)  
How can I get `ShaderMaterial` rendered texture like that?

---

<div class="post-metadata">

**Author:** ![zzh505968568](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/zzh505968568/32/31483_2.png) [@zzh505968568](https://forum.babylonjs.com/u/zzh505968568)\
**Post date:** [April 18, 2023, 1:40am UTC](https://forum.babylonjs.com/t/how-can-i-get-shadermaterial-output-texture/39949/6 "2023-04-18T01:40:21Z")

</div>

I see this demo, but I want to use a shader to update DynamicTexture. How can I do it?

---

<div class="post-metadata">

**Author:** ![ecojust](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ecojust/32/12884_2.png) [@ecojust](https://forum.babylonjs.com/u/ecojust)\
**Post date:** [April 18, 2023, 8:31am UTC](https://forum.babylonjs.com/t/how-can-i-get-shadermaterial-output-texture/39949/7 "2023-04-18T08:31:58Z")

</div>

Maybe what you want is a UV map after ’painted‘ ?

the ‘painted’ means rendered by babylon

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [April 18, 2023, 7:53pm UTC](https://forum.babylonjs.com/t/how-can-i-get-shadermaterial-output-texture/39949/8 "2023-04-18T19:53:30Z")

</div>

You are looking into a procedural texture in Babylonjs [Procedural Textures | Babylon.js Documentation](https://doc.babylonjs.com/features/featuresDeepDive/materials/using/proceduralTextures)
