Announcement

Collapse
No announcement yet.

Accessing Scene Texture in Custom material node.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    Thank you very much, this is the answer I was looking for.

    I am curious though, where can these functions (and usable native variables, like screen width/height) be found? I have searched the documentation and Google, but couldn't find a single resource.

    Leave a comment:


  • replied
    You can acces the Scene texture with
    Code:
    tex2D(SceneColorTexture,float2(ScreenAlignedPosition(Parameters.ScreenPosition).xy));

    Leave a comment:


  • started a topic Accessing Scene Texture in Custom material node.

    Accessing Scene Texture in Custom material node.

    Good afternoon.

    Since the SceneTextureSample (obviously) outputs an already sampled texture I can't use that in a Custom material node. Is there any other method of accessing the "raw" Scene Texture for use in a Custom node?

    Any help is appreciated, have a nice day.

    EDIT: I am looking for solutions other than attaching a SceneCapture2D to the camera, sampling that to a Texture, and then accessing that as a TextureObject.

    EDIT2: Here is a simple Average color code for helping me out again, feel free to use. This is what I need the non sampled SceneTexture for. Custom Node, HLSL, SampleAmount and Texture are inputs.

    Code:
    float3 Result;
    
    for (int i=0; i<SampleAmount; i++) {
        for (int j=0; j<SampleAmount; j++) {
            Result += tex2D(Texture, float2(1/i, 1/j));
        }
    }
    
    return(Result/SampleAmount/SampleAmount);
Working...
X