Monday, 17 August 2015

Solar System updated For Unity 5 - coming soon

I decided to update my best selling package on Unity asset store with overall rating of 5 and many downloads.
Get Solar System and receive updates - http://u3d.as/70w
I added free rotation and zoom around all the planets and Sun and changed shaders to be compatible with Unity 5. I also improved normal, height, albedo maps and increased all textures to 8096x8096 where it was possible without loosing quality.
Update should be available within next few days(weeks) depends how quickly Unity asset store admin approve update(usually it is quite fast process).














Wednesday, 5 August 2015

Adding google syntax highlighter to blogger

1. Log in to your blogger and go Template section.



2. Edit html, make a backup.
3. Copy the css from http://syntaxhighlighter.googlecode.com/svn/trunk/Styles/SyntaxHighlighter.css
and paste it between head tags (make sure you put the code inside CDATA )
<![CDATA[
-- css goes here
]]>
4. Add js references before </head> tag

<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shCore.js' type='text/javascript'></script>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushCpp.js' type='text/javascript'></script>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushCSharp.js' type='text/javascript'></script>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushCss.js' type='text/javascript'></script>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushDelphi.js' type='text/javascript'></script>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushJava.js' type='text/javascript'></script>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushJScript.js' type='text/javascript'></script>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushPhp.js' type='text/javascript'></script>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushPython.js' type='text/javascript'></script>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushRuby.js' type='text/javascript'></script>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushSql.js' type='text/javascript'></script>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushVb.js' type='text/javascript'></script>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushXml.js' type='text/javascript'></script>


5. Paste the js code before </body> tag

<script language='javascript'>
dp.SyntaxHighlighter.BloggerMode();
dp.SyntaxHighlighter.HighlightAll('code');
</script>

6. Save the template.
7. Compose code and put it between


<pre name="code" class="csharp">
public void ExampleCSharpMethod()
{
this.foo1 = 5;
}
</pre>

<pre name="code" class="js">
var Jquery-JavaScriptExample= $("#item1");
</pre>

<pre name="code" class="php">
echo "php says hi";
</pre>

Will give you this results

public void ExampleCSharpMethod()
{
   this.foo1 = 5;
}

var Jquery-JavaScriptExample= $("#item1");

echo "Php example code";
echo "php says hi";

8. All available languages : https://code.google.com/p/syntaxhighlighter/wiki/Languages
9. Escape characters : http://accessify.com/tools-and-wizards/developer-tools/quick-escape/default.php

Thursday, 30 July 2015

Launched new website for game developers. Quality materials & Textures.

I launched recently new website - http://www.gamesmaterials.com which main purpose is to store high quality materials ready to be used in Unity game engine and UDK and Cry Engine in the future.

At the moment there are 14 free and premium materials but I have already created over 50 materials that can be purchased from Unity asset store in one bundle : http://u3d.as/gq7

Any feedback and suggestion will be much appreciated. I will introduce very competitive subscription payment in the future and more free stuff as well as full projects.

Some finished examples:

- simple low poly cylinder with cobble material (4 textures - diffuse, occlusion, normal and height)




- Plane with window blocks material


- Plane with Destroyed concrete bunker material





Wednesday, 29 July 2015

Exporting HTML to PDF in ASP.NET MVC C#

In this tutorial we are going to set up dev environment to use html to pdf converter and convert previously saved wikipedia page to pdf.

1. Download and install application from http://wkhtmltopdf.org/ - FREE to use
2. Create new Asp.NET MVC application.
3. Add location to exe file in your web config file(this is installation path for previously installed wkhtmltopdf) - something like that :

 <add key="HtmlToPdfPath" value="C:\Program Files\wkhtmltopdf\bin\wkhtmltopdf.exe"/>


4. Download  https://en.wikipedia.org/wiki/CERN page and save it in My documents folder under PdfExample folder.



5. Create new api controller and call it HtmlPdf.
6. Alter Get(int value) web api method :

public string Get(string name)
        {
            string path = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "PdfExample");

            if (File.Exists(string.Format("{0}\\{1}", path, name)))
            {
                try
                {
                    string nameWithoutExtension = name.Replace(".html", string.Empty);
                    var psi = new ProcessStartInfo(System.Configuration.ConfigurationManager.AppSettings["HtmlToPdfPath"], string.Format("{0} {1}.pdf", name, nameWithoutExtension));
                    psi.WorkingDirectory = path + "/";

                    var proc = Process.Start(psi);
                    proc.WaitForExit();

                    return "completed";
                }
                catch (Exception ex)
                {
                    return ex.InnerException.ToString();
                }
                
            }
            else
            {
                return "Failed to convert";
            }


        }
}

7. Run your application and open url:

http://localhost:yourport/api/htmlpdf?name=CERN.html

8. In your folder PdfExample you can see pdf version of Cern wikipedia html website.


Wednesday, 22 July 2015

Rendering Grid, Canvas into image in WPF application

In tutorial regarding populating images from local storage in wpf application we displayed images in grid. In this tutorial I want to demonstrate how to easily convert part of grid, canvas to bitmap and save it as jpeg image.

1. Modify XAML code from the previous tutorial. It should look like that.
 <Grid x:Name="MainFrame" ShowGridLines="True">
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition />
            <RowDefinition />
            <RowDefinition Height="40"/>
        </Grid.RowDefinitions>
      
        <Grid x:Name="Photo1" Grid.Row="0" Margin="10" Grid.RowSpan="1"/>
        <Grid x:Name="Photo2" Grid.Row="1" Margin="10" Grid.RowSpan="1"/>
        <Grid x:Name="Photo3" Grid.Row="2" Margin="10" Grid.RowSpan="1"/>


          <Grid x:Name="PrintFooter" HorizontalAlignment="Right" Height="75" VerticalAlignment="Bottom" Width="100" Grid.Row="3">
            <Button Content="Print"  VerticalAlignment="Bottom" Margin="10" Width="75" Click="Button_Click_1" />
        </Grid>
       
    </Grid>

2. Write a method for Button_Click_1 - you can rename the component and method.


private void Button_Click_1(object sender, RoutedEventArgs e)
        {

// Hide print footer

            PrintFooter.Visibility = Visibility.Hidden;
            MemoryStream memstream = GenerateImage(MainFrame, (int)MainFrame.ActualWidth, (int)MainFrame.ActualHeight);


            // save Image

            using (FileStream fstream = File.OpenWrite(System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyPictures), string.Format("RemotePhoto\\{0}.{1}", Guid.NewGuid(), ImageFormat.Jpeg))))
            {
                memstream.WriteTo(fstream);
                fstream.Flush();
                fstream.Close();
            }
// Show print footer

            PrintFooter.Visibility = Visibility.Visible;
        }

public MemoryStream GenerateImage(Visual visual, int width, int height)
        {
            BitmapEncoder encoder = new JpegBitmapEncoder();
           
            if (encoder == null) return null;

            RenderTargetBitmap rtb = this.RenderVisualToBitmap(visual, width, height);
            MemoryStream file = new MemoryStream();
            encoder.Frames.Add(BitmapFrame.Create(rtb));
            encoder.Save(file);

            return file;
        }

public RenderTargetBitmap RenderVisualToBitmap(Visual visual, int width, int height)
        {
            RenderTargetBitmap rtb = new RenderTargetBitmap
                (width, height, 96, 96, PixelFormats.Default);
            rtb.Render(visual);
           
            BitmapSource bsource = rtb;
            
            return rtb;
        }



GenerateImage method will accept Visual component which in our case is grid. Using RenderVisualToBitmap method we are going to create RenderTargetBitmap object from Visual component.

New image should appear in your pictures under RemotePhoto folder, you can of course change the location as next print you make will include the image from the results which might look odd.






Thursday, 16 July 2015

Realtime Material Previewer - Unity 3d - Available Now For FREE



Sample materials used from http://u3d.as/gq7
Get single game materials - http://www.gamesmaterials.com
Get Free Material Previewer for Unity 5 - http://u3d.as/hZh

Free tool to allow user to preview materials in realtime in Unity 3d game engine.

Just drag and drop created materials into script and they will automatically appear in the preview dropdown list.

This tool allows you to change light intensity, day & night transition speed, normal, occlusion, specularity and height volume.

You can tweak X & Y tiling as well.






Wednesday, 15 July 2015

Populating images from local storage into WPF application

1. Create new WPF Application.
2. In your main window xaml add 3 grids, your code should looks like this:

<Grid x:Name="MainFrame" ShowGridLines="True">
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition />
            <RowDefinition />
        </Grid.RowDefinitions>
      
        <Grid x:Name="Photo1" Grid.Row="0" Margin="10" Grid.RowSpan="1"/>
        <Grid x:Name="Photo2" Grid.Row="1" Margin="10" Grid.RowSpan="1"/>
        <Grid x:Name="Photo3" Grid.Row="2" Margin="10" Grid.RowSpan="1"/>
</Grid>

3. Open code behind the file and create new function:

private void PutImagesIntoFrame()
        {
            // Get last 3 images saved

            string path = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyPictures), "RemotePhoto");

            var directory = new DirectoryInfo(path);

            int numberOfImages = 3;

            List<fileinfo> images = directory.GetFiles("*.jpg").OrderByDescending(m => m.LastWriteTime).Take(numberOfImages).ToList();

            List<imagebrush> imageBrushes = new List<imagebrush>();

            if (images.Count == numberOfImages)
            {
                foreach (FileInfo item in images)
                {
                    ImageBrush imageBrush = new ImageBrush();
                    Image image = new Image();
                    image.Source = new BitmapImage(
                      new Uri(item.FullName));

                    imageBrushes.Add(imageBrush);
                    imageBrush.ImageSource = image.Source;

                }
            }

            // Add image brushes to individual grids

            Photo1.Background = imageBrushes[0];
            Photo2.Background = imageBrushes[1];
            Photo3.Background = imageBrushes[2];

        }
4. Add some pictures to My Pictures folder inside RemotePhoto Folder.
5. Your application should looks like this.





Thursday, 28 May 2015

Scary, Creepy, Mystery FX Sounds For Horror, Thriller, Mystery etc. Games & Movies - Available on Unity 3d store

Created horror, scary game/movie and looking for some creepy fx sounds or seamless ambient royalty free tracks?
This package contains 20 seamless ambient scary tracks and 58 FX sounds that will add some scariness to your project.

Available on Unity 3d store : Scary, Creepy FX Sounds for the price of coffee!






Scary FX and Ambient sounds


Saturday, 9 May 2015

Multi texture pack optimized for Game Engines. Available now on Unity 3d store.

Available now on Unity 3d store : Multi Texture Pack

Launched website http://www.gamesmaterials.com - single materials can be aquired (some free and premium content)

Finishing work on multi texture package for Unity 3d asset store and Unreal market place.
Each material consist of 4 textures (diffuse, normal, height and ambient occlusion). 
Textures that are tillable are perfectly seamless. 
First launch will consist of 60 materials - 240 textures! 
Future update is already planned. 

Actual screenshot from planes in Unity Engine 5 with default light settings.

Categories:
Enironment -> Trees, Grass Frozen, Sand
Floor ->Asphalt, Carpet, Concrete, Gravel & Rock, Medieval, Metal, Stone, Wood
Glass
Leather
Fabric
Roof
Walls -> Bones, Brick, Concrete, Rock, Temples
Misc - Containers

New material added available at : http://gamesmaterials.com/en/gravel-rock-cobble-material




























Tuesday, 31 March 2015

SCi Fi Kit - Unity3d and UDK

Started working on Sci Fi Kit. Package will include sci fi levels, objects such as crates, barrels, pipes etc, preety much everything you would expect to find in Sci Fi game. High influence from Deus Ex, Dead Space. I will also include sci fi sounds(ambient & fx). I will target Unity 5 users and UE4 so I can use full power of new features in both game engines.


I will keep posting and adding more images from work.
Si
Sci Fi Crate 1 - Simple crate with no extra features. 168 tris.



Sci Fi Crate 2 - Found concept here : concept
Simple low poly model with 1200 tris, Baked normal from high poly and added few details to normal map. Wanted to keep it simple, however I will add more details(only to normal map) and few extra stripes of paint, possibly on the edges. Exported model to Unity 3d and looks almost the same as on the picture below.