Edit: I made some changes to this post after fixing the model and making some changes to my specular shader (using exactly what I found in MonoGameEffects/Content/WindowsGL/Shaders at master · kgiannakakis/MonoGameEffects · GitHub)
I’m learning about HLSL with RB Whitaker’s tutorials and applying them to my current MG project. Things were going okay, but I’m having trouble getting Specular Lighting to work correctly.
http://rbwhitaker.wikidot.com/specular-lighting-shader
It’s supposed to look like this:
However, mine is just totally dark.
And yet, if I comment out setting the viewVector of the effect and leave it at it’s default value float3(1, 0, 0); then I at least get this:
So there’s two problems. The helicopter is rotated slightly and it looks like parts of are semi-transparent…? The other problem is the aforementioned problem regarding how the viewVector makes it not show up at all (this probably is just an issue related to the view and not the shader)
Now I have reviewed this MonoGame Effects and changed my Specular.fx copied and pasted the Specular.fx hlsl from the WindowsGL project here MonoGameEffects/Content/WindowsGL/Shaders at master · kgiannakakis/MonoGameEffects · GitHub which has some slight differences.
One thing though. On my MonoGame Pipeline Tool I have the platform set to Windows and my profile set to HiDef. I don’t know if this makes a difference. I tried other settings, like DesktopGL and Reach. But this didn’t make a difference. Do I need to set it to WindowsGL? Because I don’t have that option and I’m not sure how to add it. This pipeline tool is 3.6
Shader code: float4x4 World;float4x4 View;float4x4 Projection;float4 AmbientColor = - Pastebin.com
Source code: using System;using System.Collections.Generic;using System.Linq;using Micr - Pastebin.com
For additional reference, here is what the model looks like using BasicEffect and default lighting