[Bf-cycles] Cycles Shader::has_surface , has_surface_emission, has_surface_transparent flags

Mohamed Sakr 3dsakr at gmail.com
Fri Apr 1 12:13:43 CEST 2016


Hi Thomas,

I searched the code already before asking here..
what I follow is the Blender exporter "all files under Blender\ like
camera, shader, mesh, object, ..."
I also searched the whole code for instances of these flags, only appeared
in a few places.

for example, these flags are automatically set inside tag_update()
has_surface = has_surface || output->input("Surface")->link;
has_volume = has_volume || output->input("Volume")->link;
has_displacement = has_displacement || output->input("Displacement")->link;

while all other flags are untouched "and that's why I'm asking as I see
them useless, not set, not complete??"
bool has_surface_emission;
bool has_surface_transparent;
bool has_surface_bssrdf;
bool has_bssrdf_bump;
bool has_surface_spatial_varying;
bool has_volume_spatial_varying;
bool has_object_dependency;
bool has_integrator_dependency;

they are not set in the blender exporter, not set anywhere else "just used
inside if statements, without setting?"

cheers,
Mohamed Sakr

On Fri, Apr 1, 2016 at 12:26 AM, Thomas Dinges <blender at dingto.org> wrote:

> Hi,
> these flags all tell Cycles which kind of shaders are used (Do we have a
> Surface (or only volume), Emission or a Transparent BSDF)?
>
> They are set and checked for in various places in render/ e.g. shader.cpp,
> light.cpp ...
>
> Again, please just search the code yourself. You should really be able to
> search a codebase for a variable. That is not magic.
>
> Thomas
>
>
> Am 01.04.2016 um 00:17 schrieb Mohamed Sakr:
>
> Hi Thomas,
>
> great!, but what I meant is:
> where do you set them? I checked the blender exporter and didn't see any
> flag set.
> are they set automatically? or they need a manual checks.
>
> cheers,
> Mohamed Sakr
>
> On Thu, Mar 31, 2016 at 8:10 PM, Thomas Dinges <blender at dingto.org> wrote:
>
>> Hi Mohamed,
>>
>> grep is a Linux terminal command, that can be used to search files, in
>> this case for a variable.
>> Alternatively you can use an IDE or another tool of your choice.
>>
>> The flags are used in various places inside the kernel, to determine if
>> we need certain things.
>>
>> Hope that helps.
>>
>> Best regards,
>> Thomas
>>
>> Am 31.03.2016 um 18:36 schrieb Mohamed Sakr:
>> > Hi Sergey,
>> >
>> > after testing, I see colors are matching in the 2 branches, sorry this
>> > was my fault.
>> > but the unsolved question: do these flags do anything? I see they are
>> > not touched anywhere.
>> >
>> > cheers,
>> > Mohamed Sakr
>> >
>> > On 3/31/16, Mohamed Sakr < <3dsakr at gmail.com>3dsakr at gmail.com> wrote:
>> >> Hi Sergey,
>> >>
>> >> my branch is similar to yours, just some different stuff in the
>> >> standalone part "exporter"
>> >> I didn't understand what is grep?
>> >>
>> >> cheers,
>> >> Mohamed Sakr
>> >>
>> >> On 3/31/16, Sergey Sharybin < <sergey.vfx at gmail.com>
>> sergey.vfx at gmail.com> wrote:
>> >>> Hi,
>> >>>
>> >>> I can't tell you what could be wrong in your branch because it's
>> nowhere
>> >>> published and i can't give cleaner answer where the variables are used
>> >>> than
>> >>> grep will do it:
>> >>>
>> >>> grep -wR "has_surface" .
>> >>> grep -wR "has_surface_emission" .
>> >>>
>> >>> and so on.
>> >>>
>> >>>
>> >>> On Thu, Mar 31, 2016 at 5:26 PM, Mohamed Sakr <3dsakr at gmail.com>
>> wrote:
>> >>>
>> >>>> Hi,
>> >>>>
>> >>>> I wonder where are these flags used? Shader::has_surface,
>> >>>> has_surface_emission, ...etc..
>> >>>> the reason to ask:
>> >>>> I checked my branch against Blender, the scene is pretty simple.
>> >>>> 2 cubes which got only emission to surface, first cube is (255 50 0),
>> >>>> second is (153 255 0)
>> >>>>
>> >>>> inside Blender results appear correctly "same chosen color"
>> >>>> inside my branch results appear wrong "for example with increased
>> >>>> emission strength, values go toward 255 255 0 .."
>> >>>>
>> >>>> any idea if these flags are responsible for this? or anything else
>> >>>> that is missing in my Shader?
>> >>>> I debugged input values and they are correct.
>> >>>>
>> >>>> cheers,
>> >>>> Mohamed Sakr
>> >>>> _______________________________________________
>> >>>> Bf-cycles mailing list
>> >>>> Bf-cycles at blender.org
>> >>>> https://lists.blender.org/mailman/listinfo/bf-cycles
>> >>>>
>> >>>
>> >>>
>> >>> --
>> >>> With best regards, Sergey Sharybin
>> >>>
>> > _______________________________________________
>> > Bf-cycles mailing list
>> > Bf-cycles at blender.org
>> > https://lists.blender.org/mailman/listinfo/bf-cycles
>>
>> _______________________________________________
>> Bf-cycles mailing list
>> Bf-cycles at blender.org
>> https://lists.blender.org/mailman/listinfo/bf-cycles
>>
>
>
>
> _______________________________________________
> Bf-cycles mailing listBf-cycles at blender.orghttps://lists.blender.org/mailman/listinfo/bf-cycles
>
>
>
> _______________________________________________
> Bf-cycles mailing list
> Bf-cycles at blender.org
> https://lists.blender.org/mailman/listinfo/bf-cycles
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.blender.org/pipermail/bf-cycles/attachments/20160401/c79d6a33/attachment.htm 


More information about the Bf-cycles mailing list