Skip to content

Commit 8bdeac6

Browse files
committed
修复GLSL的问题,
修改publish (上传的源码内容包括了Common)
1 parent cd848df commit 8bdeac6

6 files changed

Lines changed: 71 additions & 53 deletions

File tree

build.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ plugins {
66
id 'org.jetbrains.kotlin.jvm' version '2.2.0' apply false
77
}
88

9+
tasks.register("publish-all") {
10+
group("build")
11+
description = "上传Fabric和Neoforge的内容到仓库中"
12+
dependsOn(":neoforge:publish",":fabric:publish")
13+
}
14+
915
subprojects {
1016
apply plugin: 'java'
1117
apply plugin: 'kotlin'

buildSrc/src/main/groovy/multiloader-common.gradle

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -115,26 +115,3 @@ processResources {
115115
}
116116
inputs.properties(expandProps)
117117
}
118-
def properties = new Properties()
119-
def repoFile = rootProject.file("repo.properties")
120-
if (repoFile.exists()) {
121-
repoFile.withInputStream { properties.load(it) }
122-
}
123-
publishing {
124-
publications {
125-
register('mavenJava', MavenPublication) {
126-
artifactId base.archivesName.get()
127-
from components.java
128-
}
129-
}
130-
repositories {
131-
maven {
132-
name = "maven"
133-
url = uri("https://nexus.jsdu.cn/repository/maven-releases/")
134-
credentials {
135-
username = properties.getProperty("repo.user") ?: ""
136-
password = properties.getProperty("repo.password") ?: ""
137-
}
138-
}
139-
}
140-
}
Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,26 @@
11
#version 330 core
22
in vec2 screen_uv;
3-
//layout (location = 0) out vec4 FragColor; // 保留原色
4-
//layout (location = 1) out vec4 BrightColor; // 模糊后的高亮结果
5-
out vec4 BrightColor; // 模糊后的高亮结果
3+
out vec4 BrightColor;
64

7-
//uniform sampler2D image; // 原场景
8-
uniform sampler2D bright; // 高亮通道
9-
uniform float uOffset; // Kawase 偏移
10-
uniform float intensity; // Bloom 强度
5+
uniform sampler2D bright;
6+
uniform float uOffset;
7+
uniform float intensity;
118

129
void main() {
13-
// // 原图颜色
14-
// vec4 sceneColor = texture2D(image, screen_uv);
15-
// FragColor = sceneColor;
16-
vec4 brightColor = texture2D(bright, screen_uv);
17-
vec2 size = 1.0 / textureSize(bright, 0);
18-
// Kawase 模糊采样
10+
vec4 brightColor = texture(bright, screen_uv);
11+
vec2 size = 1.0 / vec2(textureSize(bright, 0));
1912
vec2 o = size * uOffset;
20-
vec3 blur =
21-
texture2D(bright, screen_uv + vec2(o.x, 0.0)).rgb +
22-
texture2D(bright, screen_uv + vec2(-o.x, 0.0)).rgb +
23-
texture2D(bright, screen_uv + vec2(0.0, o.y)).rgb +
24-
texture2D(bright, screen_uv + vec2(0.0, -o.y)).rgb +
25-
texture2D(bright, screen_uv + vec2(o.x, o.y)).rgb +
26-
texture2D(bright, screen_uv + vec2(-o.x, o.y)).rgb +
27-
texture2D(bright, screen_uv + vec2(o.x, -o.y)).rgb +
28-
texture2D(bright, screen_uv + vec2(-o.x, -o.y)).rgb;
2913

30-
blur *= 0.125; // 平均值
14+
vec3 blur =
15+
texture(bright, screen_uv + vec2(o.x, 0.0)).rgb +
16+
texture(bright, screen_uv + vec2(-o.x, 0.0)).rgb +
17+
texture(bright, screen_uv + vec2(0.0, o.y)).rgb +
18+
texture(bright, screen_uv + vec2(0.0, -o.y)).rgb +
19+
texture(bright, screen_uv + vec2(o.x, o.y)).rgb +
20+
texture(bright, screen_uv + vec2(-o.x, o.y)).rgb +
21+
texture(bright, screen_uv + vec2(o.x, -o.y)).rgb +
22+
texture(bright, screen_uv + vec2(-o.x, -o.y)).rgb;
3123

32-
// Bloom 结果(模糊 + 强度)
24+
blur *= 0.125;
3325
BrightColor = vec4(blur * intensity, 1.0);
3426
}

fabric/build.gradle

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,28 @@ def repoFile = rootProject.file("repo.properties")
6666
if (repoFile.exists()) {
6767
repoFile.withInputStream { properties.load(it) }
6868
}
69-
repositories {
70-
maven {
71-
name = "repo"
72-
url = uri("https://nexus.jsdu.cn/repository/maven-releases/")
69+
publishing {
70+
publications {
71+
mavenJava(MavenPublication) {
72+
groupId = rootProject.group
73+
artifactId = "${rootProject.artifact}-fabric"
74+
version = "${rootProject.version}"
75+
artifact(tasks.named("remapJar"))
76+
artifact(tasks.named("sourceWithCommon")) {
77+
classifier = "sources"
78+
}
79+
}
80+
}
81+
82+
repositories {
83+
maven {
84+
name = "repo"
85+
url = uri("https://nexus.jsdu.cn/repository/maven-releases/")
86+
credentials {
87+
username = properties.getProperty("repo.user") ?: ""
88+
password = properties.getProperty("repo.password") ?: ""
89+
}
90+
}
7391
}
7492
}
7593
loom {

gradle.properties

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# Important Notes:
22
# Every field you add must be added to the root build.gradle expandProps map.
33
# Project
4-
version=2.1.0
5-
group=cn.coostack.cooparticlesapi
4+
version=2.1.1
5+
group=cn.coostack
6+
artifact="cooparticlesapi"
67
java_version=21
78
# Common
89
minecraft_version=1.21.1

neoforge/build.gradle

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,30 @@ repositories {
7979
dirs "../depend"
8080
}
8181
}
82+
publishing {
83+
publications {
84+
mavenJava(MavenPublication) {
85+
groupId = rootProject.group
86+
artifactId = "${rootProject.artifact}-neoforge"
87+
version = "${rootProject.version}"
88+
artifact(tasks.named("jar"))
89+
artifact(tasks.named("sourceWithCommon")) {
90+
classifier = "sources"
91+
}
92+
}
93+
}
94+
95+
repositories {
96+
maven {
97+
name = "repo"
98+
url = uri("https://nexus.jsdu.cn/repository/maven-releases/")
99+
credentials {
100+
username = properties.getProperty("repo.user") ?: ""
101+
password = properties.getProperty("repo.password") ?: ""
102+
}
103+
}
104+
}
105+
}
82106
dependencies {
83107
compileOnly fileTree(dir: "../compile_only_depend", includes: ["*.jar"])
84108
implementation "thedarkcolour:kotlinforforge-neoforge:5.9.0"

0 commit comments

Comments
 (0)