s
This commit is contained in:
@@ -49,7 +49,9 @@ Namespace RenderingN
|
||||
|
||||
Private Function ColorToTexture(color As Color) As Image
|
||||
Dim tex As New Bitmap(1, 1)
|
||||
tex.MakeTransparent()
|
||||
tex.SetPixel(0, 0, color)
|
||||
Console.WriteLine(tex.GetPixel(0, 0).ToString & vbTab & color.ToString)
|
||||
Return tex
|
||||
End Function
|
||||
|
||||
@@ -308,14 +310,24 @@ Namespace RenderingN
|
||||
|
||||
GL.BindBuffer(BufferTarget.ElementArrayBuffer, IndicesBuffers(mesh)(i))
|
||||
|
||||
Dim texID As Integer
|
||||
Dim isEmptyTexture As Boolean = l.Material?.Image Is Nothing
|
||||
Dim isEmptyColor As Boolean = l.Material?.Color Is Nothing
|
||||
|
||||
If (mode And RenderMode.Fill) = RenderMode.Fill Then
|
||||
texID = If(isEmptyTexture, If(isEmptyColor, dicTextureIDs(emptyTexture), dicColorIDs(l.Material.Color)), dicTextureIDs(l.Material.Image))
|
||||
|
||||
Dim setMaterialTextureOrColor =
|
||||
Sub()
|
||||
Dim texID As Integer
|
||||
If Not isEmptyTexture Then
|
||||
texID = dicTextureIDs(l.Material.Image)
|
||||
ElseIf Not isEmptyColor Then
|
||||
texID = dicColorIDs(l.Material.Color)
|
||||
Else
|
||||
texID = dicTextureIDs(emptyTexture)
|
||||
End If
|
||||
GL.BindTexture(TextureTarget.Texture2D, texID)
|
||||
End Sub
|
||||
|
||||
If (mode And RenderMode.Fill) = RenderMode.Fill Then
|
||||
setMaterialTextureOrColor()
|
||||
|
||||
If Not isEmptyTexture Then
|
||||
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapT, l.Material.Wrap.X)
|
||||
@@ -332,11 +344,9 @@ Namespace RenderingN
|
||||
If (mode And RenderMode.Outline) = RenderMode.Outline Then
|
||||
|
||||
If (mode And RenderMode.Fill) = RenderMode.Fill Then
|
||||
texID = dicTextureIDs(lineTexture)
|
||||
GL.BindTexture(TextureTarget.Texture2D, texID)
|
||||
GL.BindTexture(TextureTarget.Texture2D, dicTextureIDs(lineTexture))
|
||||
Else
|
||||
texID = If(isEmptyTexture, If(isEmptyColor, dicTextureIDs(emptyTexture), dicColorIDs(l.Material.Color)), dicTextureIDs(l.Material.Image))
|
||||
GL.BindTexture(TextureTarget.Texture2D, texID)
|
||||
setMaterialTextureOrColor()
|
||||
|
||||
If Not isEmptyTexture Then
|
||||
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapT, l.Material.Wrap.X)
|
||||
|
||||
Reference in New Issue
Block a user