Guest Guest |
Quote
|
2023-09-16 18:03:09 |
|
work on psx shader for coppercube
🔎︎
|
andgameplay Registered User |
Quote
|
2023-09-16 23:31:42 |
|
Great!
|
SamGrady Guest |
Quote
|
2023-09-17 17:15:30 |
|
for now this code work not so good as i need but anyway
function affineUV(opacity, contrast){ var vertexShader = "uniform mat4 mWorldViewProj; \n" + "void main(void) { \n" + " gl_Position = mWorldViewProj * gl_Vertex; \n" + " if (gl_Position.w > 0.0) { \n" + " gl_Position /= gl_Position.w; \n" + " } \n" + " gl_FrontColor = gl_BackColor = vec4(1.0, 1.0, 1.0, "+opacity+"); \n" + " gl_TexCoord[0] = gl_MultiTexCoord0; \n" + "}"; var fragmentShader = "uniform sampler2D myTexture; \n" + "void main(void) { \n" + " vec4 col = texture2D(myTexture, gl_TexCoord[0].st); \n" + " col.rgb = (col.rgb - 0.5) * "+contrast+" + 0.5; \n" + " col *= gl_Color; \n" + " gl_FragColor = col; \n" + "}"; return ccbCreateMaterial(vertexShader, fragmentShader, 13, null); }
|
Dieter Guest |
Quote
|
2023-09-17 21:49:27 |
|
Is it called PSX because it has no texture perspective correction, like those old console games?
|
SamGrady Guest |
Quote
|
2023-09-17 22:26:02 |
|
Dieter yes this code does not incorporate texture perspective correction, also known as texture coordinate perspective correction or perspective correction for texture mapping. Currently, this code does not perform as well as I would like, but I am suck in shaders. Therefore, I am sharing this shader with someone (Sven you know what i mean) in the hope that they can correct and improve its performance.
|