基于cocos2d-x 3.x版本修改的Assets Manager,加几行代码就能实现断线续传功能…so easy

 bool AssetsManager::downLoad()
 {
     // Create a file to save package.
     const string outFileName = _storagePath + TEMP_PACKAGE_FILE_NAME;
-    FILE *fp = fopen(outFileName.c_str(), "wb");
+    ssize_t outFileLength = 0;
+    FILE *fp = fopen(outFileName.c_str(), "rb");
+    if(fp)
+    {
+        fseek(fp, 0, SEEK_END);
+        outFileLength = ftell(fp);
+        fclose(fp);
+    }
+    
+    fp = fopen(outFileName.c_str(), "ab");
Read More →

花时间看了下毛发效果,苦于囊中羞涩没能买QuickFurfurFX等插件,最后找到了Fur Shader学习了一下。

furshader1

Read More →

前段时间体验了下Zen Garden之后,觉得两个效果很有意思:漫天飞舞的花瓣和可以点点点的水波,于是准备在Unity里面山寨一下。

先是尝试了用粒子实现下花瓣的效果,结果发现Unity暴露的接口很少,每一帧都GetParticles, SetParticles加上计算有点费;而且不太会使用现有的效果调出飘落的效果。最后实现了手指点上去挤开花瓣的效果后,就无奈放弃了。 ps. 粒子系统里貌似有两套速度,一个是Script里的对应startSpeed,另一个是Velocity over lifetime~感觉很奇怪…

然后试图山寨了下水波的效果,用一个脑洞大开的思路做了下,自我感觉还行_(:з」∠)_

fake water

Read More →

昨儿有人给我发了一个神秘网址,表示希望能获得资源拿去lu

blend4web1

我看了下这个网页,是用blend4web转的,这个可以将blender里的模型很方便的通过WebGL输出到网页上(新技能GET)…所以稍微花了点时间研究了下,如何导出blend4web网页中的模型资源~

Read More →

一般在渲染中,是使用cubemap来预计算环境反射,但是怎么玩好这个东西,我之前并没有考虑太多。最近和桌子讨论了挺多环境贴图的使用方式,在这里记录一下想法(偷懒起见,示意代码都是surface shader)。

Read More →

一下午随手写了一个环境捕捉器,山寨了一下unreal的scene capture cube。结果后来发现unity3d pro自带了一个Camera.RenderToCubemap函数真是哈哈哈哈啊……

更新: unity 5.x 貌似直接提供一个反射捕捉器

Read More →

出于学习的目的(认真脸),想拆解下别人家的作品的包,看下他们的美术资源是怎么布局、整理的,所以花了一晚上尝试了下,并记录如下。

Read More →

** This is depecrated since pomelo is only supporting libpomelo2 with various bindings. I’ve removed the github repo and you may find the archive here(Download).**

Read More →

最近被pomelo的一个bug搞的心力憔悴,之前本地开发和阿里云环境上都是好好的,但是在另一套环境下时不时就挂。为了这个问题加起来折腾了好几天,今天终于算处理掉了(虽然还没从根子上解决)。写篇文章记录一下思路和解决方案。

Read More →

Recently I need compile libcurl for different platforms, since cocos-2dx 3.0 ships with libcurl 7.26.0 and there are several fixes in newer versions according to changelog. There are several blogs describing how to build libcurl with android source, such as porting-of-libcurl-to-android-os-using, How_to_compile_libcurl and Android ndk下编译libcurl. However, they are all out dated, especially android source has changed a lot!

After struggling a whole weekend, I finally compiled libcurl 7.37.0 with android 4.4 source. The steps described in packages/Android/Android.mk skip many details. I’ll explain every steps and hope you can make it. If you use the similar version, you could just copy & paste mine.

Read More →