Skip to content

Commit

Permalink
Beginning of the Texture support !
Browse files Browse the repository at this point in the history
So, the Vket preparations were a total disaster, and now I can
focus back on making things nicely.
A few rushes are still present, though.

In random order, Texture2DArray support has been added, with
a simple texture array. I still need to develop a nice 2D Array
creator and preparation tool.
The reason being that I'm amazed by how BAD Blender is when
trying to do simple things, like setting the color value of
a vertex. Like PUT COLOR RGB(1,0,0) ON SELECTED VERTEX is
a very difficult operation on Blender...
The whole Vertex Paint being a Joke, since it doesn't exactly
apply the color that you want, even if you specifiy the Hexadecimal
color code, which should be already "gamma corrected".

Still, the shader I prepared have some issues with the normals,
and I don't know why, since I have no idea about the normals
"format", how the data is sent to the shader, how it's handled,
...
To understand that, I 'd have to make my own shader from scratch...
In a near future !

That said, you can select a texture to apply to the next tiles
now.
The whole idea is not to do this, though. The whole idea is to
have texture "Slots" (1,2,3,4,5), paints with these slots (think
Minesweeper where you paint numbers on the logic part) and these
slots will be bound to a speficic index of the Texture2DArray.
Another menu would allow you to change the texture set to a slot,
so that you can try different textures quickly.
That's for the next version, though.

The next step is to add "Triplanar" mapping, in order to make
the textures easily extend between the tiles, giving a nice look.

Meanwhile, reading textures data from Unity, inside an Editor
tool, is rather easy. So, I'll try to save the data inside a
screenshot, using a dumb way, and then try to make the screenshot
fit EXACTLY, the standard camera output (I'll see about different
resolutions afterwards...).

Also, I dropped the "bazillion" layers idea, and went back to
one single layer for Raycasting. while checking for the name of
the collider hit.
I might also forget about layers actually afterwards, since I just
learned that the raycast fire order can be done from a specific
collider, which will make sure that the Raycast only targets itself !
Then the logic will be based on the local hit position.

I'm also computing the InverseTransformPoint from the transform
hit, removing the need to setup every potential transform that
could be hit as a parameter to the script (which was stupid).
This means that I also dropped the idea of sampling textures
coordinates, but since InverseTransformPoint actually ignores the
current transform scale, this is almost identical when hitting
(scaled) 1x1 quads.

Some files were moved, due to VketTools constraints, and I might
follow this pattern in the future. Having all the required files
in the same folder makes backup easier, actually.

Signed-off-by: Voyage <[email protected]>
  • Loading branch information
vr-voyage committed Nov 24, 2021
1 parent 6d3c0ba commit f660094
Show file tree
Hide file tree
Showing 62 changed files with 13,015 additions and 962 deletions.
8 changes: 8 additions & 0 deletions Assets/MapMaker/Materials/DataTextures.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

77 changes: 77 additions & 0 deletions Assets/MapMaker/Materials/DataTextures/SaveMaterial.mat
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: SaveMaterial
m_Shader: {fileID: 10752, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: aebcf1b52ccd8d34b95b2a5f37475822, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
128 changes: 128 additions & 0 deletions Assets/MapMaker/Materials/DataTextures/SaveTexture.png.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
76 changes: 76 additions & 0 deletions Assets/MapMaker/Materials/GridEmissive-Selection.png.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Assets/MapMaker/Materials/GridFloor-Selection.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
88 changes: 88 additions & 0 deletions Assets/MapMaker/Materials/GridFloor-Selection.png.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f660094

Please sign in to comment.