edge polygon gen fix + logo
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit

This commit is contained in:
austin 2024-11-20 13:23:55 -05:00
parent 047e6af24f
commit fe8466c2f8
11 changed files with 198 additions and 130 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

View File

@ -1,3 +1,3 @@
#maven.buildNumber.plugin properties file #maven.buildNumber.plugin properties file
#Sat Nov 16 20:18:53 EST 2024 #Wed Nov 20 13:22:48 EST 2024
buildNumber=390 buildNumber=392

View File

@ -1086,6 +1086,10 @@ Optimize data passing from voxel rasterizer to model generation
Vector pooling in transvoxel rasterizer Vector pooling in transvoxel rasterizer
Fix invalid normals from transvoxel rasterizer Fix invalid normals from transvoxel rasterizer
(11/20/2024)
Design storm engine icon
Fix edge-polygon generation for invalid cases
Add engine logo to title menu
# TODO # TODO

View File

@ -8,8 +8,10 @@ import electrosphere.engine.loadingthreads.LoadingThread;
import electrosphere.engine.loadingthreads.LoadingThread.LoadingThreadType; import electrosphere.engine.loadingthreads.LoadingThread.LoadingThreadType;
import electrosphere.renderer.ui.elements.Button; import electrosphere.renderer.ui.elements.Button;
import electrosphere.renderer.ui.elements.Div; import electrosphere.renderer.ui.elements.Div;
import electrosphere.renderer.ui.elements.ImagePanel;
import electrosphere.renderer.ui.elements.Label; import electrosphere.renderer.ui.elements.Label;
import electrosphere.renderer.ui.elementtypes.ContainerElement.YogaAlignment; import electrosphere.renderer.ui.elementtypes.ContainerElement.YogaAlignment;
import electrosphere.renderer.ui.elementtypes.ContainerElement.YogaFlexDirection;
import electrosphere.renderer.ui.elementtypes.ContainerElement.YogaJustification; import electrosphere.renderer.ui.elementtypes.ContainerElement.YogaJustification;
import electrosphere.renderer.ui.elementtypes.Element; import electrosphere.renderer.ui.elementtypes.Element;
@ -25,61 +27,88 @@ public class MenuGeneratorsTitleMenu {
public static Element createTitleMenu(){ public static Element createTitleMenu(){
Div rVal = Div.createDiv(); Div rVal = Div.createDiv();
//top-bottom //top-bottom
rVal.setJustifyContent(YogaJustification.Center); rVal.setJustifyContent(YogaJustification.Between);
//left-right //left-right
rVal.setAlignItems(YogaAlignment.Center); rVal.setAlignItems(YogaAlignment.Center);
rVal.setAlignContent(YogaAlignment.Center);
rVal.setFlexGrow(1.0f); rVal.setFlexGrow(1.0f);
rVal.setFlexDirection(YogaFlexDirection.Column);
//label (title)
Label titleLabel = Label.createLabel("ORPG");
rVal.addChild(titleLabel);
//button (multiplayer) //main option panel
rVal.addChild(Button.createButtonCentered("Singleplayer", () -> { {
WindowUtils.replaceMainMenuContents(MenuGenerators.createWorldSelectMenu()); Div optionPanel = Div.createCol();
}).setOnClickAudio(AssetDataStrings.UI_TONE_BUTTON_TITLE)); optionPanel.setAlignItems(YogaAlignment.Center);
optionPanel.setJustifyContent(YogaJustification.Center);
optionPanel.setFlexGrow(1.0f);
//button (multiplayer)
rVal.addChild(Button.createButtonCentered("Multiplayer", () -> {
WindowUtils.replaceMainMenuContents(MenuGenerators.createMultiplayerMenu());
}).setOnClickAudio(AssetDataStrings.UI_TONE_BUTTON_TITLE));
//button (static level) //label (title)
rVal.addChild(Button.createButtonCentered("Level Editor", () -> { Label titleLabel = Label.createLabel("ORPG");
WindowUtils.replaceMainMenuContents(MenuGeneratorsLevelEditor.createLevelEditorTopMenu()); optionPanel.addChild(titleLabel);
}).setOnClickAudio(AssetDataStrings.UI_TONE_BUTTON_TITLE));
//button (options) //button (multiplayer)
rVal.addChild(Button.createButtonCentered("Options", () -> { optionPanel.addChild(Button.createButtonCentered("Singleplayer", () -> {
WindowUtils.replaceMainMenuContents(MenuGenerators.createOptionsMainMenu()); WindowUtils.replaceMainMenuContents(MenuGenerators.createWorldSelectMenu());
}).setOnClickAudio(AssetDataStrings.UI_TONE_BUTTON_TITLE)); }).setOnClickAudio(AssetDataStrings.UI_TONE_BUTTON_TITLE));
//button (sp debug) //button (multiplayer)
rVal.addChild(Button.createButtonCentered("Debug SP Quickstart", () -> { optionPanel.addChild(Button.createButtonCentered("Multiplayer", () -> {
LoadingThread loadingThread = new LoadingThread(LoadingThreadType.DEBUG_RANDOM_SP_WORLD); WindowUtils.replaceMainMenuContents(MenuGenerators.createMultiplayerMenu());
Globals.RUN_CLIENT = true; }).setOnClickAudio(AssetDataStrings.UI_TONE_BUTTON_TITLE));
Globals.RUN_SERVER = true;
Globals.threadManager.start(loadingThread);
}).setOnClickAudio(AssetDataStrings.UI_TONE_BUTTON_TITLE));
//button (sp debug) //button (static level)
rVal.addChild(Button.createButtonCentered("Load Test Generation Realm", () -> { optionPanel.addChild(Button.createButtonCentered("Level Editor", () -> {
LoadingThread loadingThread = new LoadingThread(LoadingThreadType.CHUNK_GENERATION_REALM); WindowUtils.replaceMainMenuContents(MenuGeneratorsLevelEditor.createLevelEditorTopMenu());
Globals.RUN_CLIENT = true; }).setOnClickAudio(AssetDataStrings.UI_TONE_BUTTON_TITLE));
Globals.RUN_SERVER = true;
Globals.threadManager.start(loadingThread);
}).setOnClickAudio(AssetDataStrings.UI_TONE_BUTTON_TITLE));
//button (ui testing) //button (options)
rVal.addChild(Button.createButtonCentered("UI Testing", () -> { optionPanel.addChild(Button.createButtonCentered("Options", () -> {
WindowUtils.replaceMainMenuContents(MenuGeneratorsUITesting.createUITestMenu()); WindowUtils.replaceMainMenuContents(MenuGenerators.createOptionsMainMenu());
}).setOnClickAudio(AssetDataStrings.UI_TONE_BUTTON_TITLE)); }).setOnClickAudio(AssetDataStrings.UI_TONE_BUTTON_TITLE));
//button (Viewport Test) //button (sp debug)
rVal.addChild(Button.createButtonCentered("Viewport Test", () -> { optionPanel.addChild(Button.createButtonCentered("Debug SP Quickstart", () -> {
Globals.threadManager.start(new LoadingThread(LoadingThreadType.LOAD_VIEWPORT)); LoadingThread loadingThread = new LoadingThread(LoadingThreadType.DEBUG_RANDOM_SP_WORLD);
}).setOnClickAudio(AssetDataStrings.UI_TONE_BUTTON_TITLE)); Globals.RUN_CLIENT = true;
Globals.RUN_SERVER = true;
Globals.threadManager.start(loadingThread);
}).setOnClickAudio(AssetDataStrings.UI_TONE_BUTTON_TITLE));
//button (sp debug)
optionPanel.addChild(Button.createButtonCentered("Load Test Generation Realm", () -> {
LoadingThread loadingThread = new LoadingThread(LoadingThreadType.CHUNK_GENERATION_REALM);
Globals.RUN_CLIENT = true;
Globals.RUN_SERVER = true;
Globals.threadManager.start(loadingThread);
}).setOnClickAudio(AssetDataStrings.UI_TONE_BUTTON_TITLE));
//button (ui testing)
optionPanel.addChild(Button.createButtonCentered("UI Testing", () -> {
WindowUtils.replaceMainMenuContents(MenuGeneratorsUITesting.createUITestMenu());
}).setOnClickAudio(AssetDataStrings.UI_TONE_BUTTON_TITLE));
//button (Viewport Test)
optionPanel.addChild(Button.createButtonCentered("Viewport Test", () -> {
Globals.threadManager.start(new LoadingThread(LoadingThreadType.LOAD_VIEWPORT));
}).setOnClickAudio(AssetDataStrings.UI_TONE_BUTTON_TITLE));
rVal.addChild(optionPanel);
}
//footer
{
Div footer = Div.createRow();
footer.setJustifyContent(YogaJustification.End);
footer.setWidthPercent(100.0f);
ImagePanel engineLogoPanel = ImagePanel.createImagePanel(AssetDataStrings.UI_ENGINE_LOGO_1);
engineLogoPanel.setMinWidth(50);
engineLogoPanel.setMinHeight(50);
footer.addChild(engineLogoPanel);
rVal.addChild(footer);
}
return rVal; return rVal;
} }

View File

@ -602,6 +602,7 @@ public class Globals {
"Textures/ui/uiFrame1.png", "Textures/ui/uiFrame1.png",
"Textures/ui/uiFrame2.png", "Textures/ui/uiFrame2.png",
"Textures/ui/uiOutline1.png", "Textures/ui/uiOutline1.png",
AssetDataStrings.UI_ENGINE_LOGO_1,
"Textures/ui/circle.png", "Textures/ui/circle.png",
"Textures/ui/square.png", "Textures/ui/square.png",
"Textures/color/transparent_green.png", "Textures/color/transparent_green.png",

View File

@ -21,6 +21,7 @@ public class AssetDataStrings {
/** /**
* UI textures * UI textures
*/ */
public static final String UI_ENGINE_LOGO_1 = "Textures/engine/stormenginelogo1.png";
public static final String UI_FRAME_TEXTURE_DEFAULT_1 = "Textures/ui/uiFrame1.png"; public static final String UI_FRAME_TEXTURE_DEFAULT_1 = "Textures/ui/uiFrame1.png";
public static final String UI_FRAME_TEXTURE_DEFAULT_2 = "Textures/ui/uiFrame2.png"; public static final String UI_FRAME_TEXTURE_DEFAULT_2 = "Textures/ui/uiFrame2.png";

View File

@ -767,6 +767,11 @@ public class TransvoxelModelGeneration {
float firstSample = TransvoxelModelGeneration.getTransvoxelSampleValue(transitionCell.simpleFaceValues,transitionCell.complexFaceValues,firstCornerSampleIndex); float firstSample = TransvoxelModelGeneration.getTransvoxelSampleValue(transitionCell.simpleFaceValues,transitionCell.complexFaceValues,firstCornerSampleIndex);
float secondSample = TransvoxelModelGeneration.getTransvoxelSampleValue(transitionCell.simpleFaceValues,transitionCell.complexFaceValues,secondCornerSampleIndex); float secondSample = TransvoxelModelGeneration.getTransvoxelSampleValue(transitionCell.simpleFaceValues,transitionCell.complexFaceValues,secondCornerSampleIndex);
//skip if it's 0-0 or 0-negative number
if(firstSample <= 0 && secondSample <= 0){
continue;
}
// //
//Sample check -- we should never be interpolating between two samples of 0 value //Sample check -- we should never be interpolating between two samples of 0 value
if(firstSample < 0 && secondSample < 0){ if(firstSample < 0 && secondSample < 0){
@ -834,6 +839,12 @@ public class TransvoxelModelGeneration {
Vector3f vert1 = vertList[triangleData.vertexIndex[i+1]]; Vector3f vert1 = vertList[triangleData.vertexIndex[i+1]];
Vector3f vert2 = vertList[triangleData.vertexIndex[i+2]]; Vector3f vert2 = vertList[triangleData.vertexIndex[i+2]];
//the verts can be zero if the samples are 0 and a negative number
//in this case, we don't want to generate triangles
if(vert0 == null || vert1 == null || vert2 == null){
continue;
}
LoggerInterface.loggerRenderer.DEBUG(vert0 + ""); LoggerInterface.loggerRenderer.DEBUG(vert0 + "");
LoggerInterface.loggerRenderer.DEBUG(vert1 + ""); LoggerInterface.loggerRenderer.DEBUG(vert1 + "");
LoggerInterface.loggerRenderer.DEBUG(vert2 + ""); LoggerInterface.loggerRenderer.DEBUG(vert2 + "");
@ -1794,92 +1805,92 @@ public class TransvoxelModelGeneration {
//xn-zn edge //xn-zn edge
if(chunkData.xNegativeEdgeIso != null && chunkData.zNegativeEdgeIso != null){ // if(chunkData.xNegativeEdgeIso != null && chunkData.zNegativeEdgeIso != null){
int x = 0; // int x = 0;
int z = 0; // int z = 0;
int edgeLength = chunkWidth - (chunkData.yNegativeEdgeIso != null ? 1 : 0) - (chunkData.yPositiveEdgeIso != null ? 1 : 0); // int edgeLength = chunkWidth - (chunkData.yNegativeEdgeIso != null ? 1 : 0) - (chunkData.yPositiveEdgeIso != null ? 1 : 0);
int startIndex = 0 + (chunkData.yNegativeEdgeIso != null ? 1 : 0); // int startIndex = 0 + (chunkData.yNegativeEdgeIso != null ? 1 : 0);
for(int i = startIndex; i < edgeLength - 1; i++){ // for(int i = startIndex; i < edgeLength - 1; i++){
int y = i; // int y = i;
// // //
//Generate the x-side transition cell // //Generate the x-side transition cell
// // //
currentTransitionCell.setValues( // currentTransitionCell.setValues(
//complex face vertex coordinates // //complex face vertex coordinates
new Vector3f(x,y,z), new Vector3f(x,y+TRANSITION_CELL_WIDTH,z), new Vector3f(x,y+1,z), // new Vector3f(x,y,z), new Vector3f(x,y+TRANSITION_CELL_WIDTH,z), new Vector3f(x,y+1,z),
new Vector3f(x,y,z+TRANSITION_CELL_WIDTH), new Vector3f(x,y+TRANSITION_CELL_WIDTH,z+TRANSITION_CELL_WIDTH), new Vector3f(x,y+1,z+TRANSITION_CELL_WIDTH), // new Vector3f(x,y,z+TRANSITION_CELL_WIDTH), new Vector3f(x,y+TRANSITION_CELL_WIDTH,z+TRANSITION_CELL_WIDTH), new Vector3f(x,y+1,z+TRANSITION_CELL_WIDTH),
new Vector3f(x,y,z+1), new Vector3f(x,y+TRANSITION_CELL_WIDTH,z+1), new Vector3f(x,y+1,z+1), // new Vector3f(x,y,z+1), new Vector3f(x,y+TRANSITION_CELL_WIDTH,z+1), new Vector3f(x,y+1,z+1),
//simple face vertex coordinates // //simple face vertex coordinates
new Vector3f(x+TRANSITION_CELL_WIDTH,y,z+TRANSITION_CELL_WIDTH), new Vector3f(x+TRANSITION_CELL_WIDTH,y+1,z+TRANSITION_CELL_WIDTH), // new Vector3f(x+TRANSITION_CELL_WIDTH,y,z+TRANSITION_CELL_WIDTH), new Vector3f(x+TRANSITION_CELL_WIDTH,y+1,z+TRANSITION_CELL_WIDTH),
new Vector3f(x+TRANSITION_CELL_WIDTH,y,z+1), new Vector3f(x+TRANSITION_CELL_WIDTH,y+1,z+1), // new Vector3f(x+TRANSITION_CELL_WIDTH,y,z+1), new Vector3f(x+TRANSITION_CELL_WIDTH,y+1,z+1),
//complex face iso values // //complex face iso values
chunkData.xNegativeEdgeIso[(y+0)*2+0][(z+0)*2+0], chunkData.xNegativeEdgeIso[(y+0)*2+1][(z+0)*2+0], chunkData.xNegativeEdgeIso[(y+1)*2+0][(z+0)*2+0], // chunkData.xNegativeEdgeIso[(y+0)*2+0][(z+0)*2+0], chunkData.xNegativeEdgeIso[(y+0)*2+1][(z+0)*2+0], chunkData.xNegativeEdgeIso[(y+1)*2+0][(z+0)*2+0],
chunkData.xNegativeEdgeIso[(y+0)*2+0][(z+0)*2+1], chunkData.xNegativeEdgeIso[(y+0)*2+1][(z+0)*2+1], chunkData.xNegativeEdgeIso[(y+1)*2+0][(z+0)*2+1], // chunkData.xNegativeEdgeIso[(y+0)*2+0][(z+0)*2+1], chunkData.xNegativeEdgeIso[(y+0)*2+1][(z+0)*2+1], chunkData.xNegativeEdgeIso[(y+1)*2+0][(z+0)*2+1],
chunkData.xNegativeEdgeIso[(y+0)*2+0][(z+1)*2+0], chunkData.xNegativeEdgeIso[(y+0)*2+1][(z+1)*2+0], chunkData.xNegativeEdgeIso[(y+1)*2+0][(z+1)*2+0], // chunkData.xNegativeEdgeIso[(y+0)*2+0][(z+1)*2+0], chunkData.xNegativeEdgeIso[(y+0)*2+1][(z+1)*2+0], chunkData.xNegativeEdgeIso[(y+1)*2+0][(z+1)*2+0],
//simple face iso values // //simple face iso values
chunkData.xNegativeEdgeIso[(y+0)*2+0][(z+0)*2+0], chunkData.xNegativeEdgeIso[(y+1)*2+0][(z+0)*2+0], // chunkData.xNegativeEdgeIso[(y+0)*2+0][(z+0)*2+0], chunkData.xNegativeEdgeIso[(y+1)*2+0][(z+0)*2+0],
chunkData.xNegativeEdgeIso[(y+0)*2+0][(z+1)*2+0], chunkData.xNegativeEdgeIso[(y+1)*2+0][(z+1)*2+0], // chunkData.xNegativeEdgeIso[(y+0)*2+0][(z+1)*2+0], chunkData.xNegativeEdgeIso[(y+1)*2+0][(z+1)*2+0],
//complex face texture atlas values // //complex face texture atlas values
chunkData.xNegativeEdgeAtlas[(y+0)*2+0][(z+0)*2+0], chunkData.xNegativeEdgeAtlas[(y+0)*2+1][(z+0)*2+0], chunkData.xNegativeEdgeAtlas[(y+1)*2+0][(z+0)*2+0], // chunkData.xNegativeEdgeAtlas[(y+0)*2+0][(z+0)*2+0], chunkData.xNegativeEdgeAtlas[(y+0)*2+1][(z+0)*2+0], chunkData.xNegativeEdgeAtlas[(y+1)*2+0][(z+0)*2+0],
chunkData.xNegativeEdgeAtlas[(y+0)*2+0][(z+0)*2+1], chunkData.xNegativeEdgeAtlas[(y+0)*2+1][(z+0)*2+1], chunkData.xNegativeEdgeAtlas[(y+1)*2+0][(z+0)*2+1], // chunkData.xNegativeEdgeAtlas[(y+0)*2+0][(z+0)*2+1], chunkData.xNegativeEdgeAtlas[(y+0)*2+1][(z+0)*2+1], chunkData.xNegativeEdgeAtlas[(y+1)*2+0][(z+0)*2+1],
chunkData.xNegativeEdgeAtlas[(y+0)*2+0][(z+1)*2+0], chunkData.xNegativeEdgeAtlas[(y+0)*2+1][(z+1)*2+0], chunkData.xNegativeEdgeAtlas[(y+1)*2+0][(z+1)*2+0], // chunkData.xNegativeEdgeAtlas[(y+0)*2+0][(z+1)*2+0], chunkData.xNegativeEdgeAtlas[(y+0)*2+1][(z+1)*2+0], chunkData.xNegativeEdgeAtlas[(y+1)*2+0][(z+1)*2+0],
//simple face texture atlas values // //simple face texture atlas values
chunkData.xNegativeEdgeAtlas[(y+0)*2+0][(z+0)*2+0], chunkData.xNegativeEdgeAtlas[(y+1)*2+0][(z+0)*2+0], // chunkData.xNegativeEdgeAtlas[(y+0)*2+0][(z+0)*2+0], chunkData.xNegativeEdgeAtlas[(y+1)*2+0][(z+0)*2+0],
chunkData.xNegativeEdgeAtlas[(y+0)*2+0][(z+1)*2+0], chunkData.xNegativeEdgeAtlas[(y+1)*2+0][(z+1)*2+0] // chunkData.xNegativeEdgeAtlas[(y+0)*2+0][(z+1)*2+0], chunkData.xNegativeEdgeAtlas[(y+1)*2+0][(z+1)*2+0]
); // );
TransvoxelModelGeneration.polygonizeTransition(currentTransitionCell, TerrainChunkModelGeneration.MIN_ISO_VALUE, triangles, samplerTriangles, vertMap, verts, normals, trianglesSharingVert, false); // TransvoxelModelGeneration.polygonizeTransition(currentTransitionCell, TerrainChunkModelGeneration.MIN_ISO_VALUE, triangles, samplerTriangles, vertMap, verts, normals, trianglesSharingVert, false);
// // //
//Generate the z-side transition cell // //Generate the z-side transition cell
// // //
currentTransitionCell.setValues( // currentTransitionCell.setValues(
//complex face vertex coordinates // //complex face vertex coordinates
new Vector3f(x+0, y,z), new Vector3f(x+0, y+TRANSITION_CELL_WIDTH,z), new Vector3f(x+0, y+1,z), // new Vector3f(x+0, y,z), new Vector3f(x+0, y+TRANSITION_CELL_WIDTH,z), new Vector3f(x+0, y+1,z),
new Vector3f(x+TRANSITION_CELL_WIDTH,y,z), new Vector3f(x+TRANSITION_CELL_WIDTH,y+TRANSITION_CELL_WIDTH,z), new Vector3f(x+TRANSITION_CELL_WIDTH,y+1,z), // new Vector3f(x+TRANSITION_CELL_WIDTH,y,z), new Vector3f(x+TRANSITION_CELL_WIDTH,y+TRANSITION_CELL_WIDTH,z), new Vector3f(x+TRANSITION_CELL_WIDTH,y+1,z),
new Vector3f(x+1, y,z), new Vector3f(x+1, y+TRANSITION_CELL_WIDTH,z), new Vector3f(x+1, y+1,z), // new Vector3f(x+1, y,z), new Vector3f(x+1, y+TRANSITION_CELL_WIDTH,z), new Vector3f(x+1, y+1,z),
//simple face vertex coordinates // //simple face vertex coordinates
new Vector3f(x+TRANSITION_CELL_WIDTH,y,z+TRANSITION_CELL_WIDTH), new Vector3f(x+TRANSITION_CELL_WIDTH,y+1,z+TRANSITION_CELL_WIDTH), // new Vector3f(x+TRANSITION_CELL_WIDTH,y,z+TRANSITION_CELL_WIDTH), new Vector3f(x+TRANSITION_CELL_WIDTH,y+1,z+TRANSITION_CELL_WIDTH),
new Vector3f(x+1,y,z+TRANSITION_CELL_WIDTH), new Vector3f(x+1,y+1,z+TRANSITION_CELL_WIDTH), // new Vector3f(x+1,y,z+TRANSITION_CELL_WIDTH), new Vector3f(x+1,y+1,z+TRANSITION_CELL_WIDTH),
//complex face iso values // //complex face iso values
chunkData.zNegativeEdgeIso[(x+0)*2+0][(y+0)*2+0], chunkData.zNegativeEdgeIso[(x+0)*2+0][(y+0)*2+1], chunkData.zNegativeEdgeIso[(x+0)*2+0][(y+1)*2+0], // chunkData.zNegativeEdgeIso[(x+0)*2+0][(y+0)*2+0], chunkData.zNegativeEdgeIso[(x+0)*2+0][(y+0)*2+1], chunkData.zNegativeEdgeIso[(x+0)*2+0][(y+1)*2+0],
chunkData.zNegativeEdgeIso[(x+0)*2+1][(y+0)*2+0], chunkData.zNegativeEdgeIso[(x+0)*2+1][(y+0)*2+1], chunkData.zNegativeEdgeIso[(x+0)*2+1][(y+1)*2+0], // chunkData.zNegativeEdgeIso[(x+0)*2+1][(y+0)*2+0], chunkData.zNegativeEdgeIso[(x+0)*2+1][(y+0)*2+1], chunkData.zNegativeEdgeIso[(x+0)*2+1][(y+1)*2+0],
chunkData.zNegativeEdgeIso[(x+1)*2+0][(y+0)*2+0], chunkData.zNegativeEdgeIso[(x+1)*2+0][(y+0)*2+1], chunkData.zNegativeEdgeIso[(x+1)*2+0][(y+1)*2+0], // chunkData.zNegativeEdgeIso[(x+1)*2+0][(y+0)*2+0], chunkData.zNegativeEdgeIso[(x+1)*2+0][(y+0)*2+1], chunkData.zNegativeEdgeIso[(x+1)*2+0][(y+1)*2+0],
//simple face iso values // //simple face iso values
chunkData.zNegativeEdgeIso[(x+0)*2+0][(y+0)*2+0], chunkData.zNegativeEdgeIso[(x+0)*2+0][(y+1)*2+0], // chunkData.zNegativeEdgeIso[(x+0)*2+0][(y+0)*2+0], chunkData.zNegativeEdgeIso[(x+0)*2+0][(y+1)*2+0],
chunkData.zNegativeEdgeIso[(x+1)*2+0][(y+0)*2+0], chunkData.zNegativeEdgeIso[(x+1)*2+0][(y+1)*2+0], // chunkData.zNegativeEdgeIso[(x+1)*2+0][(y+0)*2+0], chunkData.zNegativeEdgeIso[(x+1)*2+0][(y+1)*2+0],
//complex face texture atlas values // //complex face texture atlas values
chunkData.zNegativeEdgeAtlas[(x+0)*2+0][(y+0)*2+0], chunkData.zNegativeEdgeAtlas[(x+0)*2+0][(y+0)*2+1], chunkData.zNegativeEdgeAtlas[(x+0)*2+0][(y+1)*2+0], // chunkData.zNegativeEdgeAtlas[(x+0)*2+0][(y+0)*2+0], chunkData.zNegativeEdgeAtlas[(x+0)*2+0][(y+0)*2+1], chunkData.zNegativeEdgeAtlas[(x+0)*2+0][(y+1)*2+0],
chunkData.zNegativeEdgeAtlas[(x+0)*2+1][(y+0)*2+0], chunkData.zNegativeEdgeAtlas[(x+0)*2+1][(y+0)*2+1], chunkData.zNegativeEdgeAtlas[(x+0)*2+1][(y+1)*2+0], // chunkData.zNegativeEdgeAtlas[(x+0)*2+1][(y+0)*2+0], chunkData.zNegativeEdgeAtlas[(x+0)*2+1][(y+0)*2+1], chunkData.zNegativeEdgeAtlas[(x+0)*2+1][(y+1)*2+0],
chunkData.zNegativeEdgeAtlas[(x+1)*2+0][(y+0)*2+0], chunkData.zNegativeEdgeAtlas[(x+1)*2+0][(y+0)*2+1], chunkData.zNegativeEdgeAtlas[(x+1)*2+0][(y+1)*2+0], // chunkData.zNegativeEdgeAtlas[(x+1)*2+0][(y+0)*2+0], chunkData.zNegativeEdgeAtlas[(x+1)*2+0][(y+0)*2+1], chunkData.zNegativeEdgeAtlas[(x+1)*2+0][(y+1)*2+0],
//simple face texture atlas values // //simple face texture atlas values
chunkData.zNegativeEdgeAtlas[(x+0)*2+0][(y+0)*2+0], chunkData.zNegativeEdgeAtlas[(x+0)*2+0][(y+1)*2+0], // chunkData.zNegativeEdgeAtlas[(x+0)*2+0][(y+0)*2+0], chunkData.zNegativeEdgeAtlas[(x+0)*2+0][(y+1)*2+0],
chunkData.zNegativeEdgeAtlas[(x+1)*2+0][(y+0)*2+0], chunkData.zNegativeEdgeAtlas[(x+1)*2+0][(y+1)*2+0] // chunkData.zNegativeEdgeAtlas[(x+1)*2+0][(y+0)*2+0], chunkData.zNegativeEdgeAtlas[(x+1)*2+0][(y+1)*2+0]
); // );
TransvoxelModelGeneration.polygonizeTransition(currentTransitionCell, TerrainChunkModelGeneration.MIN_ISO_VALUE, triangles, samplerTriangles, vertMap, verts, normals, trianglesSharingVert, true); // TransvoxelModelGeneration.polygonizeTransition(currentTransitionCell, TerrainChunkModelGeneration.MIN_ISO_VALUE, triangles, samplerTriangles, vertMap, verts, normals, trianglesSharingVert, true);
// // //
//Generate the normal cell with half width // //Generate the normal cell with half width
// // //
vecPool[0].set(x+TRANSITION_CELL_WIDTH,y+0,z+TRANSITION_CELL_WIDTH); // vecPool[0].set(x+TRANSITION_CELL_WIDTH,y+0,z+TRANSITION_CELL_WIDTH);
vecPool[1].set(x+TRANSITION_CELL_WIDTH,y+0,z+1); // vecPool[1].set(x+TRANSITION_CELL_WIDTH,y+0,z+1);
vecPool[2].set(x+1,y+0,z+1); // vecPool[2].set(x+1,y+0,z+1);
vecPool[3].set(x+1,y+0,z+TRANSITION_CELL_WIDTH); // vecPool[3].set(x+1,y+0,z+TRANSITION_CELL_WIDTH);
vecPool[4].set(x+TRANSITION_CELL_WIDTH,y+1,z+TRANSITION_CELL_WIDTH); // vecPool[4].set(x+TRANSITION_CELL_WIDTH,y+1,z+TRANSITION_CELL_WIDTH);
vecPool[5].set(x+TRANSITION_CELL_WIDTH,y+1,z+1); // vecPool[5].set(x+TRANSITION_CELL_WIDTH,y+1,z+1);
vecPool[6].set(x+1,y+1,z+1); // vecPool[6].set(x+1,y+1,z+1);
vecPool[7].set(x+1,y+1,z+TRANSITION_CELL_WIDTH); // vecPool[7].set(x+1,y+1,z+TRANSITION_CELL_WIDTH);
currentCell.setValues( // currentCell.setValues(
// new Vector3f(x+TRANSITION_CELL_WIDTH,y+0,z+TRANSITION_CELL_WIDTH), new Vector3f(x+TRANSITION_CELL_WIDTH,y+0,z+1), new Vector3f(x+1,y+0,z+1), new Vector3f(x+1,y+0,z+TRANSITION_CELL_WIDTH), // // new Vector3f(x+TRANSITION_CELL_WIDTH,y+0,z+TRANSITION_CELL_WIDTH), new Vector3f(x+TRANSITION_CELL_WIDTH,y+0,z+1), new Vector3f(x+1,y+0,z+1), new Vector3f(x+1,y+0,z+TRANSITION_CELL_WIDTH),
// new Vector3f(x+TRANSITION_CELL_WIDTH,y+1,z+TRANSITION_CELL_WIDTH), new Vector3f(x+TRANSITION_CELL_WIDTH,y+1,z+1), new Vector3f(x+1,y+1,z+1), new Vector3f(x+1,y+1,z+TRANSITION_CELL_WIDTH), // // new Vector3f(x+TRANSITION_CELL_WIDTH,y+1,z+TRANSITION_CELL_WIDTH), new Vector3f(x+TRANSITION_CELL_WIDTH,y+1,z+1), new Vector3f(x+1,y+1,z+1), new Vector3f(x+1,y+1,z+TRANSITION_CELL_WIDTH),
chunkData.xNegativeEdgeIso[(y+0)*2+0][(z+0)*2+0], chunkData.xNegativeEdgeIso[(y+0)*2+0][(z+1)*2+0], chunkData.terrainGrid[x+1][y+0][z+1], chunkData.terrainGrid[x+1][y+0][z+0], // chunkData.xNegativeEdgeIso[(y+0)*2+0][(z+0)*2+0], chunkData.xNegativeEdgeIso[(y+0)*2+0][(z+1)*2+0], chunkData.terrainGrid[x+1][y+0][z+1], chunkData.terrainGrid[x+1][y+0][z+0],
chunkData.xNegativeEdgeIso[(y+1)*2+0][(z+0)*2+0], chunkData.xNegativeEdgeIso[(y+1)*2+0][(z+1)*2+0], chunkData.terrainGrid[x+1][y+1][z+1], chunkData.terrainGrid[x+1][y+1][z+0], // chunkData.xNegativeEdgeIso[(y+1)*2+0][(z+0)*2+0], chunkData.xNegativeEdgeIso[(y+1)*2+0][(z+1)*2+0], chunkData.terrainGrid[x+1][y+1][z+1], chunkData.terrainGrid[x+1][y+1][z+0],
chunkData.xNegativeEdgeAtlas[(y+0)*2+0][(z+0)*2+0], chunkData.xNegativeEdgeAtlas[(y+0)*2+0][(z+1)*2+0], chunkData.textureGrid[x+1][y+0][z+1], chunkData.textureGrid[x+1][y+0][z+0], // chunkData.xNegativeEdgeAtlas[(y+0)*2+0][(z+0)*2+0], chunkData.xNegativeEdgeAtlas[(y+0)*2+0][(z+1)*2+0], chunkData.textureGrid[x+1][y+0][z+1], chunkData.textureGrid[x+1][y+0][z+0],
chunkData.xNegativeEdgeAtlas[(y+1)*2+0][(z+0)*2+0], chunkData.xNegativeEdgeAtlas[(y+1)*2+0][(z+1)*2+0], chunkData.textureGrid[x+1][y+1][z+1], chunkData.textureGrid[x+1][y+1][z+0] // chunkData.xNegativeEdgeAtlas[(y+1)*2+0][(z+0)*2+0], chunkData.xNegativeEdgeAtlas[(y+1)*2+0][(z+1)*2+0], chunkData.textureGrid[x+1][y+1][z+1], chunkData.textureGrid[x+1][y+1][z+0]
); // );
//polygonize the current gridcell // //polygonize the current gridcell
TransvoxelModelGeneration.polygonize(currentCell, TerrainChunkModelGeneration.MIN_ISO_VALUE, triangles, samplerTriangles, vertMap, verts, normals, trianglesSharingVert, true); // TransvoxelModelGeneration.polygonize(currentCell, TerrainChunkModelGeneration.MIN_ISO_VALUE, triangles, samplerTriangles, vertMap, verts, normals, trianglesSharingVert, true);
} // }
} // }
if (verts.size() != normals.size()){ if (verts.size() != normals.size()){

View File

@ -76,7 +76,7 @@ public class ImagePanel extends StandardElement implements DrawableElement, Drag
if(texture != null){ if(texture != null){
customMat.setTexturePointer(texture.getTexturePointer()); customMat.setTexturePointer(texture.getTexturePointer());
hasLoadedTexture = true; hasLoadedTexture = true;
} else { } else if(Globals.assetManager.fetchTexture(Globals.blackTexture) != null) {
customMat.setTexturePointer(Globals.assetManager.fetchTexture(Globals.blackTexture).getTexturePointer()); customMat.setTexturePointer(Globals.assetManager.fetchTexture(Globals.blackTexture).getTexturePointer());
} }
} }

View File

@ -81,11 +81,21 @@ public class StandardElement implements Element {
Yoga.YGNodeStyleSetWidth(this.yogaNode, width); Yoga.YGNodeStyleSetWidth(this.yogaNode, width);
} }
@Override
public void setWidthPercent(float width) {
Yoga.YGNodeStyleSetWidthPercent(yogaNode, width);
}
@Override @Override
public void setHeight(int height) { public void setHeight(int height) {
Yoga.YGNodeStyleSetHeight(this.yogaNode, height); Yoga.YGNodeStyleSetHeight(this.yogaNode, height);
} }
@Override
public void setHeightPercent(float height) {
Yoga.YGNodeStyleSetHeightPercent(yogaNode, height);
}
@Override @Override
public void setPositionX(int posX) { public void setPositionX(int posX) {
Yoga.YGNodeStyleSetPosition(this.yogaNode, Yoga.YGEdgeLeft, posX); Yoga.YGNodeStyleSetPosition(this.yogaNode, Yoga.YGEdgeLeft, posX);

View File

@ -293,12 +293,22 @@ public class Window implements DrawableElement, ContainerElement, NavigableEleme
Yoga.YGNodeStyleSetWidth(this.yogaNode, width); Yoga.YGNodeStyleSetWidth(this.yogaNode, width);
} }
@Override
public void setWidthPercent(float width) {
Yoga.YGNodeStyleSetWidthPercent(yogaNode, width);
}
@Override @Override
public void setHeight(int height){ public void setHeight(int height){
this.height = height; this.height = height;
Yoga.YGNodeStyleSetHeight(this.yogaNode, height); Yoga.YGNodeStyleSetHeight(this.yogaNode, height);
} }
@Override
public void setHeightPercent(float height) {
Yoga.YGNodeStyleSetHeightPercent(yogaNode, height);
}
@Override @Override
public void setMaxWidth(int width) { public void setMaxWidth(int width) {
Yoga.YGNodeStyleSetMaxWidth(yogaNode, width); Yoga.YGNodeStyleSetMaxWidth(yogaNode, width);

View File

@ -14,7 +14,9 @@ public interface Element {
public int getWidth(); public int getWidth();
public int getHeight(); public int getHeight();
public void setWidth(int width); public void setWidth(int width);
public void setWidthPercent(float width);
public void setHeight(int height); public void setHeight(int height);
public void setHeightPercent(float height);
public void setMaxWidth(int width); public void setMaxWidth(int width);
public void setMaxWidthPercent(float percent); public void setMaxWidthPercent(float percent);
public void setMaxHeight(int height); public void setMaxHeight(int height);