Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion jme3-core/src/main/java/com/jme3/renderer/Renderer.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2019 jMonkeyEngine
* Copyright (c) 2009-2021 jMonkeyEngine
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -467,4 +467,19 @@ public interface Renderer {
*/
public int getDefaultAnisotropicFilter();

/**
* Test whether images with the sRGB flag will be linearized when read by a
* shader.
*
* @return true for linearization, false for no linearization
*/
public boolean isLinearizeSrgbImages();

/**
* Test whether colors rendered to the main framebuffer undergo
* linear-to-sRGB conversion.
*
* @return true for conversion, false for no conversion
*/
public boolean isMainFrameBufferSrgb();
}
28 changes: 27 additions & 1 deletion jme3-core/src/main/java/com/jme3/renderer/opengl/GLRenderer.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2020 jMonkeyEngine
* Copyright (c) 2009-2021 jMonkeyEngine
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -3286,4 +3286,30 @@ public boolean getAlphaToCoverage() {
public int getDefaultAnisotropicFilter() {
return this.defaultAnisotropicFilter;
}

/**
* Test whether images with the sRGB flag will be linearized when read by a
* shader.
*
* @return true for linearization, false for no linearization
*/
@Override
public boolean isLinearizeSrgbImages() {
return linearizeSrgbImages;
}

/**
* Test whether colors rendered to the main framebuffer undergo
* linear-to-sRGB conversion.
*
* @return true for conversion, false for no conversion
*/
@Override
public boolean isMainFrameBufferSrgb() {
if (!caps.contains(Caps.Srgb)) {
return false;
} else {
return gl.glIsEnabled(GLExt.GL_FRAMEBUFFER_SRGB_EXT);
}
}
}
24 changes: 23 additions & 1 deletion jme3-core/src/main/java/com/jme3/system/NullRenderer.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009-2020 jMonkeyEngine
* Copyright (c) 2009-2021 jMonkeyEngine
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -259,4 +259,26 @@ public boolean getAlphaToCoverage() {
public int getDefaultAnisotropicFilter() {
return 0;
}

/**
* Test whether images with the sRGB flag will be linearized when read by a
* shader.
*
* @return true for linearization, false for no linearization
*/
@Override
public boolean isLinearizeSrgbImages() {
return false;
}

/**
* Test whether colors rendered to the main framebuffer undergo
* linear-to-sRGB conversion.
*
* @return true for conversion, false for no conversion
*/
@Override
public boolean isMainFrameBufferSrgb() {
return false;
}
}