Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - castor76

Pages: [1] 2
Other Packages / Re: Tasharen Fog of War
« on: December 02, 2018, 11:15:03 PM »
Would love to try this, but it is deprecated. Is there any way I can grab it/ buy it?

NGUI 3 Support / Re: UITexture custom shader not working at all.
« on: February 17, 2016, 12:19:42 PM »

I got it!

Wow... ok so I had to create some shaders with specific naming convention.. original , original 1 2 3 etc... I see!

I think this info should really be available upfront somewhere in the doc under UITexture.. or at ScrollView.. or at Shader section if there is one.

It took me really long time to find this info. Just didn't realize that NGUI was expecting such convention.

NGUI 3 Support / Re: UITexture custom shader not working at all.
« on: February 17, 2016, 11:44:13 AM »
Yeap... I think that's it...

If I unparent it off the ScrollView, it seems to work!

So ScrollView is forcing the issue here... humm...... I think NGUI is trying to figure out which type of shader it needs to use to properly apply its clipping to its child widgets and changing it....

Now I got to figure out so that ScrollView doesn't force it upon my UITexture...

I will try applying the texture and shader first under different parent widget and then move it back?

NGUI 3 Support / Re: UITexture custom shader not working at all.
« on: February 17, 2016, 11:15:26 AM »
Tried assigning dynamicMaterial.. but it says it is null :(

mapTexture.drawCall.dynamicMaterial.shader = testShader;


I even tried :

mapTexture.mainTexture = Get_CurrentMap();
mapTexture.drawCall.dynamicMaterial.shader = testShader;

And this is with the UITexture inspector saying that I have my custom material selected. ( I put one in to test..)

I thnk UITexture when used with its own texture (not shared from atlas) or when supplied my own custom material (and shader) , it should render separately and not use the default shader. but for some reason, it always keep using the default shader... very sad.. Perhaps because the UITexture itself is child of ScrollView?

NGUI 3 Support / Re: UITexture custom shader not working at all.
« on: February 17, 2016, 11:05:31 AM »
No.. I am not doing anything funky with NGUI after I assigned it.. I don't really touch NGUI code, and the experiment is simple one really..

NGUI 3 Support / Re: UITexture custom shader not working at all.
« on: February 17, 2016, 10:51:34 AM »
I did more experiments ..

I have tried to assign shader by code after assigning texture.

The UITexture inspector indicates the correctly assigned shader on its shader option, but it still uses Unlit - Transparent Colored.

And I think this has to be batching issue. Somehow, I need to make this UITexture not batched by using the same Unlit - Transparent Colored shader..

NGUI 3 Support / Re: UITexture custom shader not working at all.
« on: February 17, 2016, 10:44:19 AM »
It is not going to work.. I don't think there is even Renderer attached to UITexture widget. I think NGUI handles it somewhere else.. (not sure)

But even when I try it return null.

Renderer ren = mapTexture.GetComponent<Renderer>();

Is null and trying to Debug.Log(ren.sharedMaterial) freezes Unity. (not the usual error pause stuff.. total Unity unresponsive freeze.)

NGUI 3 Support / Re: UITexture custom shader not working at all.
« on: February 17, 2016, 10:31:40 AM »
This leads to me thinking that maybe the UITexure is batched in NGUI for some reason, and not a dynamic as I want it to be... I don't know how to set it to... there isn't any options and NGUI code is deep...

But then again, strange thing is that when I assign any other shader, it does uses Unlit - Transparent Colored shader at the end, but it fails to clip from my scrollView parent.

When I select scrollView and then disable clipping, and then enable it again, it then... all of sudden clips! But obviously, this isn't my custom shader..

NGUI 3 Support / Re: UITexture custom shader not working at all.
« on: February 17, 2016, 10:27:10 AM »
For the testing purpose, I didn't even use script API to assign shader , only texture.

public UITexture mapTexture;

mapTexture.mainTexture = Get_CurrentMap();

And this works.. it gets the texture and assigns to UITexture. Problem is shader.

I have tried to remove shader from the option and then run ... it automatically creates Unlit - Transparent Colored, which is correct.

When I assign any other shader, it does stay like that in the UITexture options. But! it still uses Unlit - Transparent Colored shader. I can confirm this because when I edit Unlit - Transparent Colored shader, it reflects the changes.

NGUI 3 Support / Re: UITexture custom shader not working at all.
« on: February 17, 2016, 10:18:44 AM »
Further experiment tells me that no matter what I do, UITexture always just use Unlit - Transparent Colored only..

There is no use of putting in my own or any other shader to the UITexture inspector options. Or material. It just uses Unlit - Transparent Colored shader no matter what I do...

Am I missing something here?

NGUI 3 Support / UITexture custom shader not working at all.
« on: February 17, 2016, 10:04:02 AM »
I want to use a custom shader for UITexture so I have done some experiments but I can't never get it to work properly.

The test I have done is using shader from the NGUI itself, just copy pasted into different file and then changing its shader name. ( I know how shader works and so the shader itself is working)

I used the transparent 2 for clipping, but this is what happens.

If I assign test shader to the shader option, and just link its maintexture by API script, it does show the texture, but with no clipping, and it just seems to be using the default one that NGUI is using, because no matter what I do to the shader code, it doesn't change at all. This is also true when I restart the game completely.

So for example if I let shader to out put 0 , for extreme testing, it doesn't... it still shows my texture itself. This is why I believe that NGUI is not using the shader I have told it to.

I have also tried to use material instead, but the same thing happens.

I have gone through forum and found something about dynamicMaterial.. is this something I have to tap into? I don't need to modify the material on the fly.. I just want it to use my custom shader (for example invert)

I don't mind draw calls and all that because there is only one of this widget in the UI.

Any ideas? I think I am using NGUI version 3.7 something.. last year Aug something like that... Not sure.. how do I check for the version number? I would also like to not update NGUI this time, because the project is closed and I don't want to introduce any possible changes other than the one that I am trying to do.


This is rather hard to explain, but I would like to

Convert 3D position into non UI Camera's view point, and then use that point in the UI camera to get the world position in the UI camera so I can make my UI element follow the object in 3D.

I have sort of got this working except that I don't want to have half pixel like situation because of the precise value I get back from all those calculation.

Is there function in NGUI that I can use to "snap" the transform value of a widget to be pixel perfect to my UI camera? My UI's setting is Flexible with pixel perfect option.

NGUI 3 Support / Problem with Flexible UI in Windows 8 or 10
« on: November 30, 2015, 05:59:38 AM »
I have my game running with Flexible setting for UIRoot (with 720 as min). And it works fine in Windows 7 desktop.

Problem is with Windows 8 and 10 laptops. The problem is hard to explain, but I will give it a go here..

1. When the game's resolution is set to say 1280x720 windowed in 1920x1080 desktop resolution, the game itself is fine, but the UI always looks like as if it is 1280x720 full screen resolution. Therefore the UI gets cropped out and I can't access the buttons etc. Because the UI setting is Flexible and pixel perfect, it should display fine but no...

2. When the game's resolution is set to say 1920x1080 fullscreen or windowed, the UI looks like as if it is 1280x720 ( not pixel perfect ) I can access the buttons but this clearly is not right.

My suspicion lays down to Adjust by DPI option which I have turned on. But I thought it will only affect mobile devices.. perhaps not... perhaps Screen.dpi doesn't work well for Windows 8 and 10 laptops..

In any case, I am going to try and turn that option off to see if it can help me, but just want to report this.

NGUI 3 Support / Re: Default texture setting
« on: August 12, 2014, 07:55:39 AM »

I have done this now and tried to update textures with "alpha is transparency" setting turned on.
The resulting atlas texture is the same and as far as I am concerned it is cool now.

It doesn't automatically do it for me, but at least keeps the setting when I turned it on before adding to the atlas. (which is acceptable work around)  :)

NGUI 3 Support / Re: Default texture setting
« on: August 12, 2014, 07:09:03 AM »
"Original textures are not important"

Well, that is not true in my case. Original texutres are IMPORTANT for me.

I don't think having "Alpha is transparency" for original textures are not going to affect making of the atlas texture.

I do want the original texture's "Alpha is transparency" setting to be turned on.

Where can I hack in so I can test this? For my textures (pngs with alpha in opacity" is not "natural" if it is not set as "Alpha is transparency". At least for my project and my usage of source textures. I do use source textures else where.

Pages: [1] 2