Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • This project
    • Loading...
  • Sign in / Register
SRB2
SRB2
  • Project
    • Overview
    • Details
    • Activity
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 265
    • Issues 265
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 74
    • Merge Requests 74
  • Wiki
    • Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Commits
  • Issue Boards
  • STJr
  • SRB2SRB2
  • Merge Requests
  • !1073

Merged
Opened Jul 18, 2020 by Hannu Hanhi@Hannu_Hanhi 
  • Report abuse
Report abuse

Add capability to use model lighting with shaders enabled

The OpenGL API does not allow usage of fixed-function lighting and shaders at the same time, so using model lighting and shaders simultaneously in SRB2 was not possible. This patch fixes that by implementing a shader that replicates the model lighting functionality. This shader is used when model lighting and shaders are both enabled.

Edited Jul 18, 2020 by Hannu Hanhi
×

Check out, review, and merge locally

Step 1. Fetch and check out the branch for this merge request

git fetch https://git.do.srb2.org/Hannu_Hanhi/SRB2.git ogl-model-lighting-shader
git checkout -b Hannu_Hanhi/SRB2-ogl-model-lighting-shader FETCH_HEAD

Step 2. Review the changes locally

Step 3. Merge the branch and fix any conflicts that come up

git checkout next
git merge --no-ff Hannu_Hanhi/SRB2-ogl-model-lighting-shader

Step 4. Push the result of the merge to GitLab

git push origin next

Note that pushing to GitLab requires write access to this repository.

Tip: You can also checkout merge requests locally by following these guidelines.

  • Discussion 3
  • Commits 3
  • Changes 1
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
  • Hannu Hanhi @Hannu_Hanhi

    added 1 commit

    • 92ebbdfc - Don't override custom shaders with model lighting shader

    Compare with previous version

    Jul 18, 2020

    added 1 commit

    • 92ebbdfc - Don't override custom shaders with model lighting shader

    Compare with previous version

    added 1 commit <ul><li>92ebbdfc - Don&#39;t override custom shaders with model lighting shader</li></ul> [Compare with previous version](https://git.magicalgirl.moe/STJr/SRB2/merge_requests/1073/diffs?diff_id=5986&start_sha=c1cf41fb0c0e509eceeb1d2ce58707eb5c290df9)
    Toggle commit list
  • Hannu Hanhi @Hannu_Hanhi

    unmarked as a Work In Progress

    Jul 18, 2020

    unmarked as a Work In Progress

    unmarked as a **Work In Progress**
    Toggle commit list
  • Hannu Hanhi @Hannu_Hanhi

    changed the description

    Jul 18, 2020

    changed the description

    changed the description
    Toggle commit list
  • Hannu Hanhi @Hannu_Hanhi commented Jul 18, 2020

    Should be finished now.

    Should be finished now.
  • Zwip-Zwap Zapony
    @Zwip-Zwap_Zapony started a discussion on the diff Jul 18, 2020
    Last updated by Hannu Hanhi Jul 18, 2020
    src/hardware/r_opengl/r_opengl.c
    1063 1106 #ifdef GL_SHADERS
    1064 1107 if (gl_allowshaders)
    1065 1108 {
    1109 // If using model lighting, set the appropriate shader.
    1110 // However don't override a custom shader.
    1111 // Should use an enum or something...
    1112 if (shader == 4 && model_lighting && !gl_shaderprograms[4].custom)
    1113 shader = 8;
    • Zwip-Zwap Zapony @Zwip-Zwap_Zapony commented Jul 18, 2020

      Does this imply that an add-on shader can't tweak the lighting of a model/override shader 8 if shader 4 is also overriden by an add-on?

      Does this imply that an add-on shader can't tweak the lighting of a model/override shader 8 if shader 4 is also overriden by an add-on?
    • Hannu Hanhi @Hannu_Hanhi commented Jul 18, 2020

      Basically the model lighting option will stop doing anything if the model shader is changed by a mod. Customizing the lighting version of the model shader is not possible unless it's added to the modding API/specs.

      Basically the model lighting option will stop doing anything if the model shader is changed by a mod. Customizing the lighting version of the model shader is not possible unless it's added to the modding API/specs.
    Please register or sign in to reply
  • Hannu Hanhi @Hannu_Hanhi

    added 1 commit

    • b03e7f63 - Fix shader comment

    Compare with previous version

    Jul 19, 2020

    added 1 commit

    • b03e7f63 - Fix shader comment

    Compare with previous version

    added 1 commit <ul><li>b03e7f63 - Fix shader comment</li></ul> [Compare with previous version](https://git.magicalgirl.moe/STJr/SRB2/merge_requests/1073/diffs?diff_id=5988&start_sha=92ebbdfc10cbc503b7ee55ad96c5ccf8fc7af514)
    Toggle commit list
  • James R. @james

    merged

    Aug 05, 2020

    merged

    merged
    Toggle commit list
  • James R. @james

    mentioned in commit cc508d0b

    Aug 05, 2020

    mentioned in commit cc508d0b

    mentioned in commit cc508d0ba389ac07a24d76454eba29aedfd5e7e7
    Toggle commit list
  • Write
  • Preview
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment
Assignee
No assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
0
Labels
None
Assign labels
  • View project labels
Reference: STJr/SRB2!1073
×

Revert this merge request

This will create a new commit in order to revert the existing changes.

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.
×

Cherry-pick this merge request

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.