Commit graph

162 commits

Author SHA1 Message Date
bunnei
c37de30cfc gl_shader_gen: Implement fragment lighting fresnel effect. 2016-02-05 17:20:13 -05:00
bunnei
0e67c21c9e gl_shader_gen: Implement fragment lighting specular 1 component. 2016-02-05 17:19:16 -05:00
bunnei
781b046579 gl_shader_gen: Add support for D0 LUT scaling. 2016-02-05 17:18:36 -05:00
bunnei
3d89dacd56 gl_shader_gen: Refactor lighting config to match Pica register naming.
- Also implement D0 LUT enable.
2016-02-05 17:17:35 -05:00
bunnei
6307999116 pica: Cleanup and add some comments to lighting registers. 2016-02-05 17:17:34 -05:00
bunnei
6878ba7608 gl_rasterizer: Minor naming refactor on Pica register naming. 2016-02-05 17:17:33 -05:00
bunnei
76f303538b gl_shader_gen: Reorganize and cleanup lighting code.
- No functional difference.
2016-02-05 17:17:33 -05:00
bunnei
5f3bad8fb1 gl_shader_gen: Fix directional lights. 2016-02-05 17:17:32 -05:00
bunnei
bdc72d0904 gl_shader_gen: Fix bug with lighting where clamp highlights was only applied to last light. 2016-02-05 17:17:32 -05:00
bunnei
603b619cbe gl_shader_gen: View vector needs to be normalized when computing half angle vector. 2016-02-05 17:17:31 -05:00
bunnei
021cb0bced renderer_opengl: Use textures for fragment shader LUTs instead of UBOs.
- Gets us LUT interpolation for free.
- Some older Intel GPU drivers did not support the big UBOs needed to store the LUTs.
2016-02-05 17:17:31 -05:00
bunnei
bf89870437 renderer_opengl: Initial implementation of basic specular lighting. 2016-02-05 17:17:30 -05:00
bunnei
e34fa6365f renderer_opengl: Implement HW fragment lighting distance attenuation. 2016-02-05 17:17:30 -05:00
bunnei
e9af70eaf3 renderer_opengl: Implement HW fragment lighting LUTs within our default UBO. 2016-02-05 17:17:29 -05:00
bunnei
afbef52516 renderer_opengl: Implement diffuse component of HW fragment lighting. 2016-02-05 17:17:29 -05:00
tfarley
a15f4d1590 hwrasterizer: Use proper cached fb addr/size 2016-02-03 15:52:34 -05:00
Yuri Kunde Schlesner
05356543d9 OpenGL: Downgrade GL_DEBUG_SEVERITY_NOTIFICATION to Debug logging level
The nVidia driver is *extremely* spammy on this category, sending a
message on every buffer or texture upload, slowing down the emulator and
making the log useless.
2016-02-02 22:44:13 -08:00
tfarley
f53dbafdae hwrasterizer: Use depth offset 2016-01-20 21:57:59 -05:00
bunnei
6a261e825c Merge pull request #1196 from linkmauve/khr_debug
Add optional GL_KHR_debug support
2016-01-12 22:54:52 -05:00
Yuri Kunde Schlesner
402692c08d Merge pull request #1267 from yuriks/flipped-framebuffer
OpenGL: Flip framebuffers during transfer rather than when rendering
2015-12-09 20:35:15 -08:00
Yuri Kunde Schlesner
195fedccf0 VideoCore: Unify interface to OpenGL and SW rasterizers
This removes explicit checks sprinkled all over the codebase to instead
just have the SW rasterizer expose an implementation with no-ops for
most operations.
2015-12-07 20:20:38 -08:00
Yuri Kunde Schlesner
03835d04f4 VideoCore: Rename HWRasterizer methods to be less confusing 2015-12-06 19:08:37 -08:00
Yuri Kunde Schlesner
da80ece8b9 OpenGL: Rename cache functions to better match what they actually do 2015-12-06 17:02:52 -08:00
Yuri Kunde Schlesner
cf81e08389 OpenGL: Flip framebuffers during transfer rather than when rendering 2015-12-04 22:23:39 -08:00
Yuri Kunde Schlesner
95dbc6eb0e OpenGL: Add support for glFrontFace in the state tracker 2015-12-04 21:58:26 -08:00
Yuri Kunde Schlesner
e9c209ccc8 PICA: Properly emulate 1-stage delay in the combiner buffer
This was discovered and verified by @fincs. The tev combiner buffer
actually lags behind by one stage, meaning stage 1 reads the initial
color, stage 2 reads stage 0's output, and so on.

Fixes character portraits in Fire Emblem: Awakening and world textures
in Zelda: ALBW. Closes #1140.
2015-11-30 22:45:18 -08:00
bunnei
f008dfbaca renderer_opengl: Fix uniform issues introduced with kemenaran/avoid-explicit-uniform-location. 2015-11-25 22:33:24 -05:00
Pierre de La Morinerie
0735630744 Use regular uniform location
The support for GL_ARB_explicit_uniform_location is not that good
(53% according to http://feedback.wildfiregames.com/report/opengl/feature/GL_ARB_explicit_uniform_location).

This fix the shader compilation on Intel HD 4000 (#1222).
2015-11-25 11:56:11 +01:00
Subv
823ce62f2f FragShader: Use an UBO instead of several individual uniforms 2015-11-18 21:03:56 -05:00
Emmanuel Gil Peyrot
53df67376d OpenGL: Log GL_KHR_debug messages we receive
This allows the driver to communicate errors, warnings and improvement
suggestions about our usage of the API.
2015-10-24 02:30:51 +01:00
bunnei
74186a5f01 gl_shader_gen: Use explicit locations for vertex shader attributes. 2015-10-21 22:29:56 -04:00
bunnei
e663f5c914 gl_shader_gen: Optimize code for AppendAlphaTestCondition.
- Also add a comment to AppendColorCombiner.
2015-10-21 22:29:56 -04:00
bunnei
e7b1f2ae0a gl_rasterizer: Define enum types for each vertex texcoord attribute. 2015-10-21 21:59:47 -04:00
bunnei
0ebcff710e gl_shader_gen: Various cleanups to shader generation. 2015-10-21 21:59:44 -04:00
bunnei
240a3b80d9 gl_rasterizer: Use MMH3 hash for shader cache hey.
- Includes a check to confirm no hash collisions.
2015-10-21 21:58:59 -04:00
bunnei
71edb55114 gl_shader_gen: Require explicit uniform locations.
- Fixes uniform issue on AMD.
2015-10-21 21:54:56 -04:00
bunnei
5ef2df056d gl_shader_gen: Rename 'o' to 'attr' in vertex/fragment shaders. 2015-10-21 21:53:19 -04:00
bunnei
c2c4faef4c gl_shader_gen: AppendAlphaModifier default should be 0.0, not vec4(0.0). 2015-10-21 21:53:18 -04:00
bunnei
bd833b8dd8 gl_shader_gen: Fix bug where TEV stage outputs should be clamped. 2015-10-21 21:53:18 -04:00
bunnei
f2e7f7e101 gl_rasterizer: Add documentation to ShaderCacheKey. 2015-10-21 21:53:17 -04:00
bunnei
4b5141954e gl_shader_gen: Add additional function documentation. 2015-10-21 21:53:17 -04:00
bunnei
2a0a86f629 gl_shader_util: Cleanup header file + add docstring. 2015-10-21 21:53:16 -04:00
bunnei
a74774257e gl_shader_gen: Various cleanups + moved TEV stage generation to its own function. 2015-10-21 21:53:16 -04:00
bunnei
c86b9d4242 renderer_opengl: Refactor shader generation/caching to be more organized + various cleanups. 2015-10-21 21:53:14 -04:00
bunnei
3c057bd3d8 gl_rasterizer: Move logic for creating ShaderCacheKey to a static function. 2015-10-21 21:53:05 -04:00
bunnei
b02a533d94 gl_shader_util: Use vec3 constants for AppendColorCombiner. 2015-10-21 21:51:24 -04:00
bunnei
37b0aa5af7 gl_rasterizer: Fix typo in uploading TEV const color uniforms. 2015-10-21 21:51:24 -04:00
bunnei
82f3e6dc69 gl_shader_util: Fix precision bug with alpha testing.
- Alpha testing is not done with float32 precision, this makes the HW renderer match the SW renderer.
2015-10-21 21:51:23 -04:00
Subv
e3f4233cef Initial implementation of fragment shader generation with caching. 2015-10-21 21:51:23 -04:00
Rohit Nirmal
32391cffdd Silence -Wsign-compare warnings. 2015-10-06 22:16:15 -05:00