Posts

Post not yet marked as solved
6 Replies
I appreciate it! I am working on a local branch. Whoops. But I can promise you that I am lol I am not sure what you mean by type but... My GPU is Intel Iris Plus Graphics 650 1536 MB. My computer is 13-inch, 2017 Macbook pro. I did not think that the branching in the fragment shader would be too much of an issue, and at some point in time I remember reading that you don't want to switch render pipeline states too often as it can be costly. It does seem like a bug though. Unless my fundamental understanding of Metal is broken :) I will mark the previous answer as the correct answer as it seems that we have an implementation issue altogether. Answer: Different Pipeline States || .hasWhateverTexture. How do I submit a bug ticket?
Post not yet marked as solved
6 Replies
Ok i am sending hasBaseTexture / hasNormalMapTexture with the material and that works. Is this what you would suggest?
Post not yet marked as solved
6 Replies
Hey thank you for answering! I have tried using individual renderPipelineStates and one singular renderPipelineState, the result is the same. The Well gets rendered first and the Quad is rendered right after using the same renderPassDescriptor and currently the same renderPipelineState. If you need more info just search "Metal Shading Language Texture Will Not Clear" in stackoverflow. that is my post. fragment half4 basic_fragment_shader(RasterizerData rd [[ stage_in ]],                    constant Material &material [[ buffer(1) ]],                    constant int &lightCount [[ buffer(2) ]],                    constant LightData *lightDatas [[ buffer(3) ]],                    sampler sampler2d [[ sampler(0) ]],                    texture2d<float> baseColorMap [[ texture(0) ]],                    texture2d<float> normalMap [[ texture(1) ]]){   float2 texCoord = rd.textureCoordinate;       float4 color = material.color;   if(!is_null_texture(baseColorMap)) {     color = baseColorMap.sample(sampler2d, texCoord);   }       return half4(color.r, color.g, color.b, color.a); } The reason I am setting them to nil is because the documentation states that nil is the default value. I will try to play around with the samplers to see if they could be the culprit. Do you maybe suggest that I pass the values as "model.hasBaseTexture" instead of is_null_texture()? I do not like this solution but it would work!