This repository has been archived on 2023-10-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blender-archive/source/blender/draw/engines/eevee/shaders/shadow_vert.glsl
Jeroen Bakker 4cd191aa29 EEVEE: Intel Shader Compiler Bug
When using Intel GPU EEVEE did not display anything. This was due to an
internal shader compilation bug inside the intel drivers. We had fixed
this for other vertex shaders. The same change we have to apply to other
vert shaders that want to limit the need of Matrix multiplications.
2019-05-16 13:35:02 +02:00

35 lines
778 B
GLSL

in vec3 pos;
in vec3 nor;
#ifdef MESH_SHADER
out vec3 worldPosition;
out vec3 viewPosition;
out vec3 worldNormal;
out vec3 viewNormal;
#endif
void main()
{
#ifdef GPU_INTEL
/* Due to some shader compiler bug, we somewhat
* need to access gl_VertexID to make it work. even
* if it's actually dead code. */
gl_Position.x = float(gl_VertexID);
#endif
vec3 world_pos = point_object_to_world(pos);
gl_Position = point_world_to_ndc(world_pos);
#ifdef MESH_SHADER
worldPosition = world_pos;
viewPosition = point_world_to_view(worldPosition);
worldNormal = normalize(normal_object_to_world(nor));
/* No need to normalize since this is just a rotation. */
viewNormal = normal_world_to_view(worldNormal);
# ifdef USE_ATTR
pass_attr(pos);
# endif
#endif
}