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.


Topics - castor76

Pages: [1]
1
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.

Thanks!

2
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.


3
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.

4
NGUI 3 Support / Default texture setting
« on: August 11, 2014, 02:58:07 AM »
I would like to have "alpha for transparency" setting ticked on for default NGUI texture setting.
We use the textures as is for our custom editor purpose so we want to have setting with above option to be ticked on by default?

Is there way? or do I have to hack some code into? ( I assume so..)

If I need to change some code, where should I look at?

Thanks in advance!


Pages: [1]