-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Replaces fullscreen quad with a viewport covering triangle #2589
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
Open
zzuegg
wants to merge
9
commits into
jMonkeyEngine:master
Choose a base branch
from
zzuegg:fullscreen_triangle
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+313
−72
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
99ae154
*Add FullscreenTriangle.java
zzuegg 26295f9
*Update Postprocessor to use the new FullscreenTriangle geometry
zzuegg bc6b3bf
Changed post vertex shaders to work with the already correct position…
zzuegg 0e78b63
Revert to the old vertex shader code
zzuegg ea76ce7
Reworked the positions so that the vertex positions are correct with …
zzuegg 8c1bb36
Added support for using fullscreen triangle or quad in `FilterPostPro…
zzuegg e1f0a78
Introduce support for multi-scenario screenshot tests to validate ide…
richardTingle b89fa7c
Updated `TestFog` to support multi-scenario screenshot testing with `…
zzuegg 889fec7
Merge remote-tracking branch 'richardTingle/multi-scenario-screenshot…
zzuegg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
jme3-core/src/main/java/com/jme3/scene/shape/FullscreenTriangle.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| package com.jme3.scene.shape; | ||
|
|
||
| import com.jme3.scene.Mesh; | ||
| import com.jme3.scene.VertexBuffer; | ||
|
|
||
|
|
||
| /** | ||
| * The FullscreenTriangle class defines a mesh representing a single | ||
| * triangle that spans the entire screen. It is typically used in rendering | ||
| * techniques where a fullscreen quad or triangle is needed, such as in | ||
| * post-processing effects or screen-space operations. | ||
| */ | ||
| public class FullscreenTriangle extends Mesh { | ||
|
|
||
| /** | ||
| * Encapsulates the vertex positions for a fullscreen triangle. | ||
| * The positions are transformed by the vertex shader to cover the entire screen. | ||
| */ | ||
| private static final float[] POSITIONS = { | ||
| 0, 0, 0, // -1 -1 0 after vertex shader transform | ||
| 2, 0, 0, // 3 -1 0 after vertex shader transform | ||
| 0, 2, 0 // -1 3 0 after vertex shader transform | ||
| }; | ||
|
|
||
| private static final float[] TEXCOORDS = { | ||
| 0,0, | ||
| 2,0, | ||
| 0,2 | ||
| }; | ||
|
|
||
|
|
||
| public FullscreenTriangle() { | ||
| super(); | ||
| setBuffer(VertexBuffer.Type.Position, 3, POSITIONS); | ||
| setBuffer(VertexBuffer.Type.TexCoord, 2, TEXCOORDS); | ||
| setBuffer(VertexBuffer.Type.Index, 3, new short[]{0, 1, 2}); | ||
| updateBound(); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...eenshot-tests/src/main/java/org/jmonkeyengine/screenshottests/testframework/Scenario.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| package org.jmonkeyengine.screenshottests.testframework; | ||
|
|
||
| import com.jme3.app.state.AppState; | ||
|
|
||
| public class Scenario { | ||
| String scenarioName; | ||
| AppState[] states; | ||
|
|
||
| public Scenario(String scenarioName, AppState... states) { | ||
| this.scenarioName = scenarioName; | ||
| this.states = states; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯