-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support more parameters, add OES convert renderer and fix bug
- Loading branch information
1 parent
2cb90ba
commit 8553ccd
Showing
20 changed files
with
256 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
libfusion/src/main/java/io/github/kenneycode/fusion/common/DataKeys.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package io.github.kenneycode.fusion.common | ||
|
||
class DataKeys { | ||
|
||
companion object { | ||
|
||
const val ST_MATRIX = "ST_MATRIX" | ||
const val KEY_DISPLAY_WIDTH = "KEY_DISPLAY_WIDTH" | ||
const val KEY_DISPLAY_HEIGHT = "KEY_DISPLAY_HEIGHT" | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
libfusion/src/main/java/io/github/kenneycode/fusion/parameter/Mat4Parameter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package io.github.kenneycode.fusion.parameter | ||
|
||
import android.opengl.GLES30 | ||
|
||
/** | ||
* | ||
* Coded by kenney | ||
* | ||
* http://www.github.com/kenneycode/fusion | ||
* | ||
* 4*4 Matrix 参数 | ||
* | ||
*/ | ||
|
||
class Mat4Parameter(key : String, private var value : FloatArray) : Parameter(key) { | ||
|
||
override fun bindUniform(program: Int) { | ||
if (location < 0) { | ||
location = GLES30.glGetUniformLocation(program, key) | ||
} | ||
GLES30.glUniformMatrix4fv(location, 1, false, value, 0) | ||
} | ||
|
||
override fun updateValue(value: Any) { | ||
this.value = value as FloatArray | ||
} | ||
|
||
} |
31 changes: 31 additions & 0 deletions
31
libfusion/src/main/java/io/github/kenneycode/fusion/parameter/OESTextureParameter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package io.github.kenneycode.fusion.parameter | ||
|
||
import android.opengl.GLES11Ext | ||
import android.opengl.GLES30 | ||
|
||
/** | ||
* | ||
* Coded by kenney | ||
* | ||
* http://www.github.com/kenneycode/fusion | ||
* | ||
* OES纹理参数 | ||
* | ||
*/ | ||
|
||
class OESTextureParameter(key : String, private var value : Int) : Parameter(key) { | ||
|
||
override fun bindUniform(program: Int) { | ||
if (location < 0) { | ||
location = GLES30.glGetUniformLocation(program, key) | ||
} | ||
GLES30.glActiveTexture(GLES30.GL_TEXTURE0) | ||
GLES30.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, value) | ||
GLES30.glUniform1i(location, 0) | ||
} | ||
|
||
override fun updateValue(value: Any) { | ||
this.value = value as Int | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.