-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Labels
questionFurther information is requestedFurther information is requested
Description
I want to make the simpler way how to use this library.
Do you have any ideas on how to make the architecture or API library more friendly?
Look at the code below, seems like there is a better (simpler) way to set up this view. Maybe some DSL?
shaderView.apply {
updateContinuously = true // update each frame
vertexShaderRawResId = R.raw.quad_tangent_space_vert
fragmentShaderRawResId = R.raw.nomral_map
shaderParams = ShaderParamsBuilder()
.addTexture2D(
"uNormalTexture",
R.drawable.normal_button,
GLES30.GL_TEXTURE0
)
.addColor("uColor", R.color.grey, resources)
.addVec3f("uVaryingColor", floatArrayOf(0.5f, 0.5f, 0.5f))
.addVec3f("uLightDirection", floatArrayOf(1.0f, 1.0f, 0.0f))
.addVec3f("uEyeDirection", floatArrayOf(0.0f, 0.0f, 0.0f))
.build()
onDrawFrameListener = { shaderParams ->
val pos = (System.currentTimeMillis() % 5000L) / 1000f
shaderParams.updateValue("uLightDirection", floatArrayOf(0.0f + pos, 1.0f, 0.0f))
}
}
tkhskt
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested