Custom PPSSPP shaders
|
04-09-2018, 04:35 AM
Post: #338
|
|||
|
|||
RE: Custom PPSSPP shaders
whether shader like this can be used in ppsspp? I've tried changing the name of shaders.vert to shaders.fsh but the game screen becomes a black screen
#version 300 es precision highp float; in vec3 position; in mediump vec3 normal; in vec2 texcoord; uniform mat4 u_proj; uniform mat4 u_world; uniform mat4 u_view; uniform vec4 u_uvscaleoffset; uniform vec3 u_lightpos0; uniform lowp vec3 u_lightambient0; uniform lowp vec3 u_lightdiffuse0; uniform vec3 u_lightpos1; uniform lowp vec3 u_lightambient1; uniform lowp vec3 u_lightdiffuse1; uniform vec3 u_lightpos2; uniform lowp vec3 u_lightambient2; uniform lowp vec3 u_lightdiffuse2; uniform lowp vec4 u_ambient; uniform lowp vec3 u_matdiffuse; uniform lowp vec4 u_matspecular; uniform lowp vec3 u_matemissive; uniform lowp vec4 u_matambientalpha; uniform highp vec2 u_fogcoef; out lowp vec4 v_color0; out mediump vec3 v_texcoord; out mediump float v_fogdepth; void main() { vec3 worldpos = (u_world * vec4(position.xyz, 1.0)).xyz; mediump vec3 worldnormal = normalize((u_world * vec4(normal, 0.0)).xyz); vec4 viewPos = u_view * vec4(worldpos, 1.0); gl_Position = u_proj * viewPos; lowp vec4 lightSum0 = u_ambient * u_matambientalpha + vec4(u_matemissive, 0.0); vec3 toLight; lowp vec3 diffuse; mediump float ldot; toLight = u_lightpos0; ldot = max(dot(toLight, worldnormal), 0.0); diffuse = (u_lightdiffuse0 * u_matdiffuse) * ldot; lightSum0.rgb += (u_lightambient0 * u_matambientalpha.rgb + diffuse); toLight = u_lightpos1; ldot = max(dot(toLight, worldnormal), 0.0); diffuse = (u_lightdiffuse1 * u_matdiffuse) * ldot; lightSum0.rgb += (u_lightambient1 * u_matambientalpha.rgb + diffuse); toLight = u_lightpos2; ldot = max(dot(toLight, worldnormal), 0.0); diffuse = (u_lightdiffuse2 * u_matdiffuse) * ldot; lightSum0.rgb += (u_lightambient2 * u_matambientalpha.rgb + diffuse); v_color0 = clamp(lightSum0, 9.0, 1.0); v_texcoord = vec3(texcoord.xy * u_uvscaleoffset.xy, 0.0); v_fogdepth = (viewPos.z + u_fogcoef.x) * u_fogcoef.y; } |
|||
« Next Oldest | Next Newest »
|