edge polygon gen fix + logo
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
This commit is contained in:
parent
047e6af24f
commit
fe8466c2f8
BIN
assets/Textures/engine/stormenginelogo1.png
Normal file
BIN
assets/Textures/engine/stormenginelogo1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.4 KiB |
@ -1,3 +1,3 @@
|
||||
#maven.buildNumber.plugin properties file
|
||||
#Sat Nov 16 20:18:53 EST 2024
|
||||
buildNumber=390
|
||||
#Wed Nov 20 13:22:48 EST 2024
|
||||
buildNumber=392
|
||||
|
||||
@ -1086,6 +1086,10 @@ Optimize data passing from voxel rasterizer to model generation
|
||||
Vector pooling in 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
|
||||
|
||||
@ -8,8 +8,10 @@ import electrosphere.engine.loadingthreads.LoadingThread;
|
||||
import electrosphere.engine.loadingthreads.LoadingThread.LoadingThreadType;
|
||||
import electrosphere.renderer.ui.elements.Button;
|
||||
import electrosphere.renderer.ui.elements.Div;
|
||||
import electrosphere.renderer.ui.elements.ImagePanel;
|
||||
import electrosphere.renderer.ui.elements.Label;
|
||||
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.Element;
|
||||
|
||||
@ -25,61 +27,88 @@ public class MenuGeneratorsTitleMenu {
|
||||
public static Element createTitleMenu(){
|
||||
Div rVal = Div.createDiv();
|
||||
//top-bottom
|
||||
rVal.setJustifyContent(YogaJustification.Center);
|
||||
rVal.setJustifyContent(YogaJustification.Between);
|
||||
//left-right
|
||||
rVal.setAlignItems(YogaAlignment.Center);
|
||||
rVal.setAlignContent(YogaAlignment.Center);
|
||||
rVal.setFlexGrow(1.0f);
|
||||
rVal.setFlexDirection(YogaFlexDirection.Column);
|
||||
|
||||
//label (title)
|
||||
Label titleLabel = Label.createLabel("ORPG");
|
||||
rVal.addChild(titleLabel);
|
||||
|
||||
//button (multiplayer)
|
||||
rVal.addChild(Button.createButtonCentered("Singleplayer", () -> {
|
||||
WindowUtils.replaceMainMenuContents(MenuGenerators.createWorldSelectMenu());
|
||||
}).setOnClickAudio(AssetDataStrings.UI_TONE_BUTTON_TITLE));
|
||||
//main option panel
|
||||
{
|
||||
Div optionPanel = Div.createCol();
|
||||
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)
|
||||
rVal.addChild(Button.createButtonCentered("Level Editor", () -> {
|
||||
WindowUtils.replaceMainMenuContents(MenuGeneratorsLevelEditor.createLevelEditorTopMenu());
|
||||
}).setOnClickAudio(AssetDataStrings.UI_TONE_BUTTON_TITLE));
|
||||
//label (title)
|
||||
Label titleLabel = Label.createLabel("ORPG");
|
||||
optionPanel.addChild(titleLabel);
|
||||
|
||||
//button (options)
|
||||
rVal.addChild(Button.createButtonCentered("Options", () -> {
|
||||
WindowUtils.replaceMainMenuContents(MenuGenerators.createOptionsMainMenu());
|
||||
}).setOnClickAudio(AssetDataStrings.UI_TONE_BUTTON_TITLE));
|
||||
//button (multiplayer)
|
||||
optionPanel.addChild(Button.createButtonCentered("Singleplayer", () -> {
|
||||
WindowUtils.replaceMainMenuContents(MenuGenerators.createWorldSelectMenu());
|
||||
}).setOnClickAudio(AssetDataStrings.UI_TONE_BUTTON_TITLE));
|
||||
|
||||
//button (sp debug)
|
||||
rVal.addChild(Button.createButtonCentered("Debug SP Quickstart", () -> {
|
||||
LoadingThread loadingThread = new LoadingThread(LoadingThreadType.DEBUG_RANDOM_SP_WORLD);
|
||||
Globals.RUN_CLIENT = true;
|
||||
Globals.RUN_SERVER = true;
|
||||
Globals.threadManager.start(loadingThread);
|
||||
}).setOnClickAudio(AssetDataStrings.UI_TONE_BUTTON_TITLE));
|
||||
//button (multiplayer)
|
||||
optionPanel.addChild(Button.createButtonCentered("Multiplayer", () -> {
|
||||
WindowUtils.replaceMainMenuContents(MenuGenerators.createMultiplayerMenu());
|
||||
}).setOnClickAudio(AssetDataStrings.UI_TONE_BUTTON_TITLE));
|
||||
|
||||
//button (sp debug)
|
||||
rVal.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 (static level)
|
||||
optionPanel.addChild(Button.createButtonCentered("Level Editor", () -> {
|
||||
WindowUtils.replaceMainMenuContents(MenuGeneratorsLevelEditor.createLevelEditorTopMenu());
|
||||
}).setOnClickAudio(AssetDataStrings.UI_TONE_BUTTON_TITLE));
|
||||
|
||||
//button (ui testing)
|
||||
rVal.addChild(Button.createButtonCentered("UI Testing", () -> {
|
||||
WindowUtils.replaceMainMenuContents(MenuGeneratorsUITesting.createUITestMenu());
|
||||
}).setOnClickAudio(AssetDataStrings.UI_TONE_BUTTON_TITLE));
|
||||
//button (options)
|
||||
optionPanel.addChild(Button.createButtonCentered("Options", () -> {
|
||||
WindowUtils.replaceMainMenuContents(MenuGenerators.createOptionsMainMenu());
|
||||
}).setOnClickAudio(AssetDataStrings.UI_TONE_BUTTON_TITLE));
|
||||
|
||||
//button (Viewport Test)
|
||||
rVal.addChild(Button.createButtonCentered("Viewport Test", () -> {
|
||||
Globals.threadManager.start(new LoadingThread(LoadingThreadType.LOAD_VIEWPORT));
|
||||
}).setOnClickAudio(AssetDataStrings.UI_TONE_BUTTON_TITLE));
|
||||
//button (sp debug)
|
||||
optionPanel.addChild(Button.createButtonCentered("Debug SP Quickstart", () -> {
|
||||
LoadingThread loadingThread = new LoadingThread(LoadingThreadType.DEBUG_RANDOM_SP_WORLD);
|
||||
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;
|
||||
}
|
||||
|
||||
@ -602,6 +602,7 @@ public class Globals {
|
||||
"Textures/ui/uiFrame1.png",
|
||||
"Textures/ui/uiFrame2.png",
|
||||
"Textures/ui/uiOutline1.png",
|
||||
AssetDataStrings.UI_ENGINE_LOGO_1,
|
||||
"Textures/ui/circle.png",
|
||||
"Textures/ui/square.png",
|
||||
"Textures/color/transparent_green.png",
|
||||
|
||||
@ -21,6 +21,7 @@ public class AssetDataStrings {
|
||||
/**
|
||||
* 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_2 = "Textures/ui/uiFrame2.png";
|
||||
|
||||
|
||||
@ -767,6 +767,11 @@ public class TransvoxelModelGeneration {
|
||||
float firstSample = TransvoxelModelGeneration.getTransvoxelSampleValue(transitionCell.simpleFaceValues,transitionCell.complexFaceValues,firstCornerSampleIndex);
|
||||
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
|
||||
if(firstSample < 0 && secondSample < 0){
|
||||
@ -834,6 +839,12 @@ public class TransvoxelModelGeneration {
|
||||
Vector3f vert1 = vertList[triangleData.vertexIndex[i+1]];
|
||||
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(vert1 + "");
|
||||
LoggerInterface.loggerRenderer.DEBUG(vert2 + "");
|
||||
@ -1794,92 +1805,92 @@ public class TransvoxelModelGeneration {
|
||||
|
||||
|
||||
//xn-zn edge
|
||||
if(chunkData.xNegativeEdgeIso != null && chunkData.zNegativeEdgeIso != null){
|
||||
int x = 0;
|
||||
int z = 0;
|
||||
int edgeLength = chunkWidth - (chunkData.yNegativeEdgeIso != null ? 1 : 0) - (chunkData.yPositiveEdgeIso != null ? 1 : 0);
|
||||
int startIndex = 0 + (chunkData.yNegativeEdgeIso != null ? 1 : 0);
|
||||
for(int i = startIndex; i < edgeLength - 1; i++){
|
||||
int y = i;
|
||||
//
|
||||
//Generate the x-side transition cell
|
||||
//
|
||||
currentTransitionCell.setValues(
|
||||
//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+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),
|
||||
//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+1), new Vector3f(x+TRANSITION_CELL_WIDTH,y+1,z+1),
|
||||
//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+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],
|
||||
//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+1)*2+0], chunkData.xNegativeEdgeIso[(y+1)*2+0][(z+1)*2+0],
|
||||
//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+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],
|
||||
//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+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);
|
||||
// if(chunkData.xNegativeEdgeIso != null && chunkData.zNegativeEdgeIso != null){
|
||||
// int x = 0;
|
||||
// int z = 0;
|
||||
// int edgeLength = chunkWidth - (chunkData.yNegativeEdgeIso != null ? 1 : 0) - (chunkData.yPositiveEdgeIso != null ? 1 : 0);
|
||||
// int startIndex = 0 + (chunkData.yNegativeEdgeIso != null ? 1 : 0);
|
||||
// for(int i = startIndex; i < edgeLength - 1; i++){
|
||||
// int y = i;
|
||||
// //
|
||||
// //Generate the x-side transition cell
|
||||
// //
|
||||
// currentTransitionCell.setValues(
|
||||
// //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+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),
|
||||
// //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+1), new Vector3f(x+TRANSITION_CELL_WIDTH,y+1,z+1),
|
||||
// //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+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],
|
||||
// //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+1)*2+0], chunkData.xNegativeEdgeIso[(y+1)*2+0][(z+1)*2+0],
|
||||
// //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+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],
|
||||
// //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+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);
|
||||
|
||||
//
|
||||
//Generate the z-side transition cell
|
||||
//
|
||||
currentTransitionCell.setValues(
|
||||
//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+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),
|
||||
//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+1,y,z+TRANSITION_CELL_WIDTH), new Vector3f(x+1,y+1,z+TRANSITION_CELL_WIDTH),
|
||||
//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+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],
|
||||
//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+1)*2+0][(y+0)*2+0], chunkData.zNegativeEdgeIso[(x+1)*2+0][(y+1)*2+0],
|
||||
//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+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],
|
||||
//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+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);
|
||||
// //
|
||||
// //Generate the z-side transition cell
|
||||
// //
|
||||
// currentTransitionCell.setValues(
|
||||
// //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+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),
|
||||
// //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+1,y,z+TRANSITION_CELL_WIDTH), new Vector3f(x+1,y+1,z+TRANSITION_CELL_WIDTH),
|
||||
// //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+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],
|
||||
// //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+1)*2+0][(y+0)*2+0], chunkData.zNegativeEdgeIso[(x+1)*2+0][(y+1)*2+0],
|
||||
// //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+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],
|
||||
// //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+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);
|
||||
|
||||
//
|
||||
//Generate the normal cell with half 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[2].set(x+1,y+0,z+1);
|
||||
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[5].set(x+TRANSITION_CELL_WIDTH,y+1,z+1);
|
||||
vecPool[6].set(x+1,y+1,z+1);
|
||||
vecPool[7].set(x+1,y+1,z+TRANSITION_CELL_WIDTH);
|
||||
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+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+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+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
|
||||
TransvoxelModelGeneration.polygonize(currentCell, TerrainChunkModelGeneration.MIN_ISO_VALUE, triangles, samplerTriangles, vertMap, verts, normals, trianglesSharingVert, true);
|
||||
}
|
||||
}
|
||||
// //
|
||||
// //Generate the normal cell with half 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[2].set(x+1,y+0,z+1);
|
||||
// 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[5].set(x+TRANSITION_CELL_WIDTH,y+1,z+1);
|
||||
// vecPool[6].set(x+1,y+1,z+1);
|
||||
// vecPool[7].set(x+1,y+1,z+TRANSITION_CELL_WIDTH);
|
||||
// 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+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+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+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
|
||||
// TransvoxelModelGeneration.polygonize(currentCell, TerrainChunkModelGeneration.MIN_ISO_VALUE, triangles, samplerTriangles, vertMap, verts, normals, trianglesSharingVert, true);
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
if (verts.size() != normals.size()){
|
||||
|
||||
@ -76,7 +76,7 @@ public class ImagePanel extends StandardElement implements DrawableElement, Drag
|
||||
if(texture != null){
|
||||
customMat.setTexturePointer(texture.getTexturePointer());
|
||||
hasLoadedTexture = true;
|
||||
} else {
|
||||
} else if(Globals.assetManager.fetchTexture(Globals.blackTexture) != null) {
|
||||
customMat.setTexturePointer(Globals.assetManager.fetchTexture(Globals.blackTexture).getTexturePointer());
|
||||
}
|
||||
}
|
||||
|
||||
@ -81,11 +81,21 @@ public class StandardElement implements Element {
|
||||
Yoga.YGNodeStyleSetWidth(this.yogaNode, width);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setWidthPercent(float width) {
|
||||
Yoga.YGNodeStyleSetWidthPercent(yogaNode, width);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setHeight(int height) {
|
||||
Yoga.YGNodeStyleSetHeight(this.yogaNode, height);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setHeightPercent(float height) {
|
||||
Yoga.YGNodeStyleSetHeightPercent(yogaNode, height);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPositionX(int posX) {
|
||||
Yoga.YGNodeStyleSetPosition(this.yogaNode, Yoga.YGEdgeLeft, posX);
|
||||
|
||||
@ -292,6 +292,11 @@ public class Window implements DrawableElement, ContainerElement, NavigableEleme
|
||||
this.width = width;
|
||||
Yoga.YGNodeStyleSetWidth(this.yogaNode, width);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setWidthPercent(float width) {
|
||||
Yoga.YGNodeStyleSetWidthPercent(yogaNode, width);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setHeight(int height){
|
||||
@ -299,6 +304,11 @@ public class Window implements DrawableElement, ContainerElement, NavigableEleme
|
||||
Yoga.YGNodeStyleSetHeight(this.yogaNode, height);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setHeightPercent(float height) {
|
||||
Yoga.YGNodeStyleSetHeightPercent(yogaNode, height);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMaxWidth(int width) {
|
||||
Yoga.YGNodeStyleSetMaxWidth(yogaNode, width);
|
||||
|
||||
@ -14,7 +14,9 @@ public interface Element {
|
||||
public int getWidth();
|
||||
public int getHeight();
|
||||
public void setWidth(int width);
|
||||
public void setWidthPercent(float width);
|
||||
public void setHeight(int height);
|
||||
public void setHeightPercent(float height);
|
||||
public void setMaxWidth(int width);
|
||||
public void setMaxWidthPercent(float percent);
|
||||
public void setMaxHeight(int height);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user