Jump to content

[SOLVED] Shaders behave erratically


photo

Recommended Posts

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

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

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
  • silent changed the title to [SOLVED] Shaders behave erratically
×
×
  • Create New...