Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

renderer: make dpMaterials collapsed shader from the start, including non-shader images #266

Merged
merged 7 commits into from Jan 21, 2020

Conversation

@illwieckz
Copy link
Member

illwieckz commented Jan 8, 2020

  • now useless very ugly FindMapInStage is now dropped
  • now useless heightmap collapsing code is now dropped
  • extra maps loading for non-shader images is now enabled

as DarkPlaces only supports one kind of lightmap blend operation we can blindly collapse lightmap stages in darkplaces pre-collapsed stages.

So, shader parsing and rendering must be faster, and code is cleaner.

Next step is to merge cube Reflection with lightMapping glsl shader, a lot of code will disappear and bugs with it.

@illwieckz illwieckz changed the title make dpMaterials collapsed shader from the start, including non-shader images renderer: make dpMaterials collapsed shader from the start, including non-shader images Jan 8, 2020
@illwieckz illwieckz added this to To do in Xonotic via automation Jan 8, 2020
@illwieckz

This comment has been minimized.

Copy link
Member Author

illwieckz commented Jan 9, 2020

Now, the remaining bugs in Solarium maps are:

  • rendering issue of scrolling collapsed shader, which is a bug in Dæmon we have in Unvanquished if we attempt to do the same: Dæmon only supports proper multi-texturing on textures without effects applied on them. I get the exact same bugs on my test-water map when disabling water shader, and this test map with related assets are built the Unvanquished way from the start;
  • wrong light curve because of missing sRGB ligthing, something Unvanquished needs if we want physically correct lighting;
  • non-working water shader, something Unvanquished needs if we want good-looking water;
  • dynamic light issues on surfaces with cubemap reflection applied over lightmap since only lightmap stage processes the dynamic lights, something that would affect Unvanquished assets if we used that feature, this is asking for a glsl merge to do them in one stage;
  • issues when strong displacement is applied on textures with discarded fragments (like grids), something that would affect Unvanquished assets if we uses the feature;
  • bad parallax on boxes, which is an issue in xonotic assets (not engine's fault);
  • bad translucent on grass, maybe an issue in xonotic assets (they render fine when using another alpha operation… so maybe the shader does not setup the right operation and darkplaces just not support the other blend mode that may be mistakenly used, like it happens with lightmap blending).

So basically the remaining issues to render properly the Solarium map are :

  1. Bugs or missing features in Dæmon that are unrelated to Xonotic;
  2. Bugs in Xonotic assets… Not our problem.

Alongside Solarium, the Erbium map is even more buggy than Solarium as shaders are mostly garbage trying to push the right buttons and triggers the Darkplaces Q3 compatibility mode than writing correct Q3 shaders. ¯\_(ツ)_/¯

I'm impressed about the number of bugs and how crippled the design of many Dæmon renderer parts.
Most of bugs are due to design issues, or made easier because of them.

It looks like the XreaL renderer was just cut in pieces to hack some quick and dirty doom3 shader compatibility for showcase purposes, but that was not done the future proof way.

@illwieckz illwieckz force-pushed the illwieckz:dpcollapse branch 5 times, most recently from b872ec2 to 26cfa07 Jan 9, 2020
@illwieckz illwieckz force-pushed the illwieckz:dpcollapse branch from 26cfa07 to 6c30355 Jan 18, 2020
{
std::string extraMapName = Str::Format( "%s_%s", colorMapBaseName, parser.suffix );
std::string extraMapName = Str::Format( "%s%s", colorMapBaseName, parser.suffix );

This comment has been minimized.

Copy link
@slipher

slipher Jan 21, 2020

Member

could use + instead of Str::Format

This comment has been minimized.

Copy link
@illwieckz

illwieckz Jan 21, 2020

Author Member
tr_shader.cpp:1809:48: error: invalid operands of types ‘char [64]’ and ‘const char* const’ to binary ‘operator+’
 1809 |    std::string extraMapName = colorMapBaseName + parser.suffix;
      |                               ~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~
      |                               |                         |
      |                               char [64]                 const char* const
illwieckz added 2 commits Jan 8, 2020
- it's now possible to drop the very ugly FindMapInStage
- it's now possible to drop heightmap collapsing code
- enabling extra maps loading for non-shader images will be straightforward

as DarkPlaces only supports one kind of lightmap blend operation
we can blindly collapse lightmap stages in darkplaces pre-collapsed
stages
@illwieckz illwieckz force-pushed the illwieckz:dpcollapse branch from 6c30355 to e19d035 Jan 21, 2020
@illwieckz illwieckz force-pushed the illwieckz:dpcollapse branch from e19d035 to 84a6917 Jan 21, 2020
@illwieckz illwieckz merged commit 060439c into DaemonEngine:master Jan 21, 2020
0 of 2 checks passed
0 of 2 checks passed
continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
Xonotic automation moved this from To do to Done Jan 21, 2020
@illwieckz illwieckz deleted the illwieckz:dpcollapse branch Jan 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Xonotic
  
Done
2 participants
You can’t perform that action at this time.