@song2008_2001 跪求大佬
为了不沉 我厚着脸再顶顶
看报错是shader编译报错了好像。把shader贴出来,估计是用了苹果不支持的语法或特性了
(1)GaussianBlur.effect:
CCEffect %{
techniques:
- name: opaque
passes:- vert: vs:vert
frag: fs:frag
properties: &props
_color: { value: [1, 1, 1, 1], editor: { type: color } }
_textureSize: { value: [100,100],editor: { type: vector } } #textrueSize尺寸
_blur: { value: 100,editor: { type: int, slide: true , range : [0,100], step: 1 } }
- vert: vs:vert
- name: transparent
passes:- vert: vs:vert
frag: fs:frag
blendState:
targets:- blend: true
blendSrc: src_alpha
blendDst: one_minus_src_alpha
blendSrcAlpha: src_alpha
blendDstAlpha: one_minus_src_alpha
properties: *props
}%
- blend: true
- vert: vs:vert
CCProgram vs %{
precision highp float;
#include
#if USE_LOCAL
#include
#endif
#if SAMPLE_FROM_RT
#include <common/common-define>
//#include
#endif
in vec3 a_position;
in vec2 a_texCoord;
in vec4 a_color;
uniform Constant {
vec4 _color;
vec2 _textureSize;
float _blur;
};
out vec4 i_color;
out vec2 uv0;
out vec2 uv1;
out vec3 v_position;
out float offset_x[5];
out float offset_y[5];
out float weight[5];
void init()
{
offset_x[0] = 0.0 * _blur/_textureSize.x;
offset_x[1] = 0.1 * _blur/_textureSize.x;
offset_x[2] = 0.2 * _blur/_textureSize.x;
offset_x[3] = 0.3 * _blur/_textureSize.x;
offset_x[4] = 0.4 * _blur/_textureSize.x;
offset_y[0] = 0.0 * _blur/_textureSize.y;
offset_y[1] = 0.1 * _blur/_textureSize.y;
offset_y[2] = 0.2 * _blur/_textureSize.y;
offset_y[3] = 0.3 * _blur/_textureSize.y;
offset_y[4] = 0.4 * _blur/_textureSize.y;
weight[0] = 0.2270270270;
weight[1] = 0.1945945946;
weight[2] = 0.1216216216;
weight[3] = 0.0540540541;
weight[4] = 0.0162162162;
}
vec4 vert () {
vec4 pos = vec4(a_position, 1);
#if USE_LOCAL
pos = cc_matWorld * pos;
#endif
#if USE_PIXEL_ALIGNMENT
pos = cc_matView * pos;
pos.xyz = floor(pos.xyz);
pos = cc_matProj * pos;
#else
pos = cc_matViewProj * pos;
#endif
uv0 = a_texCoord;
#if SAMPLE_FROM_RT
uv1 = uv0;
CC_HANDLE_RT_SAMPLE_FLIP(uv1);
#endif
i_color = a_color;
#if USE_GAUSSIAN_BLUR
init();
#endif
return pos;
}
}%
CCProgram fs %{
precision highp float;
#include
#if USE_TEXTURE
#include
//#include
#endif
in vec4 i_color;
in vec2 uv0;
in float offset_x[5];
in float offset_y[5];
in float weight[5];
uniform Constant {
vec4 _color;
vec2 _textureSize;
float _blur;
};
vec4 frag () {
vec4 color =_color;
#if USE_GAUSSIAN_BLUR
color = texture(cc_spriteTexture, uv0) * weight[0];
for (int i=1; i<5; i++) {
color +=
texture(cc_spriteTexture, (vec2(uv0)+vec2(offset_x[i], 0)))
* weight[i]/2.0;
color +=
texture(cc_spriteTexture, (vec2(uv0)-vec2(offset_x[i], 0)))
* weight[i]/2.0;
color +=
texture(cc_spriteTexture, (vec2(uv0)+vec2(0, offset_y[i])))
* weight[i]/2.0;
color +=
texture(cc_spriteTexture, (vec2(uv0)-vec2(0, offset_y[i])))
* weight[i]/2.0;
}
#else
color = texture(cc_spriteTexture, uv0);
#endif
return color;
}
}%
贴了3个 您帮我看看 跪谢!
每日一顶 希望有懂的大佬帮看看
能否上传完整的demo?
崩溃的问题是 offset_x, offset_y, weight等是数组(数组每个元素是一个location,总共15个),应该是超过了设备限定的 vary 数量限制,造成某个location 会有多个变量。
可以通过uniform的方式规避
引擎组牛逼,活儿(技术)硬,还这么勤快
好的 感谢 !
我改改看下
这个报错是解决了 感谢!
请问这种原生端深层报错 怎样调试或者定位的?能不能教一下我 ,因为我又遇到了新bug
下图,看见这种bug我就不知如何下手,还请大佬赐教!再次鞠躬!
我这个报错和[这个帖子极度相似
https://forum.cocos.org/t/topic/158366
DescriptorSetValidator.cpp ine 149
但是我甚至连是哪个.effect 或者哪个图 文件报出来的错都不知如何定位 
你可以在编辑器上 看下你spine使用了哪个自定义材质,然后找到材质双击,查看使用的effect,之后查看里面的内容
查了 新崩溃位置没有使用材质 shader 请问DescriptorSetValidator.cpp ine 149 这个ios崩溃都有什么可能会引起 或者怎样规避
要看具体的崩溃堆栈,不确定崩溃的起点是哪,就确定不了问题根本问题
fillBuffersAndMerge是ts的什么组件引发的呢,spine还是什么,没demo是不好定位。
绑定未初始化的texture时return掉会有什么影响吗
渲染前需要texture是有效的,请检查下流程
解决了, return 然后报错回归自己写的代码层 修改自己代码解决的






