Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c83f36c976 | ||
|
|
29e0c1e9a8 | ||
|
|
7b07e7fbc1 | ||
|
|
b6ac86a134 | ||
|
|
6bbbb3c3ef | ||
|
|
e38da96e37 | ||
|
|
9ee028248d | ||
|
|
84cc693593 |
|
After Width: | Height: | Size: 16 KiB |
@@ -5,12 +5,20 @@ layout (binding = 1) uniform sampler2D samplerColor;
|
|||||||
layout (location = 0) in vec2 inUV;
|
layout (location = 0) in vec2 inUV;
|
||||||
layout (location = 1) in vec3 inNormal;
|
layout (location = 1) in vec3 inNormal;
|
||||||
|
|
||||||
|
layout(push_constant) uniform PushConstants {
|
||||||
|
float myValue;
|
||||||
|
float ux;
|
||||||
|
float uy;
|
||||||
|
} pushConstants;
|
||||||
|
|
||||||
|
|
||||||
layout (location = 0) out vec4 outFragColor;
|
layout (location = 0) out vec4 outFragColor;
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
vec4 color = texture(samplerColor, inUV);
|
vec2 pos = vec2(pushConstants.ux/2048.f, pushConstants.uy/2048.f);
|
||||||
|
vec2 uv = pos + vec2(inUV.x/8.f, inUV.y/8.f);
|
||||||
|
vec4 color = texture(samplerColor, uv);
|
||||||
|
|
||||||
outFragColor = color;
|
outFragColor = color;
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ layout (location = 1) out vec3 outNormal;
|
|||||||
|
|
||||||
layout(push_constant) uniform PushConstants {
|
layout(push_constant) uniform PushConstants {
|
||||||
float myValue;
|
float myValue;
|
||||||
|
float ux;
|
||||||
|
float uy;
|
||||||
} pushConstants;
|
} pushConstants;
|
||||||
|
|
||||||
out gl_PerVertex
|
out gl_PerVertex
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ FaceApp* g_Application = nullptr;
|
|||||||
AAssetManager* g_assetManager = nullptr;
|
AAssetManager* g_assetManager = nullptr;
|
||||||
|
|
||||||
jobject g_callback = nullptr;
|
jobject g_callback = nullptr;
|
||||||
|
jobject g_callbackAnimationFinished = nullptr;
|
||||||
|
|
||||||
void handle_cmd(android_app *pApp, int32_t cmd) {
|
void handle_cmd(android_app *pApp, int32_t cmd) {
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
@@ -149,22 +150,7 @@ Java_com_hmwl_face_1sdk_FaceActivity_SetCppInitArg(JNIEnv *env, jobject thiz, js
|
|||||||
}
|
}
|
||||||
memcpy(g_InitArgString, nativeString, len);
|
memcpy(g_InitArgString, nativeString, len);
|
||||||
}
|
}
|
||||||
extern "C"
|
|
||||||
JNIEXPORT void JNICALL
|
|
||||||
Java_com_hmwl_face_1sdk_FaceActivity_ChangeStateCpp(JNIEnv *env, jobject thiz, jstring json) {
|
|
||||||
// TODO: implement ChangeStateCpp()
|
|
||||||
const char *nativeString = env->GetStringUTFChars(json, nullptr);
|
|
||||||
jsize len = env->GetStringUTFLength(json);
|
|
||||||
if(len > ArgLen)
|
|
||||||
{
|
|
||||||
aout << "ArgLen to long:" << len << std::endl;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if(g_Application->isInited())
|
|
||||||
{
|
|
||||||
g_Application->changeMotion(nativeString);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
extern "C"
|
extern "C"
|
||||||
JNIEXPORT void JNICALL
|
JNIEXPORT void JNICALL
|
||||||
Java_com_hmwl_face_1sdk_FaceActivity_StopRunning(JNIEnv *env, jobject thiz) {
|
Java_com_hmwl_face_1sdk_FaceActivity_StopRunning(JNIEnv *env, jobject thiz) {
|
||||||
@@ -179,7 +165,7 @@ JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void* reserved) {
|
|||||||
return JNI_VERSION_1_6;
|
return JNI_VERSION_1_6;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CppCallback(const string& motion_type)
|
void CppCallback()
|
||||||
{
|
{
|
||||||
JNIEnv* env = nullptr;
|
JNIEnv* env = nullptr;
|
||||||
bool needDetach = false;
|
bool needDetach = false;
|
||||||
@@ -210,7 +196,7 @@ void CppCallback(const string& motion_type)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 2. 获取 OnLoadActionFinished 方法 ID(注意方法名大小写必须一致!)
|
// 2. 获取 OnLoadActionFinished 方法 ID(注意方法名大小写必须一致!)
|
||||||
jmethodID methodId = env->GetMethodID(callbackClass, "OnLoadActionFinished", "(Ljava/lang/String;)V");
|
jmethodID methodId = env->GetMethodID(callbackClass, "OnLoadMotionListFinished", "(Ljava/lang/String;)V");
|
||||||
if (methodId == nullptr) {
|
if (methodId == nullptr) {
|
||||||
env->ExceptionDescribe(); // 打印异常
|
env->ExceptionDescribe(); // 打印异常
|
||||||
env->ExceptionClear();
|
env->ExceptionClear();
|
||||||
@@ -219,7 +205,7 @@ void CppCallback(const string& motion_type)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 3. 构造 jstring 参数
|
// 3. 构造 jstring 参数
|
||||||
jstring jResult = env->NewStringUTF(motion_type.c_str());
|
jstring jResult = env->NewStringUTF("ok");
|
||||||
|
|
||||||
// 4. 调用 Java 回调
|
// 4. 调用 Java 回调
|
||||||
env->CallVoidMethod(g_callback, methodId, jResult);
|
env->CallVoidMethod(g_callback, methodId, jResult);
|
||||||
@@ -241,6 +227,63 @@ void CppCallback(const string& motion_type)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void CppAnimationFinishedCallback()
|
||||||
|
{
|
||||||
|
JNIEnv* env = nullptr;
|
||||||
|
bool needDetach = false;
|
||||||
|
|
||||||
|
// 获取当前线程的 JNIEnv
|
||||||
|
JavaVM* vm = g_jvm; // 你需要提前保存 JavaVM* 到全局变量 g_jvm
|
||||||
|
int status = vm->GetEnv((void**)&env, JNI_VERSION_1_6);
|
||||||
|
if (status == JNI_EDETACHED) {
|
||||||
|
// 当前线程未 attach,需 attach
|
||||||
|
if (vm->AttachCurrentThread(&env, nullptr) != 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
needDetach = true;
|
||||||
|
} else if (status != JNI_OK) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (g_callbackAnimationFinished == nullptr) {
|
||||||
|
if (needDetach) vm->DetachCurrentThread();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 1. 获取 CallbackInterface 的 class
|
||||||
|
jclass callbackClass = env->GetObjectClass(g_callbackAnimationFinished);
|
||||||
|
if (callbackClass == nullptr) {
|
||||||
|
if (needDetach) vm->DetachCurrentThread();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. 获取 OnLoadActionFinished 方法 ID(注意方法名大小写必须一致!)
|
||||||
|
jmethodID methodId = env->GetMethodID(callbackClass, "OnPlayMotionListFinished", "()V");
|
||||||
|
if (methodId == nullptr) {
|
||||||
|
env->ExceptionDescribe(); // 打印异常
|
||||||
|
env->ExceptionClear();
|
||||||
|
if (needDetach) vm->DetachCurrentThread();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 4. 调用 Java 回调
|
||||||
|
env->CallVoidMethod(g_callbackAnimationFinished, methodId);
|
||||||
|
|
||||||
|
// 5. 检查是否抛出异常
|
||||||
|
if (env->ExceptionCheck()) {
|
||||||
|
env->ExceptionDescribe();
|
||||||
|
env->ExceptionClear();
|
||||||
|
}
|
||||||
|
|
||||||
|
env->DeleteLocalRef(callbackClass);
|
||||||
|
|
||||||
|
// 7. 如果是临时 attach 的线程,要 detach
|
||||||
|
if (needDetach) {
|
||||||
|
vm->DetachCurrentThread();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
JNIEXPORT jstring JNICALL
|
JNIEXPORT jstring JNICALL
|
||||||
@@ -266,6 +309,64 @@ Java_com_hmwl_face_1sdk_FaceActivity_PreReadAction(JNIEnv *env, jobject thiz, js
|
|||||||
aout << "ArgLen to long:" << len << std::endl;
|
aout << "ArgLen to long:" << len << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string ret = g_Application->preReadyMotion(nativeString, CppCallback);
|
std::string ret = g_Application->preLoadMotionList(nativeString, CppCallback);
|
||||||
return env->NewStringUTF(ret.c_str());
|
return env->NewStringUTF(ret.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char DELIMITER = 0x1F; // same as \u001F
|
||||||
|
|
||||||
|
std::vector<std::string> splitMotionString(const std::string& input) {
|
||||||
|
std::vector<std::string> result;
|
||||||
|
if (input.empty()) return result;
|
||||||
|
|
||||||
|
size_t start = 0;
|
||||||
|
size_t pos = input.find(DELIMITER);
|
||||||
|
|
||||||
|
while (pos != std::string::npos) {
|
||||||
|
result.push_back(input.substr(start, pos - start));
|
||||||
|
start = pos + 1;
|
||||||
|
pos = input.find(DELIMITER, start);
|
||||||
|
}
|
||||||
|
// Add last part
|
||||||
|
result.push_back(input.substr(start));
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C"
|
||||||
|
JNIEXPORT void JNICALL
|
||||||
|
Java_com_hmwl_face_1sdk_FaceActivity_ChangeMotionCpp(JNIEnv *env, jobject thiz, jstring json,
|
||||||
|
jobject callback, jboolean loop) {
|
||||||
|
// TODO: implement ChangeMotionCpp()
|
||||||
|
const char *nativeString = env->GetStringUTFChars(json, nullptr);
|
||||||
|
jsize len = env->GetStringUTFLength(json);
|
||||||
|
if(len > ArgLen)
|
||||||
|
{
|
||||||
|
aout << "ArgLen to long:" << len << std::endl;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 保存新的回调
|
||||||
|
if (callback != nullptr) {
|
||||||
|
g_callbackAnimationFinished = env->NewGlobalRef(callback);
|
||||||
|
} else {
|
||||||
|
g_callbackAnimationFinished = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(g_Application->isInited())
|
||||||
|
{
|
||||||
|
std::vector<std::string> motions = splitMotionString(nativeString);
|
||||||
|
g_Application->changeMotionList(motions, CppAnimationFinishedCallback, loop);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
extern "C"
|
||||||
|
JNIEXPORT void JNICALL
|
||||||
|
Java_com_hmwl_face_1sdk_FaceActivity_StopMotionNative(JNIEnv *env, jobject thiz) {
|
||||||
|
g_Application->StopMotion();
|
||||||
|
}
|
||||||
|
extern "C"
|
||||||
|
JNIEXPORT void JNICALL
|
||||||
|
Java_com_hmwl_face_1sdk_FaceActivity_ResumeMotionNative(JNIEnv *env, jobject thiz) {
|
||||||
|
// TODO: implement ResumeMotionNative()
|
||||||
|
g_Application->ResumeMotion();
|
||||||
|
}
|
||||||
@@ -4,7 +4,6 @@ import android.Manifest;
|
|||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.MotionEvent;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
@@ -31,7 +30,6 @@ import java.util.List;
|
|||||||
import java.util.concurrent.ExecutionException;
|
import java.util.concurrent.ExecutionException;
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
|
|
||||||
public class FaceActivity extends GameActivity implements FaceLandmarkerHelper.LandmarkerListener {
|
public class FaceActivity extends GameActivity implements FaceLandmarkerHelper.LandmarkerListener {
|
||||||
private static final String TAG = "FaceActivity";
|
private static final String TAG = "FaceActivity";
|
||||||
@@ -50,6 +48,21 @@ public class FaceActivity extends GameActivity implements FaceLandmarkerHelper.L
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
||||||
|
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||||
|
|
||||||
|
if (requestCode == REQUEST_CAMERA_PERMISSION) {
|
||||||
|
// 检查权限是否被授予
|
||||||
|
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
|
||||||
|
// 用户授予了权限,启动相机
|
||||||
|
startCamera();
|
||||||
|
} else {
|
||||||
|
requestCameraPermission();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void startCamera() {
|
private void startCamera() {
|
||||||
ListenableFuture<ProcessCameraProvider> cameraProviderFuture =
|
ListenableFuture<ProcessCameraProvider> cameraProviderFuture =
|
||||||
ProcessCameraProvider.getInstance(this);
|
ProcessCameraProvider.getInstance(this);
|
||||||
@@ -126,6 +139,16 @@ public class FaceActivity extends GameActivity implements FaceLandmarkerHelper.L
|
|||||||
StopRunning();
|
StopRunning();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private native void StopMotionNative();
|
||||||
|
public void StopMotion(){
|
||||||
|
StopMotionNative();
|
||||||
|
}
|
||||||
|
|
||||||
|
private native void ResumeMotionNative();
|
||||||
|
public void ResumeMotion(){
|
||||||
|
ResumeMotionNative();
|
||||||
|
}
|
||||||
|
|
||||||
private native void StopRunning();
|
private native void StopRunning();
|
||||||
|
|
||||||
// Native 方法
|
// Native 方法
|
||||||
@@ -267,24 +290,39 @@ public class FaceActivity extends GameActivity implements FaceLandmarkerHelper.L
|
|||||||
|
|
||||||
protected native void SetCppInitArg(String json);
|
protected native void SetCppInitArg(String json);
|
||||||
|
|
||||||
protected void SetInitArg(String json)
|
public void SetInitArg(String json)
|
||||||
{
|
{
|
||||||
SetCppInitArg(json);
|
SetCppInitArg(json);
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface CallbackInterface {
|
public interface LoadMotionListFinishedCallback {
|
||||||
void OnLoadActionFinished(String result);
|
void OnLoadMotionListFinished(String result);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected native String PreReadAction(String motion, CallbackInterface callback);
|
public interface PlayMotionListFinishedCallback {
|
||||||
protected String PreLoadAction(String json, CallbackInterface callback){
|
void OnPlayMotionListFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected native String PreReadAction(String motion, LoadMotionListFinishedCallback callback);
|
||||||
|
public String PreLoadAction(String json, LoadMotionListFinishedCallback callback){
|
||||||
return PreReadAction(json, callback);
|
return PreReadAction(json, callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected native void ChangeStateCpp(String json);
|
protected native void ChangeMotionCpp(String json, PlayMotionListFinishedCallback callback, boolean loop);
|
||||||
protected void ChangeMotion(String json){
|
public void PlayMotionList(List<String> motionList, boolean loop, PlayMotionListFinishedCallback callback)
|
||||||
Log.i("FaceActivity", "ChangeState:" + json);
|
{
|
||||||
ChangeStateCpp(json);
|
if(callback == null)
|
||||||
|
{
|
||||||
|
callback = new PlayMotionListFinishedCallback() {
|
||||||
|
@Override
|
||||||
|
public void OnPlayMotionListFinished() {
|
||||||
|
Log.i(TAG, "OnPlayMotionListFinished: ");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
final String DELIMITER = "\u001F"; // ASCII Unit Separator
|
||||||
|
String motion_list_str = String.join(DELIMITER, motionList);
|
||||||
|
ChangeMotionCpp(motion_list_str, callback, loop);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 添加这个缺失的方法
|
// 添加这个缺失的方法
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package com.hmwl.face_sdk;
|
||||||
|
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
public class Frame {
|
||||||
|
public String name;
|
||||||
|
public float x;
|
||||||
|
public float y;
|
||||||
|
public Frame(String name, float x, float y)
|
||||||
|
{
|
||||||
|
this.name = name;
|
||||||
|
this.x = x;
|
||||||
|
this.y = y;
|
||||||
|
}
|
||||||
|
public JSONObject toJsonObject(){
|
||||||
|
try {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("name", name);
|
||||||
|
jsonObject.put("x", x);
|
||||||
|
jsonObject.put("y", y);
|
||||||
|
return jsonObject;
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,32 +5,29 @@ import org.json.JSONObject;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
public class Motion {
|
public class Motion {
|
||||||
public String type = "no";
|
public String name = "no";
|
||||||
public List<String> png_names = new ArrayList<>();
|
public List<Frame> frames = new ArrayList<>();
|
||||||
|
public Motion(String name, List<Frame> frames)
|
||||||
|
{
|
||||||
|
this.name = name;
|
||||||
|
this.frames = frames;
|
||||||
|
}
|
||||||
|
|
||||||
public JSONObject toJsonObject() {
|
public JSONObject toJsonObject() {
|
||||||
try {
|
try {
|
||||||
JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
jsonObject.put("type", type);
|
jsonObject.put("name", name);
|
||||||
JSONArray ja = new JSONArray();
|
JSONArray jframes = new JSONArray();
|
||||||
for(int i = 0; i < png_names.size(); ++i){
|
for(int i = 0; i < frames.size(); ++i){
|
||||||
ja.put(png_names.get(i));
|
jframes.put(frames.get(i).toJsonObject());
|
||||||
}
|
}
|
||||||
jsonObject.put("png_names", ja);
|
jsonObject.put("frames", jframes);
|
||||||
return jsonObject;
|
return jsonObject;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String toJson() {
|
|
||||||
try {
|
|
||||||
return toJsonObject().toString();
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package com.hmwl.face_sdk;
|
||||||
|
|
||||||
|
import org.json.JSONArray;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class MotionList {
|
||||||
|
public List<Motion> motions = new ArrayList<>();
|
||||||
|
public JSONObject toJsonObject() {
|
||||||
|
try {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
JSONArray jMotions = new JSONArray();
|
||||||
|
for(int i = 0; i < motions.size(); ++i){
|
||||||
|
jMotions.put(motions.get(i).toJsonObject());
|
||||||
|
}
|
||||||
|
jsonObject.put("motions", jMotions);
|
||||||
|
return jsonObject;
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return new JSONObject();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public String toJsonString(){
|
||||||
|
return toJsonObject().toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,8 +4,9 @@ glslangValidator -V app/src/main/assets/shaders/bg.vert -o app/src/main/assets/s
|
|||||||
glslangValidator -V app/src/main/assets/shaders/texture.frag -o app/src/main/assets/shaders/texture.frag.spv
|
glslangValidator -V app/src/main/assets/shaders/texture.frag -o app/src/main/assets/shaders/texture.frag.spv
|
||||||
glslangValidator -V app/src/main/assets/shaders/texture.vert -o app/src/main/assets/shaders/texture.vert.spv
|
glslangValidator -V app/src/main/assets/shaders/texture.vert -o app/src/main/assets/shaders/texture.vert.spv
|
||||||
|
|
||||||
glslangValidator -V app/src/main/assets/shaders/texture_thick.frag -o app/src/main/assets/shaders/texture_thick.frag.spv
|
|
||||||
glslangValidator -V app/src/main/assets/shaders/texture_thick.vert -o app/src/main/assets/shaders/texture_thick.vert.spv
|
|
||||||
|
|
||||||
glslangValidator -V app/src/main/assets/shaders/simple_shader.frag -o app/src/main/assets/shaders/simple_shader.frag.spv
|
glslangValidator -V app/src/main/assets/shaders/simple_shader.frag -o app/src/main/assets/shaders/simple_shader.frag.spv
|
||||||
glslangValidator -V app/src/main/assets/shaders/simple_shader.vert -o app/src/main/assets/shaders/simple_shader.vert.spv
|
glslangValidator -V app/src/main/assets/shaders/simple_shader.vert -o app/src/main/assets/shaders/simple_shader.vert.spv
|
||||||
|
|
||||||
|
glslangValidator -V app/src/main/assets/shaders/texture_thick.frag -o app/src/main/assets/shaders/texture_thick.frag.spv
|
||||||
|
rem glslangValidator -V app/src/main/assets/shaders/texture_thick.vert -o app/src/main/assets/shaders/texture_thick.vert.spv
|
||||||
|
|
||||||
|
|||||||
@@ -80,4 +80,7 @@ dependencies {
|
|||||||
implementation 'com.google.flogger:flogger-system-backend:0.7.4'
|
implementation 'com.google.flogger:flogger-system-backend:0.7.4'
|
||||||
|
|
||||||
implementation 'com.google.guava:guava:31.1-android'
|
implementation 'com.google.guava:guava:31.1-android'
|
||||||
|
|
||||||
|
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.7") // 提供 lifecycleScope
|
||||||
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.9.0")
|
||||||
}
|
}
|
||||||
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 4.1 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 3.1 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 3.5 KiB |
|
After Width: | Height: | Size: 3.6 KiB |
|
After Width: | Height: | Size: 3.7 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 3.7 KiB |
|
After Width: | Height: | Size: 3.6 KiB |
|
After Width: | Height: | Size: 3.5 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 4.1 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 3.5 KiB |
|
After Width: | Height: | Size: 3.7 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 4.0 KiB |
|
After Width: | Height: | Size: 4.1 KiB |
|
After Width: | Height: | Size: 4.2 KiB |
|
After Width: | Height: | Size: 4.4 KiB |
|
After Width: | Height: | Size: 4.6 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 4.3 KiB |
|
After Width: | Height: | Size: 4.2 KiB |
|
After Width: | Height: | Size: 4.1 KiB |
|
After Width: | Height: | Size: 4.0 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 3.7 KiB |
|
After Width: | Height: | Size: 3.6 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 3.5 KiB |
|
After Width: | Height: | Size: 3.6 KiB |
|
After Width: | Height: | Size: 3.7 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 4.0 KiB |
|
After Width: | Height: | Size: 4.2 KiB |
|
After Width: | Height: | Size: 4.4 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 4.6 KiB |
|
After Width: | Height: | Size: 4.8 KiB |
|
After Width: | Height: | Size: 4.9 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 5.0 KiB |
|
After Width: | Height: | Size: 5.0 KiB |
|
After Width: | Height: | Size: 4.9 KiB |
|
After Width: | Height: | Size: 4.8 KiB |
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 4.6 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 4.4 KiB |
|
After Width: | Height: | Size: 4.2 KiB |
|
After Width: | Height: | Size: 4.1 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 3.6 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 3.1 KiB |