Author Topic: Image texture and UV map node?  (Read 14185 times)

2017-06-20, 22:36:02

melviso

  • Active Users
  • **
  • Posts: 398
    • View Profile
    • Portfoilo
I am having some issues with these nodes. I noticed if I link an image to the image texture node it fails to update if changes are made to the texture in a 2d painting application. Maybe a refresh button someone can click on that lets Blender update the texture?
Also the uv map node seems not to recognise a change of uv map for certain textures. Say u have two uv maps for a mesh and you change it in the uv map node. It doesn't update in the viewport or render.  Does this have anything to do with the 'must use object binary output'? Can you pls explain what that object binary means?

Thanks.

2017-06-20, 23:01:14
Reply #1

blanchg

  • Moderator
  • Active Users
  • ***
  • Posts: 414
    • View Profile
    • Blender exporter for Corona
I think I can add a refresh button.  Will depend on Blender support.
Not sure about the update, anything in the viewport is entirely Blender.

Multiple UV Maps require you to use the binary mesh output setting. .cgeo files.


2017-06-21, 15:26:29
Reply #2

melviso

  • Active Users
  • **
  • Posts: 398
    • View Profile
    • Portfoilo
Dope. The uvs are working the way they should. Thanks mate.

Yeah a refresh button would be nice. Whenever it can be added is fine.
Appreciate all the work, mate.

2017-06-26, 01:07:38
Reply #3

blanchg

  • Moderator
  • Active Users
  • ***
  • Posts: 414
    • View Profile
    • Blender exporter for Corona
There is a refresh button now.  It updates the material preview and the blender texture previews

2017-06-26, 20:46:45
Reply #4

melviso

  • Active Users
  • **
  • Posts: 398
    • View Profile
    • Portfoilo

2017-07-01, 01:42:45
Reply #5

melviso

  • Active Users
  • **
  • Posts: 398
    • View Profile
    • Portfoilo
If I need to separate a channel of a texture, say I pack textures into the rgba channel of one image. How do I separate them using the channel shader? Do I need to set the ones I don't want to zero?

2017-07-01, 02:56:59
Reply #6

burnin

  • Active Users
  • **
  • Posts: 1535
    • View Profile
:) Was just wondering similar.
How can one use chanels, alphas, layers... from texture formats as png, tif, exr? Is this supported?

2017-07-01, 04:52:08
Reply #7

melviso

  • Active Users
  • **
  • Posts: 398
    • View Profile
    • Portfoilo
Yeah, I wish it could be like ue4 where the texture node has a rgba channel. This helps me manage textures better and save me a lot of time and disk space. Speeds up rendering
Something like this where you can single out a texture you have packed in the rgba channels.

EDIT: Does anyone know if the normal shader works? The normal shader is used for normal maps, right? I have tried plugging normal maps to the corona material. Doesn't seem to work. How are normal maps plugged?
« Last Edit: 2017-07-01, 21:34:33 by melviso »

2017-07-02, 21:39:11
Reply #8

blanchg

  • Moderator
  • Active Users
  • ***
  • Posts: 414
    • View Profile
    • Blender exporter for Corona
The normal shader does work, the description from the documentation is: "Transforms any input map to a normal map - meaning it will be interpreted as normal map instead of height map when in bump slot"

I could do a new node that has RGBA outputs probably, using a combination of channel nodes it should be possible.  I use them combined with math nodes for the HSV and RGB curve nodes.

If someone works out before me what the node layout is would definitely help :)

When using the channel nodes it depends on what you want to do.  If you want a greyscale of say red then put red as the source for rgba however if you want just the red channel then use zero as the source for gba and red as the red source.

These operations are usually pretty quick but remember the more nodes in the texture then more work the renderer has to do.

2017-07-03, 10:15:40
Reply #9

melviso

  • Active Users
  • **
  • Posts: 398
    • View Profile
    • Portfoilo
Thanks for the explanation. The normal map did work my bad, sorry.

Appreciate all you are doing for Blender users. Thanks :-)

2017-07-03, 10:18:31
Reply #10

blanchg

  • Moderator
  • Active Users
  • ***
  • Posts: 414
    • View Profile
    • Blender exporter for Corona
Latest version has separate RGB and combine RGB nodes and a new math node that is a copy of the mix node but with numerical inputs

2017-07-03, 10:24:01
Reply #11

melviso

  • Active Users
  • **
  • Posts: 398
    • View Profile
    • Portfoilo

2017-07-17, 13:29:58
Reply #12

melviso

  • Active Users
  • **
  • Posts: 398
    • View Profile
    • Portfoilo
Hi blanchg,

Would it be possible for a alpha slot to be added to both the separate RGB and combine RGB nodes? Textures can also be packed into the alpha channel as well. Saving render time, disk space and re usability. :)


2017-07-17, 21:25:51
Reply #13

blanchg

  • Moderator
  • Active Users
  • ***
  • Posts: 414
    • View Profile
    • Blender exporter for Corona
I was initially going to make them both RGBA but ran into an issue. I will investigate again. Though due to the material setup required for this it likely won't improve performance.

2017-07-18, 01:32:30
Reply #14

melviso

  • Active Users
  • **
  • Posts: 398
    • View Profile
    • Portfoilo
Ok. Thanks mate.

I ran into another issue. The separate RGB node currently only works in the diffuse slot as color. I can't use the node to separate the packed textures into grayscale textures for the bump slot or mix shader/math shader amount slot. The result has no effect.

2017-07-18, 01:34:08
Reply #15

blanchg

  • Moderator
  • Active Users
  • ***
  • Posts: 414
    • View Profile
    • Blender exporter for Corona
You might need the color mapping node?

2017-07-18, 02:28:42
Reply #16

melviso

  • Active Users
  • **
  • Posts: 398
    • View Profile
    • Portfoilo
Color mapping node? Sorry, can't find it in the material editor.

The channel shader does separate the textures into greyscale and it works but the separate rgb node would be more convenient for this as it streamlines the process and cuts down on clutter in the material editor. This is how ue4 does its rgba separation for textures.
The image shows how I attached the nodes. Also wiring from any of the rgb to the amount slot of the mix/math shader doesn't yield the expected result when plugged into diffuse, reflect slots. In Blender cycles, the separate rgb node, works as grayscale when plugged.
In unreal engine, the image texture node has a normal, red, green, blue and alpha slots which can be used. Saves clutter and speeds things up. I am not sure if this can be implemented in Blender though. You also have to stipulate in the image settings in ue4 if the imported image is to be used as mask/grayscale textures. Maybe a tick use as grayscale box in the separate rgb node might do the trick?


2017-07-18, 02:32:29
Reply #17

blanchg

  • Moderator
  • Active Users
  • ***
  • Posts: 414
    • View Profile
    • Blender exporter for Corona
yeah it is possible... it will take some time I am working on it though.

2017-07-18, 02:36:37
Reply #18

melviso

  • Active Users
  • **
  • Posts: 398
    • View Profile
    • Portfoilo

2017-07-18, 02:41:48
Reply #19

blanchg

  • Moderator
  • Active Users
  • ***
  • Posts: 414
    • View Profile
    • Blender exporter for Corona
I meant the Channel shader before sorry.

2017-07-18, 05:00:53
Reply #20

melviso

  • Active Users
  • **
  • Posts: 398
    • View Profile
    • Portfoilo
No problem.

Also it seems the channel shader doesn't work with the bump slot too. It works fine with the diffuse, reflect, gloss slot, mix/math shader as well.

EDIT: The separate rgb node works with diffuse slot, reflect except bump. Using the curve node to crank up the strength of the channel before plugging to mixshader works. It just the bump slot doesn't work with separate rgb or channel shader.
EDIT2: Just an idea. Maybe a bump shader to connect the separate rgb node to with the bump shader node having bump strength parameter?

Appreciate everything you are doing. Thanks :-)
« Last Edit: 2017-07-19, 03:25:39 by melviso »

2017-07-19, 08:50:39
Reply #21

blanchg

  • Moderator
  • Active Users
  • ***
  • Posts: 414
    • View Profile
    • Blender exporter for Corona
v7.4.4 adds in the alpha output on rgb separate.

I can't add it back in on RGB combine.  No can do.

Outputs of RGB separate are now greyscale+alpha+mono outputs.  They work with bump... sometimes need normal shader.

I can't put the bump strenth onto another node, it is part of corona.  You can use the "add" mix node to modify a bump map though.

2017-07-20, 05:13:03
Reply #22

melviso

  • Active Users
  • **
  • Posts: 398
    • View Profile
    • Portfoilo
Thanks a ton blanchg. No worries about the rgb combine.

The bump works now. This is what I am encountering with the normal shader plugged to the bump. It looks very flat. With the plugin direct from the any of the separate slots, all the rgba are displayed in the bump instead of one. I have attached a texture map with different textures packed into the different channels along with the screengrabs. Pls feel free to use it in your test.


Hope I am not bothering you. No worries about the bump shader. I kinda suspected that wasn't possible. Thanks again :-)

2017-07-20, 22:28:54
Reply #23

blanchg

  • Moderator
  • Active Users
  • ***
  • Posts: 414
    • View Profile
    • Blender exporter for Corona
Thanks,

All this is speculation from observation :)

It appears the bump input is special and directly accesses the Image Texture node bypassing all other nodes except Normal node and Mix node using the "Add" function.

The normal node expects an actual normal map not a height map which is why it looks flat as the RGB indicates normal direction (this is also the reason why they look blue as most normals tend to be close to X,Y,Z = 0, 0, 1 = R, G, B).

So looks like you can't encode a heightmap into one of the image channels and use it.

When you made your image did you edit the channels directly or did you use different layers and flatten them.  If it was via layers ensure that the layer blend mode is set to "screen" or it will damage the color channels.

2017-07-21, 01:18:33
Reply #24

melviso

  • Active Users
  • **
  • Posts: 398
    • View Profile
    • Portfoilo
I edited the channels directly. using the separate rgb node works in the diffuse, reflect slot with the texture. I used the normal shader because you mentioned ''..sometimes need normal shader.'' So I was of the assumption that in order to use the separate rgb node with the bump sometimes it might require the normal shader if does not work kinda like a hack to get it working.

Yeah, appears bump map cannot work with separate rgb nodes in corona. I wonder why this works in Cycles though. Is this how Corona core was written?

Thanks for the nodes you added. Appreciate it :-)

2017-07-21, 01:23:13
Reply #25

blanchg

  • Moderator
  • Active Users
  • ***
  • Posts: 414
    • View Profile
    • Blender exporter for Corona
Yes all of the nodes available are from Corona core or a combination of the ones provided by Corona.


2017-07-21, 01:32:06
Reply #26

melviso

  • Active Users
  • **
  • Posts: 398
    • View Profile
    • Portfoilo
Ok. It would have been nice to pack into the channels and use in bump slot. Unfortunately that isn't possible.
No worries. Will have to paint each bump map and use as separate images.

Thanks.

« Last Edit: 2017-07-21, 07:01:43 by melviso »