Skip to content
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
3df4171
coding style improvements
stephengold Nov 10, 2021
a4aa67b
coding style improvements: no wildcard imports (3.3.1)
stephengold Nov 10, 2021
4e94723
RenderContext: import ordering and spacing (3.3.3)
stephengold Nov 10, 2021
d4ef8e8
wrap lines that exceed 110 characters
stephengold Nov 10, 2021
5501c22
single variable per declaration (4.8.2.1)
stephengold Nov 10, 2021
c5b51f8
Caps: mark fallthrough with comments (4.8.4.2)
stephengold Nov 10, 2021
ec70932
RenderContext: "static" before "final" (4.8.7)
stephengold Nov 10, 2021
c09a9df
constant names use CONSTANT_CASE (5.2.4) Note: **API change**
stephengold Nov 10, 2021
fe42773
ignore acronyms in camel case (5.3) Note: **API change**
stephengold Nov 10, 2021
e763ecb
improve the javadoc style:
stephengold Nov 11, 2021
c38faf2
Renderer: re-order block tags (7.1.3)
stephengold Nov 11, 2021
b014ae8
indent block-tag continuations by at least +4 (7.1.3)
stephengold Nov 11, 2021
c4c4242
one blank line before the first block tag (7.1.3)
stephengold Nov 11, 2021
6a13fc3
correct indentation of javadoc in 2 places (7.1.1)
stephengold Nov 11, 2021
8e89c98
TestIDList: ignore acronyms in camel case (5.3)
stephengold Nov 12, 2021
3aa5a20
revisit the javadoc style, reverting portions of e763ecb6
stephengold Nov 12, 2021
a0fc376
one annotation per line (4.8.5)
stephengold Nov 13, 2021
c8ee3ee
add required javadoc (7.3)
stephengold Nov 13, 2021
cc2ac25
Camera: blank line before the first block tag (7.1.2)
stephengold Nov 13, 2021
ffb748b
Camera: revert an unintented change
stephengold Nov 13, 2021
ac034ef
Merge branch 'master' into sgold-style
stephengold Nov 13, 2021
509232e
Camera: change "Determines" to "Returns" in 2 places
stephengold Nov 14, 2021
d2e3397
no trailing spaces
stephengold Nov 15, 2021
d5aafdc
revert API changes
stephengold Nov 19, 2021
911806e
convert comment to javadoc and add missing javadoc
stephengold Nov 20, 2021
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
259 changes: 169 additions & 90 deletions jme3-core/src/main/java/com/jme3/renderer/Camera.java

Large diffs are not rendered by default.

261 changes: 155 additions & 106 deletions jme3-core/src/main/java/com/jme3/renderer/Caps.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,31 @@

/**
* A specialized data-structure used to optimize state changes of "slot"
* based state.
* based state.
*/
public class IDList {
public class IdList {

/**
* Indices belonging to the "new list". Valid data in elements 0 through newLen-1 only!
*/
public int[] newList = new int[16];
/**
* Indices belonging to the "old list". Valid data in elements 0 through oldLen-1 only!
*/
public int[] oldList = new int[16];
/**
* The number of valid elements in the new list.
*/
public int newLen = 0;
/**
* The number of valid elements in the old list.
*/
public int oldLen = 0;

/**
* Reset all states to zero
* Resets all states to zero.
*/
public void reset(){
public void reset() {
newLen = 0;
oldLen = 0;
Arrays.fill(newList, 0);
Expand All @@ -62,21 +74,22 @@ public void reset(){
*
* @param idx The index to move
* @return True if it existed in old list and was removed
* from there, false otherwise.
* from there, false otherwise.
*/
public boolean moveToNew(int idx){
if (newLen == 0 || newList[newLen-1] != idx)
public boolean moveToNew(int idx) {
if (newLen == 0 || newList[newLen - 1] != idx) {
// add item to newList first
newList[newLen++] = idx;
}

// find idx in oldList, if removed successfully, return true.
for (int i = 0; i < oldLen; i++){
if (oldList[i] == idx){
for (int i = 0; i < oldLen; i++) {
if (oldList[i] == idx) {
// found index in slot i
// delete index from old list
oldLen --;
for (int j = i; j < oldLen; j++){
oldList[j] = oldList[j+1];
oldLen--;
for (int j = i; j < oldLen; j++) {
oldList[j] = oldList[j + 1];
}
return true;
}
Expand All @@ -87,32 +100,34 @@ public boolean moveToNew(int idx){
/**
* Copies the new list to the old list, and clears the new list.
*/
public void copyNewToOld(){
public void copyNewToOld() {
System.arraycopy(newList, 0, oldList, 0, newLen);
oldLen = newLen;
newLen = 0;
}

/**
* Prints the contents of the lists
* Prints the contents of the lists.
*/
public void print(){
if (newLen > 0){
public void print() {
if (newLen > 0) {
System.out.print("New List: ");
for (int i = 0; i < newLen; i++){
if (i == newLen -1)
for (int i = 0; i < newLen; i++) {
if (i == newLen - 1) {
System.out.println(newList[i]);
else
System.out.print(newList[i]+", ");
} else {
System.out.print(newList[i] + ", ");
}
}
}
if (oldLen > 0){
if (oldLen > 0) {
System.out.print("Old List: ");
for (int i = 0; i < oldLen; i++){
if (i == oldLen -1)
for (int i = 0; i < oldLen; i++) {
if (i == oldLen - 1) {
System.out.println(oldList[i]);
else
System.out.print(oldList[i]+", ");
} else {
System.out.print(oldList[i] + ", ");
}
}
}
}
Expand Down
78 changes: 75 additions & 3 deletions jme3-core/src/main/java/com/jme3/renderer/Limits.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
package com.jme3.renderer;

/**
* <code>Limits</code> allows querying the limits of certain features in
* Allows querying the limits of certain features in
* {@link Renderer}.
* <p>
* For example, maximum texture sizes or number of samples.
*
* <p>For example, maximum texture sizes or number of samples.
*
* @author Kirill Vainer
*/
Expand All @@ -50,32 +50,104 @@ public enum Limits {
* be used in the fragment shader.
*/
FragmentTextureUnits,
/**
* Maximum number of fragment uniform vectors.
*/
FragmentUniformVectors,
/**
* Maximum number of vertex uniform vectors.
*/
VertexUniformVectors,
/**
* Maximum number of vertex attributes.
*/
VertexAttributes,
/**
* Maximum number of FrameBuffer samples.
*/
FrameBufferSamples,
/**
* Maximum number of FrameBuffer attachments.
*/
FrameBufferAttachments,
/**
* Maximum number of FrameBuffer MRT attachments.
*/
FrameBufferMrtAttachments,
/**
* Maximum render buffer size.
*/
RenderBufferSize,
/**
* Maximum texture size.
*/
TextureSize,
/**
* Maximum cubemap size.
*/
CubemapSize,
/**
* Maximum number of color texture samples.
*/
ColorTextureSamples,
/**
* Maximum number of depth texture samples.
*/
DepthTextureSamples,
/**
* Maximum degree of texture anisotropy.
*/
TextureAnisotropy,

// UBO
/**
* Maximum number of UBOs that may be accessed by a vertex shader.
*/
UniformBufferObjectMaxVertexBlocks,
/**
* Maximum number of UBOs that may be accessed by a fragment shader.
*/
UniformBufferObjectMaxFragmentBlocks,
/**
* Maximum number of UBOs that may be accessed by a geometry shader.
*/
UniformBufferObjectMaxGeometryBlocks,
/**
* Maximum block size of a UBO.
*/
UniformBufferObjectMaxBlockSize,

// SSBO
/**
* Maximum size of an SSBO.
*/
ShaderStorageBufferObjectMaxBlockSize,
/**
* Maximum number of active SSBOs that may be accessed by a vertex shader.
*/
ShaderStorageBufferObjectMaxVertexBlocks,
/**
* Maximum number of active SSBOs that may be accessed by a fragment shader.
*/
ShaderStorageBufferObjectMaxFragmentBlocks,
/**
* Maximum number of active SSBOs that may be accessed by a geometry shader.
*/
ShaderStorageBufferObjectMaxGeometryBlocks,
/**
* Maximum number of active SSBOs that may be accessed by a tessellation control shader.
*/
ShaderStorageBufferObjectMaxTessControlBlocks,
/**
* Maximum number of active SSBOs that may be accessed by a tessellation evaluation shader.
*/
ShaderStorageBufferObjectMaxTessEvaluationBlocks,
/**
* Not implemented yet.
*/
ShaderStorageBufferObjectMaxComputeBlocks,
/**
* Maximum number shader storage blocks across all active programs.
*/
ShaderStorageBufferObjectMaxCombineBlocks,
}
Loading