Comments (21)
TeapotsExample.as uses a special shader (NormalsShader). This very shader does not handle lighting. It was made for a simple purpose: have a cool rendering with the TeapotsExample and CubesExample demos.
Thus, it is perfectly normal that the rendering is not affected by the "lightEnabled" property: the shader does not provide lighting. And whether you run it on iPhone 4 or on PC won't make a difference.
If you want to have simple directional lighting, use the BasicShader as we do in the DirectionalLightExample.
If you want complex lighting, use the minko-lighting extension and have a look at the lighting examples.
from minko.
hello @promethe42
it is the TerrainExample.as
it is not work on ios when i open the lightenable.
but it is work on pc .
from minko.
oh sorry it is not light issue. it is the issue Embed image.
from minko.
We need a more detailed bug report, code to reproduce the issue and some screen captures if possible.
from minko.
it is not a bug.
it is a issue of package ipa of my self.
but if i open the light the demo run at 30fps.
i close the light it is run at 60fps.
20000 face in ip4.
from minko.
The TerrainShader uses a very simple directional lighting shader combined with texture splatting.
If enabling the light cuts down the framerate, it means the device is having a hard time handling the few extra pixel shader operations. It seams unlikely since directional lighting is less than 10 instructions...
What device are you using?
from minko.
i use the iphone4.
code like this
_terrain = new Mesh(
terrainGeometry,
{
diffuseColor : 0xffffff,
lightEnabled : true
}
);
from minko.
the full code
https://gist.github.com/3009829
https://gist.github.com/2976629
from minko.
do you have the same results when you add a DirectionalLight using minko-lighting?
from minko.
i am studying the minko . i have not used the minko-lighting.
from minko.
I find it rather surprising that the directional lighting might cause such a big performance difference.
Here is the assembly code compiled at runtime with lighting on:
aerys.minko.example.core.terrain::TerrainShader - vertex shader m44 vt0.xyzw, va0.xyzw, vc0.xyzw m44 vt0.xyzw, vt0.xyzw, vc4.xyzw mov op.xyzw, vt0.xyzw mov vt0.x, vc8.xxxx mov vt0.y, va0.zzzz mov v0.xyzw, vt0.xyyy mov vt0.w, vc8.yyyy m33 vt0.xyz, va1.xyzw, vc0.xyzw mov vt0.xyz, vt0.xyzz mov v1.xyzw, vt0.xyzw - fragment shader tex ft0.xyzw, v0.xyyy, fs0 nrm ft1.xyz, v1.xyzw dp3 ft1.x, ft1.xyzz, fc1.xyzz neg ft1.x, ft1.xxxx sat ft1.x, ft1.xxxx mul ft1.x, ft1.xxxx, fc0.wwww mul ft1.xyz, ft1.xxxx, fc2.xyzz add ft1.xyz, fc0.xyzz, ft1.xyzz mul ft1.xyz, ft0.xyzz, ft1.xyzz mov ft1.w, ft0.wwww mov oc.xyzw, ft1.xyzw
Here is the same code with lighting off:
aerys.minko.example.core.terrain::TerrainShader - vertex shader m44 vt0.xyzw, va0.xyzw, vc0.xyzw m44 vt0.xyzw, vt0.xyzw, vc4.xyzw mov op.xyzw, vt0.xyzw mov vt0.x, vc8.xxxx mov vt0.y, va0.zzzz mov v0.xyzw, vt0.xyyy - fragment shader tex ft0.xyzw, v0.xyyy, fs0 mov oc.xyzw, ft0.xyzw
As you can see it's just 9 instructions more when the lighting is on.
Is it an iPhone 4 or an iPhone4S?
from minko.
aerys.minko.render.effect.basic::BasicShader
- vertex shader
m44 vt0.xyzw, va0.xyzw, vc0.xyzw
m44 vt0.xyzw, vt0.xyzw, vc4.xyzw
mov op.xyzw, vt0.xyzw
m33 vt0.xyz, va1.xyzw, vc0.xyzw
mov v0.xyzw, vt0.xyzz - fragment shader
mov ft0.w, fc0.wwww
nrm ft0.xyz, v0.xyzz
dp3 ft0.x, ft0.xyzz, fc2.xyzz
neg ft0.x, ft0.xxxx
sat ft0.x, ft0.xxxx
mul ft0.x, ft0.xxxx, fc1.wwww
mul ft0.xyz, ft0.xxxx, fc3.xyzz
add ft0.xyz, fc1.xyzz, ft0.xyzz
mul ft0.xyz, fc0.xyzz, ft0.xyzz
mov oc.xyzw, ft0.xyzw
aerys.minko.render.effect.basic::BasicShader
- vertex shader
m44 vt0.xyzw, va0.xyzw, vc0.xyzw
m44 vt0.xyzw, vt0.xyzw, vc4.xyzw
mov op.xyzw, vt0.xyzw - fragment shader
mov oc.xyzw, fc0.xyzw
from minko.
not 4s just iphone4
from minko.
aerys.minko.render.effect.basic::BasicShader
- vertex shader
m44 vt0.xyzw, va0.xyzw, vc0.xyzw
m44 vt0.xyzw, vt0.xyzw, vc4.xyzw
mov op.xyzw, vt0.xyzw
m33 vt0.xyz, va1.xyzw, vc0.xyzw
mov v0.xyzw, vt0.xyzz
- fragment shader
mov ft0.w, fc0.wwww
nrm ft0.xyz, v0.xyzz
dp3 ft0.x, ft0.xyzz, fc2.xyzz
neg ft0.x, ft0.xxxx
sat ft0.x, ft0.xxxx
mul ft0.x, ft0.xxxx, fc1.wwww
mul ft0.xyz, ft0.xxxx, fc3.xyzz
add ft0.xyz, fc1.xyzz, ft0.xyzz
mul ft0.xyz, fc0.xyzz, ft0.xyzz
mov oc.xyzw, ft0.xyzw
aerys.minko.render.effect.basic::BasicShader
- vertex shader
m44 vt0.xyzw, va0.xyzw, vc0.xyzw
m44 vt0.xyzw, vt0.xyzw, vc4.xyzw
mov op.xyzw, vt0.xyzw fragment shader
mov oc.xyzw, fc0.xyzw
from minko.
Hmmm iPhone4 is a lot less powerful than the 4s if I remember correctly.
Getting half the framerate because of 10 pixel shader instructions is still weird...
But what's the point with quoting the assembly code? :)
from minko.
need a fastShader. like BasicShader.but just interpose color.
from minko.
Can you please try using the BasicShader instead of the TerrainShader and see if the lighting on/off still affects the framerate?
from minko.
yes i always used the basicshader.
it is just 30 fps.
and the assembly code of basicshader
the light enable
aerys.minko.render.effect.basic::BasicShader
•vertex shader m44 vt0.xyzw, va0.xyzw, vc0.xyzw m44 vt0.xyzw, vt0.xyzw, vc4.xyzw mov op.xyzw, vt0.xyzw m33 vt0.xyz, va1.xyzw, vc0.xyzw mov v0.xyzw, vt0.xyzz
•fragment shader mov ft0.w, fc0.wwww nrm ft0.xyz, v0.xyzz dp3 ft0.x, ft0.xyzz, fc2.xyzz neg ft0.x, ft0.xxxx sat ft0.x, ft0.xxxx mul ft0.x, ft0.xxxx, fc1.wwww mul ft0.xyz, ft0.xxxx, fc3.xyzz add ft0.xyz, fc1.xyzz, ft0.xyzz mul ft0.xyz, fc0.xyzz, ft0.xyzz mov oc.xyzw, ft0.xyzw
close the light
aerys.minko.render.effect.basic::BasicShader
•vertex shader m44 vt0.xyzw, va0.xyzw, vc0.xyzw m44 vt0.xyzw, vt0.xyzw, vc4.xyzw mov op.xyzw, vt0.xyzw
•fragment shader mov oc.xyzw, fc0.xyzw
from minko.
You should use "pre" tags to embed the code. I can't read the ASM code if it's inlide like this :)
Still... no explanation for this performance issue.
Can you test on a 4s ?
from minko.
test :)
aerys.minko.render.effect.basic::BasicShader - vertex shader m44 vt0.xyzw, va0.xyzw, vc0.xyzw m44 vt0.xyzw, vt0.xyzw, vc4.xyzw mov op.xyzw, vt0.xyzw m33 vt0.xyz, va1.xyzw, vc0.xyzw mov v0.xyzw, vt0.xyzz - fragment shader mov ft0.w, fc0.wwww nrm ft0.xyz, v0.xyzz dp3 ft0.x, ft0.xyzz, fc2.xyzz neg ft0.x, ft0.xxxx sat ft0.x, ft0.xxxx mul ft0.x, ft0.xxxx, fc1.wwww mul ft0.xyz, ft0.xxxx, fc3.xyzz add ft0.xyz, fc1.xyzz, ft0.xyzz mul ft0.xyz, fc0.xyzz, ft0.xyzz mov oc.xyzw, ft0.xyzw
from minko.
yh ,i will try the 4s
from minko.
Related Issues (20)
- where is minko shaderlab and shaderStudio HOT 5
- minko compile 1 error generated HOT 3
- Collision detection HOT 5
- when will you provide minko3 flash version? HOT 1
- Vulkan API HOT 1
- README Linux section is confuse HOT 2
- Collada model picking? HOT 11
- Chinese characters cannot display on minko-plugin-html-overlay HOT 3
- Mouse events unusable on MacBook HOT 1
- Integration with UIKit HOT 1
- Invalid NDK Path
- Compile Minko SDK android HOT 4
- CylinderGeometry HOT 1
- Using a webserver in the compiled application for an html overlay
- Has minko been abandaned by original developers? HOT 7
- I want use haxe to reimplement the minko source code. HOT 2
- haxe to reimplement the minko source code. HOT 2
- Android build instructions out of date HOT 1
- Integration into Qt HOT 2
- Any chance of enabling discussions on this repo?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from minko.