Based on feedback (thnx phase!) I found a big disadvantage of the 'real'
fresnel formula. It doesnt degrade to 0.0, causing 2-3 times too many
rays being fired compared to the previous one. So; a lot slower.
Now committed is a hybrid which allows (close to) real, and nice artistic
freedom, *and* it really goes to 0.0 and 1.0, assisting nicely in optimal
render times.
A real doc how it works (with pics) will be made before real release.
- Fixed bug in raytrace: the first renderpass didn't use fresnel for mirror.
- Fixed bug in previewrender, now it closer matches how fresnel renders
Also commented out a couple of unused variables that were shouting warnings (and we all love the lack of warning and the couple of extra free bytes) :)
At last irc meeting, eeshlo pointed to an error in the code. It didn't
use the IOR value correctly. This has been solved. So how it works now:
- the IOR button value influences (very subtle) the fresnel effect.
Only for realism diehards.
- the Fresnel value (slider) now denotes the power in the function
rf + (1-rf) * (1-c)^5
where rf= rf = ((ior-1)/(ior+1))^2
and c the dot-product ray/normal.
- so, set the slider at '5' and you have real fresnel. Lower values
for interesting artistic effects.
- put back the forgotten code for gaussian corrected sampling during
antialising render. Normally, each sub-pixel sample in Blender counts
equally, and together make up the pixel color.
With 'Gauss' option set (F10 menu) each sub-pixel sample creates a small
weighted mask with variable size, which (can) affect neighbouring pixels
as well. The result is smoother edges, less sensitive for gamma, and
well suited to reduce motion-aliasing (when things move extreme slow).
This is result of *long* period of research in NeoGeo days, and based on
every scientific sampling/reconstructing theory we could find. Plus a
little bit of our selves. :)
- I should write once how blender constructs Jitter tables for sub-sampling.
this is a very nice method, and superior to normal block filter or random
jittering... time!
Main target was to make the inner rendering loop using no globals anymore.
This is essential for proper usage while raytracing, it caused a lot of
hacks in the raycode as well, which even didn't work correctly for all
situations (textures especially).
Done this by creating a new local struct RenderInput, which replaces usage
of the global struct Render R. The latter now only is used to denote
image size, viewmatrix, and the like.
Making the inner render loops using no globals caused 1000s of vars to
be changed... but the result definitely is much nicer code, which enables
making 'real' shaders in a next stage.
It also enabled me to remove the hacks from ray.c
Then i went to the task of removing redundant code. Especially the calculus
of texture coords took place (identical) in three locations.
Most obvious is the change in the unified render part, which is much less
code now; it uses the same rendering routines as normal render now.
(Note; not for halos yet!)
I also removed 6 files called 'shadowbuffer' something. This was experimen-
tal stuff from NaN days. And again saved a lot of double used code.
Finally I went over the blenkernel and blender/src calls to render stuff.
Here the same local data is used now, resulting in less dependency.
I also moved render-texture to the render module, this was still in Kernel.
(new file: texture.c)
So! After this commit I will check on the autofiles, to try to fix that.
MSVC people have to do it themselves.
This commit will need quite some testing help, but I'm around!
Goofster: The difference between you and Ton reporting the problem was
that he actually took the time to analyze the warning and pin down the
problem, while your "hahaha, your code has a warning!" didn't really
help me a lot in the first place.
- added 'Mapping to" channel "RayMirror", to control mirror with texture
- fixed bug in using mirror-rgb as texture channel... this is cumbersome
because it is abused by Envmap in a not nice way. Fixing the abuse will
cause compatibility errors, which can be fixed when we up release # to
2.32.
- added "Translucency", which is nothing else than allowing another
shading pass for the backside of a face (with normal inverted). This
is interesting for all kinds of situations where you want light from
behind to 'shine through'. Also works to reduce dark areas in
unlighted parts of rendering transparent faces. Light from behind on
transparent red window should make it glowing some, right?!
- added texture channel for this as well
- Reorganized Material Panels to reveil some consistancy where buttons
can be found. Not perfect yet, but at least all options for Shaders and
options for Mirror & Transparency now are together.
This gives some space in Shader Panel for nice expansion.
- implemented tracing of transparency for shadows. This is a material
option, in the new RayTrace panel.
it only traces color and alpha, not shading. So the results of some
transparant colored unlit faces can look odd. I will look onto that.
- changed fresnel formula (got hint from eeshlo!). this simplifies the UI,
now only one button needed. The fresnel value "should" be identical as
the refraction index, but that is booooring! So i added a special fresnel
refraction slider for both mirroring and transparency. By setting all 3
sliders equal, you get 'realism'.
- fresnel for transparancy works for Ztra rendering too. Same for transpa-
rent shadow. But then you need to set 'ray' on in F10 menu.
- uploaded new monkey_glass blend in download.blender.org/demo/test/
Next stage: killing the globals from render, and implement "translucency"
which is effectively allowing faces being lit from behind, as paper or
cloth.
I thought this was a nice addition, so I'm commiting it.
To Ton for easier changelog creation: When constraining to an axis, numerical input is limited (and will switch automaticly) to that axis.
Original e-mail
-------------------------------
I was playing with the axis constraints for grab and scale transforms
and I thought that the behavior was slightly illogical. Without axis
constraints, I think everything is great, but once a constraint is used
some irregularities show up. (Note, this is not a bug, it's more of a
possible improvement)
When you enter grab or scale mode, then constrain the transformation to
a
particular axis, then enter numeric entry mode by hitting a number or
'n', there is no reason for you to try and edit the numeric value of a
non-constrained axis which is the current behavior.
E.g. You grab an object and want to move it along the z-axis, so you
enter grab mode and either hit 'z' or the middle mouse button and you
move the mouse to get an idea of how it looks. You decide that you
want to use a value of +4.2 with numeric entry; now you have to enter
the following sequence: 'g', 'z', 'move mouse', 'tab', 'tab', '4.2',
'enter'. However, you're already constrained to the z-axis, so you
should not have to enter 'tab', 'tab'.
The included patch changes the behavior of grab and scale transforms so
that if you are constrained to an axis, and enter numeric entry mode
via
'n' or by hitting a number, you will immediately begin editing the
appropriate axis, and will not have to hit 'tab'.
This may not seem like a big improvement (because it's not), but I feel
that it improves the workflow of a commonly used task slightly and does
not negatively impact any other aspects of the program.
I welcome feedback on this idea.
--
- Nathanael Law <njlaw@xyrodian.com>
Changelog:
- enable refraction with button "Ray Transp" in Material buttons.
- set "Angular Index" value for amount of refraction.
- use the "Alpha" value to define transparency.
- remember to set a higher "Depth" too... glass can bounce quite some
more than expected.
- for correct refraction, 3D models MUST have normals pointing in the
right direction (consistently pointing outside).
- refraction 'sees' the thickness of glass based on what you model. So
make for realistic glass both sides of a surface.
- I needed to do some rewriting for correct mirroring/refraction,
especially to prevent specularity being blended away.
Solved this with localizing shading results in the rendercore.c.
Now specularity correctly is added, and reduces the 'mirror' value.
- Localizing more parts of the render code is being planned. The old
render heavily relies on struct Render and struct Osa to store globals.
For scanline render no problem, but recursive raytracing dislikes that.
- done test with gamma-corrected summation of colors during tracing, is
commented out still. But this will give more balanced reflections. Now
dark reflections that are reflected in a bright surface seem incorrect.
- Introduced 'Fresnel' effect for Mirror and Transparency. This
influences the amount of mirror/transparency based at viewing angle.
Next to a new Fresnel slider, also a 'falloff' button has been added to
define the way it spreads.
- Fresnel also works for Ztransp rendering
- created new Panel for Raytrace options
I have to evaluate still where it all should be logically located.
- material preview shows fake reflection and fake refraction as well.
I took a look at how other BPY_* functions were working in blenkernel/
and got to bad level calls (ah, so this is what that is for...).
As a test, I added BPY_clear_script to the "stubs", argh. If this works,
I'm curious: are these bad level calls needed only by some targets (irix)
because of peculiarities in compiler linkage?
Thanks again, Chris, if this doesn't work, I'll move or copy the function to
script.c, probably, also adding Python.h to it.
This commit moves the 2 undefined references to BPY_interface.c and
changes things a little, hopefully fixing the problem. I had to add a new dir,
source/blender/include/ to auto*'s Makefile.am in source/blender/python/.
Thanks Chris for the report, and Jiri, for adding a missing declaration.
when an object has an Ipo, the timing for each duplicated Object is
corrected for the lifetime of particle. Looks great!
Remark: this won't work for object location (is at particle) or for
particle type 'Vect' which gives a rotation already. But now you can
scale an object small, and let it grow over time.
The interesting part:
Bevelling functions for meshes.
Accessible through the Wkey menu.
You then have to enter the recursivity level (Warning, don't use 3 on a big mesh) and interactivly set the bevel width by moving the mouse. It draws the new faces in yellow. Ctrl constraint to 0.1 multiples, Shift switches to low gear, Space to type a value directly.
Support for selective bevelling isn't really working yet, so be sure to select all the vertices beforehand.
The less interesting part:
Code done by intrr (logical stuff, how the algorithm works) and me (math stuff and the interactive bevel width code).
The splitting and bevelling algorithm is not yet fully optimized, and the face shrinking math still doesn't like too big bevel width values. So this will have to be cleaned too.
Selective bevel is on the list next.
If you have any questions about how the code works, send the questions regarding the logic of the method to intrr and math questions to me.
This is very much testing code (or should I say teasing code), so please don't flood me with bug reports. (This excludes OFFICIAL Blender developpers who were there at the meeting and pretty much know what the limitations of the code is and what it should do.)
- add a new space: Space Script
- add a new dna struct: Script
- add these two properly everywhere they are meant to
It's not a tiny commit, but most of it is ground work for what is still to be done.
Right now the benefits should be: freeing the Text Editor to be used in a window even while a script w/ gui in "on" and letting more than one currently running script w/ gui be accessible from each window
Some files are added, so some build systems (not autotools) will need updates
(bzero seems to be old, not supported anymore, also not for windows)
- think I fixed the error compiling in Irix, for a correct cast now
(added parentheses around the subject for cast)
- changed call to ray_mirror, now included in the shading loop, just
before the addition happens for specular. That way specular is added
over mirroring. This changes the appearance quite some!
by Ztonzy. Error happened when:
- ray intersects in first node of traversal
- next ray should intersect in same first node as well
- no other nodes were accessed inbetween
It's a bit hard to explain! But the reason is in the optimize code
in top of ocread() function, where binary XOR magic speeds up. Here
some static variables needed a reset.
This is a revision of the old NeoGeo raytracer, dusted off, improved quite
a lot, and nicely integrated in the rest of rendering pipeline.
Enable it with F10-"Ray", and set either a 'ray-shadow' lamp or give the
Material a "RayMirror" value.
It has been added for 2 reasons:
- get feedback on validity... I need artists to play around with it if it's
actually useful. It still *is* raytracing, meaning complex scenes will
easily become slow.
- for educational purposes. All raytracing happens in ray.c, which can be
quite easily adjusted for other effects.
When too many disasters pop up with this, I'll make it a compile #ifdef.
But so far, it seems to do a decent job.
Demo files: http://www.blender.org/docs/ray_test.tgz
An article (tech) about how it works, and about the new octree invention
will be posted soon. :)
Note: it doesn't work with unified render yet.