SpiderPig Posted July 11, 2023 Share Posted July 11, 2023 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. Quote Link to comment Share on other sites More sharing options...
Josh Posted July 11, 2023 Share Posted July 11, 2023 Looks fine to me. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
SpiderPig Posted July 11, 2023 Author Share Posted July 11, 2023 And I don't need anything special in my custom frag shader? This should read the texture no matter where it comes from yeah? vec4 texColor = texture( texture2DSampler[ GetMaterialTextureHandle( materials[ inMaterialIndex ] , TEXTURE_DIFFUSE ) ] Quote Link to comment Share on other sites More sharing options...
SpiderPig Posted July 11, 2023 Author Share Posted July 11, 2023 I got it working so I guess that is all you need. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.