Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Grid class of voxel example has fog effect but should not?

in Questions Posts: 411

@Simeon the grid in the voxel editor example (and shade) ‘fades’ away as a function of distance from the viewer camera. This effect shouldn't really be happening should it, unless the fog parameters are enabled?! I use the Grid class in my code and would like to avoid the 'fog effect'-any way to do that?

Comments

  • SimeonSimeon Admin Mod
    Posts: 5,054

    @piinthesky might have to defer this question to @John as he authored the grid effect. Will see what he says

  • JohnJohn Admin Mod
    edited July 27 Posts: 582

    Hey @piinthesky, I think this is a bit of an oversight due to some changes to do with mipmapping.

    For now you can add the following code to the Grid class in Grid:modified() right after the closing setContext():

    craft.texture(self.img):generateMipmaps()
    

    Which will generate mipmaps for the grid texture. Technically if no mipmaps are generated then craft shouldn't be using mip filtering but it is for some reason.

    Internally there is a thing called craft.texture which wraps up Codea images into a format that craft can use. I'm not happy with the way all this works (and the lack of documentation). I'm planning to unify everything so that there's only the image class and that will handle all this stuff more consistently.

  • Posts: 411

    @John, that works nicely, thanks.

Sign In or Register to comment.