Closed kubo-von closed 4 years ago
Hmm interesting I'll take a look, should be an easy fix thanks for the test data.
A brief look into the data:
Fixed here: https://github.com/boberfly/GafferCycles/commit/513d86ab6f8341f7f7a4f83f0a2979d6411ec89a
The alembic cache I think just has to have the right interpretations on the primvars, I can see the Gaffer SceneReader is having problems in the terminal:
WARNING : FromAlembicGeomBaseConverter::convertArbGeomParam : Param "testColor" has unsupported array extent
Interesting!
When I promote the variables from point to vertex in Houdini before export, testFloat in alembic works well. USD exporter must be doing that under the hood.
testColor still giving the same error though
Is the USD testColor working? It seemed to work on my end here. If you mean Alembic then that bug might need to go to Cortex/Gaffer directly.
testFloat on alembic is working, If I use ResamplePrimitiveVariables like you suggested or re-export the abc from Houdini with it being vertex attribute, not point. I will report this on gaffer-dev.
testColor is not working, even on USD I think for that I'd need to have the 513d86a fix you did? I'm on latest release version of gafferCycles. Should really find the time to learn how to compile it!
Oh right my bad I thought you were building yourself because you were saying the hair doesn't crash now. All good I'll be making a new build soon, no ETA but probably this week or weekend, I'd like to fix more of those bugs first.
Confirming this is fixed in 0.16.0 release :)
hmm, tried rendering the usd kitchen set which has a constant color 'displayColor' in its primvars. was not able to get it to get picked up by my principled shader. my shell is full with warnings like these, though - so maybe that is related? btw, this is using the windows build
IECoreCyles::AttributeAlgo::convertPrimitiveVariableWARNING : : Variable "st" has unsupported type "V2fVectorData" (expected V3fVectorData).WARNING Variable "st" has unsupported type "V2fVectorData" (expected V3fVectorData). Variable "st" has unsupported type "V2fVectorData" (expected V3fVectorData). Variable "gprimID" has unsupported type "IntData" (expected V3fVectorData). WARNING : : : IECoreCyles::AttributeAlgo::convertPrimitiveVariableVariable "st" has unsupported type "V2fVectorData" (expected V3fVectorData). : Variable "st" has unsupported type "V2fVectorData" (expected V3fVectorData). Variable "displayColor" has unsupported type "Color3fVectorData" (expected V3fVectorData).
Hey @carstenkolve
I'll take a look at the kitchen sink asset next and stress test it a bit. I think for st the primvar needs the GeometricData to be tagged as UV by Gaffer perhaps, maybe @dboogert might know more on why the USD importer isn't doing that, but perhaps I can ignore needing that set and give it to Cycles as a vec2. The other ones might just be me being lazy and only implementing vec3 & float so far outside of the usual primvars, which I'll fix.
For constant values like color without breaking instancing I am mapping to "Cs" as Cycles only has a handful of constant values available, I wrote the ones here in the second post: https://github.com/boberfly/GafferCycles/issues/6 something to document later though...
Not sure I quite understand the second part of your post? Are you saying it is not possible to drive a shader color using an arbitrary constant color primvar? I tried using OSL InColor (also switched the shading system to OSL prior) but sadly that seems to results in hangs.
Hey @carstenkolve
There's a colour option on the CyclesAttributes node which should have that value available through the object_info node. It's just setting the "Cs" attribute under the hood and should pick up in Cycles, so with the instancer node that could be picked up from a point cloud as well. Cycles only has a few per-object constant values that it supports, so the OSL InColor would only work for primvars currently.
These are the attributes which can be per-instance right now from a points primitive + instancer and are available from either object_info or particle_info nodes: "index" or Gaffer's "instanceIndex" "age" "lifetime" "location" or Gaffer's "P" "rotation" or Gaffer's "orientation" "size" or Gaffer's "width"
Some fixes coming in: https://github.com/boberfly/GafferCycles/commit/18d2b1e79eca024dd1d5fbb717505a0a9d95835d
Although I think this is running into a bug in Cycles, seems like constant values don't work but if I re-sample them to per-vertex they are working.
And fix for the Cycles-side, hopefully it gets accepted without issue: https://developer.blender.org/D6794
Hey @carstenkolve
This build should have all of those fixes as well as a silly bugfix with OSL parameters which should make it not crash now: https://github.com/boberfly/GafferCycles/releases/tag/0.17.0
Cheers
I found some more issues with new models and revamped my changes in 0.21.0, I was able to make a Pref/Prest and make it an AOV for example by plugging a cclAttribute node. It is known that OSL mode isn't picking up in AOV value/color but plugging it into emission it is working.
Hi @boberfly ! I wanted to try how primvars on geometry work with cycles. On geometry from USD float works well, but color/vector does not read and is throwing this error:
WARNING : IECoreCyles::AttributeAlgo::convertPrimitiveVariable : Variable "testColor" has unsupported type "V3fVectorData" (expected FloatVectorData).
On alembic the float is messed up and color still doesn't work.Test scene is here: https://drive.google.com/drive/folders/1cnpG_NiP3PGFm5Leu1qqYW1Cw9PsSmF7?usp=sharing Hope that helps!