angus Posted June 20, 2018 Share Posted June 20, 2018 I am writing a shader to do some post-processing and have run in to what I think is a bug in Unigine parameters being passed to shaders. I implemented a post-processing shader by following the documentation at https://developer.unigine.com/en/docs/2.7.1/code/uusl/create_post Repeatedly running "shaders_reload" causes things like completely red screens, occasional correct behaviour, no effects at all and others. The only thing I can think of that could cause this is that the shaders are not being passed their parameters correctly and are instead getting garbage. Link to comment
silent Posted June 20, 2018 Share Posted June 20, 2018 Hi Angus, Did you remove shader cache from previous SDK version? Could you please provide a small sample for debugging and reproduction? Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
angus Posted June 25, 2018 Author Share Posted June 25, 2018 Hi Silent. Sorry for the delay in replying. I've made an example project. It's a bit too big to upload here so you can grab it from http://mars.vm.bytemark.co.uk/HW_3.zip The project was created by following the UUSL tutorial for making a post-processing shader. When the project is run the shader sometimes does not appear to run. Running "shaders_reload" from the console sometimes fixes it but sometimes makes this worse. It's perfectly possible I have made some mistake in creating things but I can't see it. Cheers. Link to comment
andrey-kozlov Posted June 26, 2018 Share Posted June 26, 2018 Hello Angus, There's an error in documentation. Material's attribute parameters_prefix="m" tells that parameter should be referenced as "m_grayscale_power" instead of "grayscale_power" in shader. Renaming fixes the problem. Link to comment
angus Posted June 27, 2018 Author Share Posted June 27, 2018 Thank you. I have changed my code to add the prefix and that has fixed things. Link to comment
Recommended Posts