PS: this outline shader is the work of genius mister RRRAPTOR, THANK YOU! I wish you all the best, a special thought for our friend Oleg and his people, and my best wishes to you Nicolas (alias hgy29) Local original =lF4 (fColor ) *texture2D (fTexture, tc ) if (original.a = 0 ) then local step = 1.57079632679 - math.pi/2 - perfect for 1 to 2 pixels outline - local step = 0.78539816339 - math.pi/4 - perfect for 3 to 4 pixels outline - local step = 0.39269908169 - PI/8 - ok for 4+ pixels outline for theta = 0, 6.28318530718, step do - 2 PI local offset = lF2 (fTextureInfo.z * cos (theta ) * outlinesize, fTextureInfo.w * sin (theta ) * outlinesize ) local frag = lF4 (fColor ) *texture2D (fTexture, tc+offset ) - if frag.a ~= 0 then - if (not frag.a = 0) then if frag.a = 0 then -discard() else original =lF4 ( 0, 0, 0, frag.a ) - change outline color here end end end return original Local outlinesize = 1 local tc =fTexCoord-fTextureInfo.zw Local frag =lF4 (fColor ) *texture2D (fTexture, fTexCoord ) if (frag.a = 0.0 ) then discard ( ) end return frag This is my attempt but gideros doesn't like it and throws errors:įunction (vVertex,vColor,vTexCoord ) : Shader My problem is I still don't understand nothing about shaders and I would like to port it to newer gideros version 2022.3.1 Original = lF4 ( 0, 0, 0, frag.a ) - change outline color here end end end return original Local original = lF4 (fColor ) * texture2D (fTexture, tc ) if original.a = 0 then local step = 1.57079632679 - math.pi/2 - perfect for 1 to 2 pixels outline for theta = 0, 6.28318530718, step do - 2 PI local offset = lF2 (fTextureInfo.z * cos (theta ) * outlinesize, fTextureInfo.w * sin (theta ) * outlinesize ) local frag = lF4 (fColor ) * texture2D (fTexture, tc + offset ) if frag.a ~ = 0 then !NEEDS:luashader/a local function makeEffect (name, vshader, fshader )įunction (vVertex, vColor, vTexCoord ) local vertex = hF4 (vVertex, 0.0, 1.0 )įunction ( ) local outlinesize = 1 local tc = fTexCoord - fTextureInfo.zw
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |