Page 3 of 3

Re: Light intensity

Posted: Thu Jan 18, 2018 12:48 pm
by B.Y.O.B.
I think you don't even need the alpha=0 border.
Just set the node with alpha mode to wrap to black and you're done.

Re: Light intensity

Posted: Fri Jan 19, 2018 9:54 pm
by Luximage
In your image in the previous post the rock keeps repeating and the character listening to music has no alpha channel.

One other thing,is it normal behavior in the imagemap node the wrap modes(clamp,white,black) to only work with the default channel?
In any other case of channel the texture keeps repeating.

Re: Light intensity

Posted: Fri Jan 19, 2018 10:52 pm
by B.Y.O.B.
Luximage wrote: Fri Jan 19, 2018 9:54 pm One other thing,is it normal behavior in the imagemap node the wrap modes(clamp,white,black) to only work with the default channel?
In any other case of channel the texture keeps repeating.
It was a bug that is now fixed in LuxCore. You need to recompile to get the fix.
Luximage wrote: Fri Jan 19, 2018 9:54 pm In your image in the previous post the rock keeps repeating and the character listening to music has no alpha channel.
Yes, both is like it should be. The rock is set to repeat and the character has a blue background, only the edge pixels have alpha=0.
It is an example, you can change lots of settings (or the 2D mappings of the textures) to make it look like you want.

Re: Light intensity

Posted: Wed Nov 20, 2019 3:31 pm
by valenn
Is it possible that this isn't working anymore? I'm setting "scene.textures.texture1.wrap = clamp" but it still works like "repeat"

Re: Light intensity

Posted: Wed Nov 20, 2019 9:34 pm
by Dade
valenn wrote: Wed Nov 20, 2019 3:31 pm Is it possible that this isn't working anymore? I'm setting "scene.textures.texture1.wrap = clamp" but it still works like "repeat"
It seems to still work here, can you post your test scene ?

Re: Light intensity

Posted: Thu Nov 21, 2019 9:14 am
by valenn
Dade wrote: Wed Nov 20, 2019 9:34 pm
valenn wrote: Wed Nov 20, 2019 3:31 pm Is it possible that this isn't working anymore? I'm setting "scene.textures.texture1.wrap = clamp" but it still works like "repeat"
It seems to still work here, can you post your test scene ?
Hmm, you're right it is working, but not as I expected. I guess my issue is that I'm loading textures from memory and not from files. I noticed that "DefineImageMap" accepts wrapping type and when I set it there it works!

The way I work with textures is:
I use

Code: Select all

DefineImageMap("myimage", ...)
and then use it as

Code: Select all

scene.textures.texturename.type = imagemap
scene.textures.texturename.file = myimage
scene.textures.texturename.wrap = clamp
(wrap is ignored here and what was passed to DefineImageMap is used)

Is this usage wrong? If I use DefineImageMap, can this image map only be used with wrapping specified when defining it? Is there a reason why image map cannot be used with differrent wrap types in different textures?

Re: Light intensity

Posted: Thu Nov 21, 2019 9:41 am
by Dade
valenn wrote: Thu Nov 21, 2019 9:14 am Hmm, you're right it is working, but not as I expected. I guess my issue is that I'm loading textures from memory and not from files. I noticed that "DefineImageMap" accepts wrapping type and when I set it there it works!

The way I work with textures is:
I use

Code: Select all

DefineImageMap("myimage", ...)
and then use it as

Code: Select all

scene.textures.texturename.type = imagemap
scene.textures.texturename.file = myimage
scene.textures.texturename.wrap = clamp
(wrap is ignored here and what was passed to DefineImageMap is used)

Is this usage wrong? If I use DefineImageMap, can this image map only be used with wrapping specified when defining it? Is there a reason why image map cannot be used with differrent wrap types in different textures?
Mmmm, I'm checking the code: https://github.com/LuxCoreRender/LuxCor ... he.cpp#L83

You should get an error in the case you described because:

1) The image cache checks if the image has been defined. The warp mode is part of the cache key so it is not found (you have defined "myimage" with a different wrap mode). File name, gamma, selection type, storage type, wrap type are all part of the cache key.

2) The cache entry "myimage" is not found so the image cache try to load a file with name"myimage".

3) You should get a file not found error (I assume the "myimage" doesn't exist).

Aren't you receiving an error ?

Re: Light intensity

Posted: Thu Nov 21, 2019 11:19 am
by valenn
Dade wrote: Thu Nov 21, 2019 9:41 am
Mmmm, I'm checking the code: https://github.com/LuxCoreRender/LuxCor ... he.cpp#L83

You should get an error in the case you described because:

1) The image cache checks if the image has been defined. The warp mode is part of the cache key so it is not found (you have defined "myimage" with a different wrap mode). File name, gamma, selection type, storage type, wrap type are all part of the cache key.

2) The cache entry "myimage" is not found so the image cache try to load a file with name"myimage".

3) You should get a file not found error (I assume the "myimage" doesn't exist).

Aren't you receiving an error ?
I see no errors. Console output looks like this (relevant part)

Code: Select all

[SDL][121.907] Define ImageMap: image_0
[SDL][121.954] Texture definition: texture_0
[SDL][121.954] Material definition: material_0
[SDL][121.969] Scene objects count: 1
try/catch doesn't catch anything as well. It just uses

If correct usage is to define 2 image maps (with different names) in the event I want to use it with both clamp and repeat in different textures, I'll just do that :)

Re: Light intensity

Posted: Thu Nov 21, 2019 11:38 am
by Dade
valenn wrote: Thu Nov 21, 2019 11:19 am If correct usage is to define 2 image maps (with different names) in the event I want to use it with both clamp and repeat in different textures, I'll just do that :)
Yes, it should be an effective workaround. Anyway I will try to reproduce the problem here and check why you don't get an error.

Re: Light intensity

Posted: Fri Nov 22, 2019 10:35 am
by Dade
Dade wrote: Thu Nov 21, 2019 9:41 am Mmmm, I'm checking the code: https://github.com/LuxCoreRender/LuxCor ... he.cpp#L83

You should get an error in the case you described because:

1) The image cache checks if the image has been defined. The warp mode is part of the cache key so it is not found (you have defined "myimage" with a different wrap mode). File name, gamma, selection type, storage type, wrap type are all part of the cache key.

2) The cache entry "myimage" is not found so the image cache try to load a file with name"myimage".

3) You should get a file not found error (I assume the "myimage" doesn't exist).

Aren't you receiving an error ?
I was wrong this is the correct list of steps:

1) The image cache checks if the image has been defined by a DefineImageMap(). Only the name is part of the cache key. If it is found, the stored image map is used, regardless of the asked gamma, wrap mode, etc.

2) If it is not found, the image cache checks if the image has been loaded from a file. File name, gamma, selection type, storage type, wrap type are all part of the cache key. If it is found, the stored image map is used.

3) If it is not found, the image cache try to load the image from file.

4) If it is not found, an image not found error is thrown.

This explain the behavior you were observing. So to recap: if DefineImageMap() is used, only the name does matter and the DefineImageMap() parameters wins over the properties one.

I agree, this is a bit not unexpected and counter intuitive but it is required to have some mechanic related to "AUTO" setting to work (like automatic storage type).