Replies: 6 comments 16 replies
-
过两天放假我来尝试加下~ |
Beta Was this translation helpful? Give feedback.
-
这个 "arrow(0.3).primitive" 怎么使用呢,我这样使用: world:create_entity {
policy = {
"ant.render|render",
},
data = {
scene = {
s = {1, 1, 1}, -- 缩放
t = {0, 1, 0}, -- 位置
},
material = "/pkg/ant.resources/materials/mesh_shadow.material",
visible = true,
mesh = "arrow(0.3).primitive",
}
} 会报错: [2024-06-07 12:38:53.49][ERROR]( ant.window|window ) Layout: a_texcoord0, is not declared or not equal to varyings defined
stack traceback:
( service:6 )
G:/ant/ant/pkg/ant.render/render_system/render_system.lua:199: in upvalue 'check_varyings'
G:/ant/ant/pkg/ant.render/render_system/render_system.lua:216: in local 'f'
G:/ant/ant/pkg/ant.world/main.lua:476: in field '_pipeline_entity_init'
G:/ant/ant/pkg/ant.world/main.lua:61: in method '_flush_entity_queue'
G:/ant/ant/pkg/ant.world/entity_system.lua:63: in local 'func'
G:/ant/ant/pkg/ant.world/main.lua:379: in upvalue 'update_func'
G:/ant/ant/pkg/ant.world/main.lua:404: in field '_pipeline_update'
G:/ant/ant/pkg/ant.world/main.lua:588: in method 'pipeline_update'
G:/ant/ant/pkg/ant.window/service/window.lua:76: in upvalue 'f' |
Beta Was this translation helpful? Give feedback.
-
我目前还在尝试绘制cube,有一些基础问题想请教下:
|
Beta Was this translation helpful? Give feedback.
-
我觉得可能得考虑多种情况,比如应该有这样一个材质:在绘制纯色的primitive的对象时,边缘处应该有明显的明暗变化。 |
Beta Was this translation helpful? Give feedback.
-
我暂时绘制了一版球,以下三角面数依次是20/80/320/1480,使用的Icosphere算法 为了让球的阴影表现正确,我是不是应该给每个面指定法向量呢?我目前暂时只知道可以给顶点指定法向量,像这样: local vb = {
-0.5, 0.5, 0.5, 0, 1, 0, --left top
0.5, 0.5, 0.5, 0, 1, 0, --right top
-0.5, -0.5, 0.5, 0, 1, 0, --left bottom
0.5, -0.5, 0.5, 0, 1, 0, --right bottom
}
vb = {
start = 0,
num = numv,
declname = "p3|n3",
handle = bgfx.create_vertex_buffer(vb, layout.handle),
} #169 (reply in thread) |
Beta Was this translation helpful? Give feedback.
-
primitive 光照不正常的问题已初步定位。是因为: https://github.com/ejoy/ant/blob/master/pkg/ant.render/ibl/ibl.lua#L325 idl 是在 这里有点设计问题,需要再考虑一下如何修正。 |
Beta Was this translation helpful? Give feedback.
-
今天我增加了一个预制几何体的特性,取代之前在 ant.entity|entity 中的 api 。见 #166
之前的
就可以写成
这里的 mesh 之前是填写 vfs 路径。目前 .primitive 后缀被扩展为调用一段代码生成 mesh 。可以传参数,参数编码在字符串中。比如箭头可以写成 ""arrow(0.3).primitive" 。
我希望未来支持更多的几何体,比如立方体、球、等等。有没有人愿意做这个事情?可以直接提 pr 。
Beta Was this translation helpful? Give feedback.
All reactions