[SOLVED] creating a new buffer?

more shader questions.

I am playing around with trying to create a custom buffer, the way that defered renderpaths create three rendertargets, albedo, depth, and normal for example.

In the docs for RenderPaths it says under the available commands for scene pass:

so theoretically, if I have this:

<rendertarget name="mytarget" sizedivisor="1 1" format="rgba"/>
<command type="quad" vs="myshader" ps="myshader" output="mytarget">
      <texture unit="environment" name="viewport" />
<command type="scenepass" pass="mypass">
      <texture unit="mytarget" name="mytarget" />

I should be able to use my declared render target as a texture, however, i get the error:

Just trying to figure out how I can make a NEW texture unit. I can change all those “mytarget” to “albedo” and i get no errors. So I assume I am not adding it as a uniform (which I also tried sMytargetBuffer in the shader) properly or something else somwhere else.


Try this:

to have your buffer mapped to the sDiffMap sampler.
You can find the list of textures names you can use in Material.cpp.

Thanks, I’ll try that.
I see that there are a fair number of unit names, however; I’m still curious if it is possible to somehow declare a custom unit name.

Actully, I see that its unesssisary to make my own. It seems I can just use the same one over and over for each pass if I want, since it apears to just set a variable so to speak. This will work fine. Thanks again.