Jump to content

GetColorAttachement with Custom Shader


SpiderPig
 Share

Recommended Posts

Up till now this was my working code;

texture_buffer = CreateTextureBuffer(size.x, size.y);
camera->SetRenderTarget(texture_buffer);

material = CreateMaterial();
material->SetShaderFamily(LoadShaderFamily("Shaders\\Unlit.json"));
material->SetTexture(texture_buffer->GetColorAttachment(), 0);
model->SetMaterial(material);

I switched the material out for a custom one I made and am getting an error in the rendering thread I think.  I've not given it much thought yet but was wondering if the shaders need something special to access the texture rendered from a camera?  I was thinking it should be a normal texture lookup in GLSL but I may be wrong.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...