Thanks for the answer, I’m still trying to convert your sample code to something usable in my Character class. This is what I have so far :
void AExedreCharacter::ComputeLightWeight()
{
if(MeshBody != NULL)
{
float OutIncidentRadiance = 0.0;
class ULevel* Level = MeshBody->GetComponentLevel();
FSHVectorRGB2 AccumulatedIncidentRadiance;
float AccumulatedWeight = 0;
class FPrecomputedLightVolume* RadianceVolume = Level->PrecomputedLightVolume;
RadianceVolume->InterpolateIncidentRadiance(
GetActorLocation(),
AccumulatedWeight,
AccumulatedIncidentRadiance);
if (AccumulatedWeight > 0)
{
OutIncidentRadiance = AccumulatedIncidentRadiance / AccumulatedWeight;
}
else
{
OutIncidentRadiance = AccumulatedIncidentRadiance;
}
//log writing
elog(OutIncidentRadiance);
}
}
Unfortunately I don’t pass the compilation. FPrecomputedLightVolume give me an error, the call to InterpolateIncidentRadiance() should be correct, but the compile is complaining. I don’t see why because this is what I have in PrecomputedLightVolume.h :
/** Interpolates incident radiance to Position. */
ENGINE_API void InterpolateIncidentRadiance(
const FVector& Position,
float& AccumulatedWeight,
FSHVectorRGB2& AccumulatedIncidentRadiance) const;
/** Interpolates incident radiance to Position. */
ENGINE_API void InterpolateIncidentRadiance(
const FBoxCenterAndExtent& BoundingBox,
const FIntVector& QueryCellDimensions,
const FIntVector& DestCellDimensions,
const FIntVector& DestCellPosition,
TArray& AccumulatedWeights,
TArray& AccumulatedIncidentRadiance) const;
Also, the FSHVectorRGB2 / float is also refused by the compiler. Since this struct (I believe) is not explained anywhere, I have no idea how to access its members.
The compiler log :
D:\Dropbox\Software\notepad\bin>echo OFF
"Building Rocket (Exedre), please wait..."
Parsing headers for Exedre
Code generation finished for Exedre and took 1,969
Module.Exedre.cpp
C:\Rocket\Projects\Exedre\Source\Exedre\Private\ExedreCharacter.cpp(464) : error
C2027: use of undefined type 'FPrecomputedLightVolume'
c:\rocket\engine\intermediate\builddata\include\engine\../../../../Sourc
e/Runtime/Engine/Classes/Engine/Level.h(346) : see declaration of 'FPrecomputedL
ightVolume'
C:\Rocket\Projects\Exedre\Source\Exedre\Private\ExedreCharacter.cpp(464) : error
C2227: left of '->InterpolateIncidentRadiance' must point to class/struct/union
/generic type
C:\Rocket\Projects\Exedre\Source\Exedre\Private\ExedreCharacter.cpp(472) : error
C2440: '=' : cannot convert from 'TSHVectorRGB' to 'float'
with
[
MaxSHOrder=2
]
No user-defined-conversion operator available that can perform this conv
ersion, or the operator cannot be called
C:\Rocket\Projects\Exedre\Source\Exedre\Private\ExedreCharacter.cpp(476) : error
C2440: '=' : cannot convert from 'FSHVectorRGB2' to 'float'
No user-defined-conversion operator available that can perform this conv
ersion, or the operator cannot be called
-------- End Detailed Actions Stats --------------------------------------------
---------------
ERROR: UBT ERROR: Failed to produce item: C:\Rocket\Projects\Exedre\Binaries\Win
64\RocketEditor-Exedre.pdb
Cumulative action seconds (8 processors): 0,00 building projects, 10,06 compilin
g, 0,00 creating app bundles, 0,00 generating debug info, 0,00 linking, 0,00 oth
er
UBT execution time: 15,63 seconds
Appuyez sur une touche pour continuer...