Commit Graph

131 Commits

Author SHA1 Message Date
Unknown W. Brackets 2e91adc607 Oops, revert software transform breakage.
It will deal with getting the coords right, including in projection modes.
2014-01-18 15:44:04 -08:00
Unknown W. Brackets 6eb493a842 Use 0 for texcoord when not specified in vertex.
Can't find any other unprotected attributes (well, position, but that
should always be specified) so this fixes #5133.

Also fixes #5124 for me.
2014-01-18 14:57:25 -08:00
Henrik Rydgård 5dbc26aec8 Merge pull request #4937 from unknownbrackets/gpu-minor
Ignore material update when no vertex color, softgpu vertex preview
2013-12-29 13:49:24 -08:00
Unknown W. Brackets 25bc394284 Ignore the material update flag w/o vertex color.
Instead of using materialambient for all of them.

Fixes #3918, and seems to match tests with 3dstudio.
2013-12-29 12:57:30 -08:00
Henrik Rydgård 64717d1b02 Shaders: Make sure to always use matching versions.
Really should unify this somehow.
2013-12-29 12:27:19 +01:00
Henrik Rydgard 0a1514161d GLSL 3.0 fix 2013-12-18 11:22:31 +01:00
Henrik Rydgard 832c933cb8 Some shader fixes 2013-12-17 23:38:58 +01:00
Henrik Rydgard 214cc01976 Fix bugs in stencil2alpha, fix bugs in glsl 3 support, enable dual source blending where available
The stencil2alpha bug fixes fix some glows in Wipeout, dual source fixes the rest.
2013-12-15 12:49:13 +01:00
Henrik Rydgard 3cde4921ae Have the shader generators generate modern GLSL if available.
This opens up to use other modern features like dual source alpha later.
2013-12-15 11:23:27 +01:00
Henrik Rydgard 628bf497dd Hopefully fix UV scaling properly this time.
Check the faces in Hexyz Force please.
2013-12-08 11:52:20 +01:00
Henrik Rydgard 95d5c28720 Fix bug where we scaled UV coordinates twice when a tex matrix was used. 2013-12-04 14:20:42 +01:00
Henrik Rydgard eea8413a82 Make the texcoord speedhack a bit less aggressive at eliminating uvscaleoffset uniform updates.
Should fix #4688 and the new problem in #2919 while keeping Frontier Gate Boost working.
2013-11-30 15:54:20 +01:00
Henrik Rydgard e3d471f590 Fix issues with texturing from render targets with prescaled UV (texcoord speed hack) 2013-11-19 23:38:36 +01:00
Henrik Rydgård 4d3e57d6eb Move normal reversion into the vertex shader instead of the decoder. 2013-11-02 11:05:31 +01:00
Henrik Rydgård 0471a8c886 Only set fogdepth to highp on PowerVR. May fix #4333 2013-10-28 15:38:25 +01:00
Unknown W. Brackets ac027fac81 Fix missing uniform for GE_TEXMAP_TEXTURE_MATRIX. 2013-10-24 21:59:44 -07:00
Henrik Rydgard 5d47aabb08 Seems we need high precision for fog on PowerVR. #4287 might be fixed by this. 2013-10-22 19:56:06 +02:00
Henrik Rydgård 4b019bfcbb Remove '_' from attribute names as Adreno hates them in glBindAttribLocation.
Sigh.

Also remove some logging.
2013-10-08 17:26:33 +02:00
Henrik Rydgard f645988b8f More precision annotations in shader generators, other microoptimizations 2013-10-07 20:15:00 +02:00
raven02 7f3a3ccd6c Projection mapping : Initialize z as 1.0f 2013-10-01 09:01:38 +08:00
Henrik Rydgard 01def3b6cc Missed these 2013-09-21 23:44:11 +02:00
Henrik Rydgard 82e5787bbe Preparation for proper spline/bez: Convert control points to a simple format.
The bezier/spline code will no longer need to handle morph and splines,
when it's finally written. This is done by pre-skinning in software and
pre-decoding to get rid of the morph.
2013-09-21 23:37:14 +02:00
raven02 8ccaa733b9 Use and applu new bool , doShadeMapping 2013-09-14 14:29:37 +08:00
raven02 ef2399d5b3 Use GE state accessor more often : gstate.isSkinningEnabled() 2013-09-14 14:11:25 +08:00
Unknown W. Brackets 0e82ecca86 Fix lighting when lightpos and spec coef are 0.
Zero to the power of zero is mathematically undefined, NVIDIA chokes but
AMD seems to accept it.  Not well tested on Android.

Fixes #2424.
2013-09-01 03:11:02 -07:00
Unknown W. Brackets 7f6cf3ec29 Add a few gstate accessors for texture type stuff. 2013-08-24 11:34:37 -07:00
Henrik Rydgård d9897719b7 Merge pull request #3260 from raven02/patch-8
Treat light type 3 as GE_LIGHTTYPE_SPOT
2013-08-20 05:13:26 -07:00
raven02 4899f67fa1 Missing one case type == GE_LIGHTTYPE_UNKNOWN 2013-08-20 19:43:26 +08:00
raven02 a328bc968c HW: Use GETexProjMapMode constants 2013-08-20 11:56:43 +08:00
raven02 4e533adf52 HW : Treat light type 3 as light type 2 2013-08-20 11:43:18 +08:00
Unknown W. Brackets 12c5f5e1e6 Use constants for other uv gen mode usages.
And also change them to treat 3 as coords as well.
2013-08-19 00:43:54 -07:00
raven02 0daa550538 Add getWeightMask() 2013-07-30 23:55:11 +08:00
raven02 ba458bf421 VertexShader : Set case 3 as default #1 2013-07-29 16:53:06 +08:00
Unknown W. Brackets 7b7801d59a Switch to including Windows.h from an intermediate.
This makes it easier for Xbox which uses a separate header.
2013-07-28 21:04:19 -07:00
Henrik Rydgard 50a2d1b87f More work on prescaled UV 2013-07-28 00:33:51 +02:00
Henrik Rydgard 2eaf581bbe Add experimental UV prescaling hack, hidden as it's not finished yet.
Most people should ignore this for now, it's a step towards faster skinning in the future.
2013-07-27 23:23:17 +02:00
Henrik Rydgard 8602c276ca Remove that silly factor 2 for floating point texcoords and weights.
No longer needed since we treat the various vertex formats separately.
2013-07-27 22:14:34 +02:00
Henrik Rydgard e36e976877 Collapse skinning shaders with #bones < 4 to a single one.
Significant perf win for skinned characters in FF:CC and maybe other games.
2013-07-27 20:09:22 +02:00
Henrik Rydgard 0ae3c041d2 Minor shader simplification 2013-07-27 18:16:32 +02:00
Unknown W. Brackets abd9dc6137 Use the light computation/type GE accessors. 2013-07-21 19:44:30 -07:00
Unknown W. Brackets 988614f6d0 Use lightning GE state accessors where appropriate. 2013-07-21 19:44:30 -07:00
Henrik Rydgard bf1e07661a Cheap HW transform solution for raven02's texture scaling fix. 2013-07-10 01:23:35 +02:00
Henrik Rydgard 79110638c9 Unbreak things (silly mistake in last commit, remove *2.0 factor which just can't be right) 2013-07-06 22:50:06 +02:00
raven02 23a22a4931 HW : revert multiple with 2.0 2013-07-06 22:47:35 +08:00
raven02 7983bdb448 HW T&L: remove multiple with 2.0 2013-07-01 08:12:43 +08:00
Henrik Rydgard afb596f3c3 Reorder things a little in VertexShaderGenerator. Strangely solves a specular lighting issue I saw. 2013-06-24 19:11:04 +02:00
Henrik Rydgard 6a9e6ce5fe Simplify vertex shaders a little more in the common case of directional lights. 2013-06-24 00:29:30 +02:00
Henrik Rydgard 916184d2f4 Optimize the most common light type, directional, by doing the normalization beforehand. May shorten some shaders below Mali's limit with luck. 2013-06-20 23:30:21 +02:00
Henrik Rydgard e7097ca95a Fall back to software transform when hardware transform fails. Should help Mali devices.
This is done per shader so the speed hit should not be as bad as turning hw transform off entirely.
Displays a red error at the top of the screen so that we don't trigger this accidentally.
2013-06-06 10:09:37 +02:00
Unknown W. Brackets d3e488400c Multiply by the base color in ambient lighting.
JPCSP seems to do it this way.  Fixes #1692, and makes it consistent with
specular and diffuse, which seems right.
2013-06-04 22:54:19 -07:00