[RESOLVED] 2.0 2013.116 setting effects parameters on multitexture crashes

(build 2013.116, mac, simulator)

This section of code crashes with no error when included below:

[lua]

local effect = object.fill.effect

effect.pointLightColor = { .2, .2, .2, 20 }

effect.pointLightPos = { 0, 0, 20}

effect.ambientLightIntensity = 0 – value from 0 to 1

effect.attenuationFactors = { 5, 5, 10 }

[/lua]

Haven’t tried setting parameters of other effects than normalMaps with the new build- don’t know if that will crash also. 

[lua]

----NORMAL MAP COMPOSITE TEST

_w = display.contentWidth

_h = display.contentHeight

–********set up normal map multitexture*******

local multitexture =

{

    type=“composite”,

    paint1={ type=“image”, filename=“gravel_01_col.jpg” },

    paint2={ type=“image”, filename=“gravel_01_norm.jpg” }

}

local object = display.newRect( 0, 0, _w , _h )

object.fill = multitexture

object.fill.effect = “filter.normalMapWith1PointLight”

object.x = _w * .5

object.y = _h * .5

local effect = object.fill.effect

effect.pointLightColor = { .2, .2, .2, 20 }

effect.pointLightPos = { 0, 0, 20}

effect.ambientLightIntensity = 0 – value from 0 to 1

effect.attenuationFactors = { 5, 5, 10 }

[/lua]

In the newer daily builds, shader effects that take in two textures are defined in the format of “composite.”

I believe the following update will fix the issue you’re seeing.

object.fill.effect = “composite.normalMapWith1PointLight”

Thanks Bryan, using build 20, normal maps are working again.

Using:

object.fill.effect = “composite.normalMapWith1PointLight”

instead of

object.fill.effect = “filter.normalMapWith1PointLight”

The docs are now up to date:

http://docs.coronalabs.com/tachyon/guide/graphics/effects.html

I really need to look into the composite stuff - I am really hoping it’ll let me do my ‘smooth fog to any colour’ effect I want for dungeoneer :slight_smile:

In the newer daily builds, shader effects that take in two textures are defined in the format of “composite.”

I believe the following update will fix the issue you’re seeing.

object.fill.effect = “composite.normalMapWith1PointLight”

Thanks Bryan, using build 20, normal maps are working again.

Using:

object.fill.effect = “composite.normalMapWith1PointLight”

instead of

object.fill.effect = “filter.normalMapWith1PointLight”

(Deleted) - It works. :stuck_out_tongue:

hi Renato- try changing this line:

object.fill.effect = “filter.normalMapWith1PointLight” 

to 

object.fill.effect = “composite.normalMapWith1PointLight”

Does that work?

The docs are now up to date:

http://docs.coronalabs.com/tachyon/guide/graphics/effects.html

I really need to look into the composite stuff - I am really hoping it’ll let me do my ‘smooth fog to any colour’ effect I want for dungeoneer :slight_smile:

(Deleted) - It works. :stuck_out_tongue:

hi Renato- try changing this line:

object.fill.effect = “filter.normalMapWith1PointLight” 

to 

object.fill.effect = “composite.normalMapWith1PointLight”

Does that work?