Page MenuHome

GPUShader: error: too many samplers in shader.
Closed, InvalidPublic


System Information
Operating system:windows 10
Graphics card:nvidia rtx 2060s

Blender Version
Broken: 2.82, 2.83 ff1040c6fefc
Worked: (newest version of Blender that worked as expected)

Short description of error
When in the viewport I want to switch to Material Preview, the object get pink and I get in the console this error
GPUShader: error: too many samplers in shader.

This happen when I add/link too much mixshader or mixrgb node

Exact steps for others to reproduce the error
Based on the default startup or an attached .blend file (as simple as possible).

As this is specific to this file, I attach the file
If you remove one mixshader or one mixrgb it's ok, the preview is fine

Event Timeline

I think this is intended behavior since its eevee previewing it and a realtime engine has its limits. Maybe someone will corret me but i guess this will get closed as invalid.

So the Material preview mode is using evee engine ?

Well I have tried with evee renderer to test and it's the same pink render
Hence it would be a limitation of evee ?

So the Material preview mode is using evee engine ?

Yes !

Indeed Eevee has some limitations you can't have unlimited textures and or shader nodes inside a material even if yourGPU has enough memory ...
Cycles is also limited but the limitation bar is way higher.

By judging at your screenshot , you can rework you shader to have only one or a few principled nodes : mixing colors instead of mixing shaders . That would make the shader to run faster and it may solve your limitation issue.

I also think this report is more a known limitation rather than a bug...

Jeroen Bakker (jbakker) closed this task as Invalid.Jun 2 2020, 3:00 PM
Jeroen Bakker (jbakker) claimed this task.

This is a hardware limit. The used shader tree uses too many textures that isn't supported by the OpenGL Hardware it is rendering on. Try reducing the number of used textures. Or split your mesh to use multiple materials that only use a subset of the all the needed textures. Or Combine several mask images into a single mask image (store each mask in a single channel).

Ok I have to rethink the way I'm using shaders as it is far from being optimised ;)
Thanks a lot for the advices Paul & Jeroen

I have tried to use mixRGB nodes instead of mixshader nodes so I have replaced 3 mixshader nodes by 3 mixrgb nodes but I still have this problem
Is it normal ?
I must precise that I'm using udim textures

Hello, you should ask these kind of question into related forums such as, the bug tracker should be only used to report bugs...