williamqin Posted October 12, 2018 Share Posted October 12, 2018 A part of my game's post-process render pipeline: Downscale render to 25% size Do some post-processing on the downscaled image Pass both the image before step 1 and the image after step 2 into a GLSL fragment shader with effect.setTextureFromPostProcessOutput(...) Fragment shader outputs the low-res processed image overlaid on top of the original high-res render Problem: The final render is pixelated. I guess the initial downscale made it so the shader doesn't use the higher-res input texture as the "base resolution"? What's going on here? How do I properly set fragment shader input textures of different resolutions in a post-processes? Quote Link to comment Share on other sites More sharing options...
kcoley Posted October 12, 2018 Share Posted October 12, 2018 Hi @williamqin, can you make a playground that repros your issue? Quote Link to comment Share on other sites More sharing options...
williamqin Posted October 13, 2018 Author Share Posted October 13, 2018 (edited) 12 hours ago, kcoley said: Hi @williamqin, can you make a playground that repros your issue? @kcoley https://playground.babylonjs.com/#1YTJCG Edited October 13, 2018 by williamqin Quote Link to comment Share on other sites More sharing options...
BitOfGold Posted October 13, 2018 Share Posted October 13, 2018 Hi! Here you are: https://playground.babylonjs.com/#1YTJCG#1 You need a full res pass to store the original. Quote Link to comment Share on other sites More sharing options...
williamqin Posted October 13, 2018 Author Share Posted October 13, 2018 14 hours ago, BitOfGold said: Hi! Here you are: https://playground.babylonjs.com/#1YTJCG#1 You need a full res pass to store the original. Thank you so much! One more question: what's the difference between setTextureFromPostProcess and setTextureFromPostProcessOutput? Quote Link to comment Share on other sites More sharing options...
BitOfGold Posted October 14, 2018 Share Posted October 14, 2018 setTextureFromPostProcess gets the input texture of the post process, setTextureFromPostProcessOutput gets the result. but a Pass possprocess's output should be the same. I don't know why... Quote Link to comment Share on other sites More sharing options...
Guest Posted October 15, 2018 Share Posted October 15, 2018 On 10/13/2018 at 11:07 PM, BitOfGold said: but a Pass possprocess's output should be the same. I don't know why... Well because it is a Pass postprocess It just pass the data (but can be used to scale up/down) BitOfGold 1 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.