Adding ViroKit. Needs AWSCore :(
This commit is contained in:
20
mobile/ios/ViroKit.framework/equirect_to_cube_fsh.glsl
Normal file
20
mobile/ios/ViroKit.framework/equirect_to_cube_fsh.glsl
Normal file
@@ -0,0 +1,20 @@
|
||||
#version 300 es
|
||||
|
||||
in highp vec3 v_world_position;
|
||||
out highp vec4 frag_color;
|
||||
uniform sampler2D equirectangular_map;
|
||||
|
||||
const highp vec2 inv_atan = vec2(0.1591, 0.3183);
|
||||
|
||||
highp vec2 sample_spherical_map(highp vec3 v) {
|
||||
highp vec2 uv = vec2(atan(v.z, v.x), asin(v.y));
|
||||
uv *= inv_atan;
|
||||
uv += 0.5;
|
||||
return uv;
|
||||
}
|
||||
|
||||
void main() {
|
||||
highp vec2 uv = sample_spherical_map(normalize(v_world_position));
|
||||
highp vec3 color = texture(equirectangular_map, uv).rgb;
|
||||
frag_color = vec4(color, 1.0);
|
||||
}
|
||||
Reference in New Issue
Block a user