Open Elideb opened 12 years ago
I have synced my fork to the latest version of FFWD and fixed the conflicts in Texture. Moved all GetPixel/SetPixel operations to Texture2D and switched to the byte[] approach.
One more test to verify things work. To fully check it, set "Generate Mipmaps" to True in the XNA texture's properties.
public void Start()
{
texture = (Texture2D)Instantiate(this.renderer.material.mainTexture);
this.renderer.material.mainTexture = this.texture;
// duplicate the original texture and assign to the material
// colors used to tint the first 3 mip levels
var colors = new Color[3];
colors[0] = Color.red;
colors[1] = Color.green;
colors[2] = Color.blue;
var mipCount = Mathf.Min(3, texture.mipmapCount);
// tint each mip level
for (var mip = 0; mip < mipCount; ++mip)
{
var cols = texture.GetPixels(mip);
for (var i = 0; i < cols.Length; ++i)
{
cols[i] = Color.Lerp(cols[i], colors[mip], 0.33f);
}
texture.SetPixels(cols, mip);
}
texture.Apply(false, false);
}
I am getting a "the 'optional parameter' cannot be used it is not part of the 3.0 c# language specification" error. On Texture2D.cs
Total of 7 places...lines 67, 82, 127, 147, 166, 177 and 188.
Anytime something like: public void SetPixels(Color[] colors, int miplevel = 0) ...occurs
Apparently xbox and windows phone only use .NET 3.0, I am trying the suggestion linked below...just deleting the "= 0" http://forums.create.msdn.com/forums/p/89928/556025.aspx
This occurs when debugging the FFWD.Unity.Tests XNA project.
i'll add this note to Elideb's fork...not sure if I was testing what you guys wanted tested...however I did notice the "optional parameter" still in the Texture2D.cs so it is worth noting. Just going through and deleting the "=0" made the error go away, not sure if it still functions as desired however. Materials and textures still seem to make it onto their meshes :-)
I've learnt the lesson and created WP7 and X360 versions of my test project. I've tested the last commit and it works on WP7.
However, calling GetPixel and SetPixel each frame for each pixel in a 64x64 texture takes 6 seconds per frame in the WP7 emulator. Only calling SetPixels each frame does much better (16 ticks), which is to be expected.
Awesome, I will test soon...hopefully whilst working on integrating Terrain, any thoughts here: https://github.com/maconbot/FFWD/issues/1
After clearing out the UnityTests project and known errors...I compiled your XNA, the errors that were there are gone, now there is a bunch of warnings 14 or so.
And 3 errors: Error 1 Error loading pipeline assembly "C:\Users\Chad\Desktop\Elideb-FFWD-703b77d\Elideb-FFWD-703b77d\Tests\FFWD.Unity.Tests\FFWD.Unity.Tests.Scripts\bin\x86\Debug\FluentAssertions.dll". FFWD.Unity.Tests.Win Error 9 Error loading pipeline assembly "C:\Users\Chad\Desktop\Elideb-FFWD-703b77d\Elideb-FFWD-703b77d\Tests\FFWD.Unity.Tests\FFWD.Unity.Tests.Scripts\bin\x86\Debug\FluentAssertions.dll". FFWD.Unity.Tests.WP7 Error 17 Error loading pipeline assembly "C:\Users\Chad\Desktop\Elideb-FFWD-703b77d\Elideb-FFWD-703b77d\Tests\FFWD.Unity.Tests\FFWD.Unity.Tests.Scripts\bin\x86\Debug\FluentAssertions.dll". FFWD.Unity.Tests.X360
Warnings: Are just related to my machine so ignoring those.
@maconbot I've integrated Fehaar's latest changes, which fix the compilation and dependencies of the tests. I've tested them on a fresh copy of my repo and everything seems to be fine. Please, can you check things are OK in your machine too?
This fixes issue #27.
Testing code for different cases: