문제

So As objects get further away from me I want to apply a fade. The objects are textured.

I believe the colour of the object is controlled via this line

glVertexAttribPointer(GLKVertexAttribColor, 4, GL_FLOAT, GL_FALSE, sizeof(Vertex), (const GLvoid *) offsetof(Vertex, Color));

Instead of the colour being taken from the Vertex array, is there away to insert a colour in to this?

I have tried setting glColor4 etc and setting

effect.useConstantColor = YES;
effect.constantColor =  self.color;
도움이 되었습니까?

해결책

Another way to do this is to use fog. Check out the docs for the GLKBaseEffect fog property

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top